Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad "zone" argument #16

Open
abraae opened this issue May 7, 2016 · 2 comments
Open

Bad "zone" argument #16

abraae opened this issue May 7, 2016 · 2 comments

Comments

@abraae
Copy link

abraae commented May 7, 2016

I have the following problem with both alpine and debian flavours when clicking "Try this link" in the example application:

2016/05/07 10:04:50 [error] 7#0: *1 lua entry thread aborted: runtime error: /opt/openresty/nginx//lualib/resty/shcache.lua:429: bad "zone" argument
stack traceback:
coroutine 0:
    [C]: in function 'get_stale'
    /opt/openresty/nginx//lualib/resty/shcache.lua:429: in function '_get'
    /opt/openresty/nginx//lualib/resty/shcache.lua:457: in function 'load'
    /opt/openresty/nginx//lualib/example/gh.lua:72: in function 'getOrgCached'
    content_by_lua(nginx.conf:54):9: in function <content_by_lua(nginx.conf:54):1>, client: 121.98.102.210, server: , request: "GET /show-org/ficusio HTTP/1.1", host: "a.example.com", referrer: "http://a.example.com/"

@yourlovemyall
Copy link

how to slove the problem?

@qixiaobo
Copy link

local function check_zone(zone)
    if not zone or type(zone) ~= "table" then
        error("bad \"zone\" argument", 2)
    end
    
    zone = zone[1]
    if type(zone) ~= "userdata" then
        error("bad \"zone\" argument", 2)
    end
    
    return zone
end

I think you use shard.get but you must use shard:get

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants