Skip to content

Runtime error: table index is nil #44

Description

@ktosikowski

The following error is visible in nginx logs when trying to set value in lrucache:

*10 lua entry thread aborted: runtime error: /usr/share/lua/5.1/resty/lrucache.lua:223: table index is nil

Code leading to the error:

  access_by_lua_block {

    local lrucache = require "resty.lrucache"
    local cache, cache_init_err = lrucache.new(10)

    if not cache or cache_init_err then
        log(ERROR, "Failed to create cache. Reason: " .. (cache_init_err or "unknown"))
    else
        cache:set("dog", 32)
    end
  }

lua-resty-lrucache ver.: 0.08

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions