ficusio / openresty

Lightweight OpenResty Docker image
132 stars 37 forks source link

Bad "zone" argument #16

Open abraae opened 8 years ago

abraae commented 8 years ago

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 commented 5 years ago

how to slove the problem?

qixiaobo commented 4 years ago
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