nginx-auth-cas-lua icon indicating copy to clipboard operation
nginx-auth-cas-lua copied to clipboard

store is nil

Open linux2014linux opened this issue 4 years ago • 5 comments

Cas login pass, cas.lua error happen:

2021/03/11 17:49:04 [error] 87487#2288134: *2 lua entry thread aborted: runtime error: /usr/local/Cellar/openresty/1.19.3.1_1/lualib/cas.lua:78: attempt to index upvalue 'store' (a nil value)
stack traceback:
coroutine 0:
        /usr/local/Cellar/openresty/1.19.3.1_1/lualib/cas.lua: in function '_set_store_and_cookie'
        /usr/local/Cellar/openresty/1.19.3.1_1/lualib/cas.lua:118: in function 'validate_with_CAS'
        /usr/local/Cellar/openresty/1.19.3.1_1/lualib/cas.lua:135: in function 'forceAuthentication'
        access_by_lua(nginx.conf:35):1: in main chunk, client: 127.0.0.1, server: console.cloud.ll.com, request: "GET /s1?ticket=ST-5-9Z-euig-7AtF0nZnLrKVZTeebc0liulei07 HTTP/1.1", host: "console.cloud.ll.com"

linux2014linux avatar Mar 11 '21 09:03 linux2014linux

I have enhanced error message for this configuration issue.

prigaux avatar Mar 11 '21 10:03 prigaux

New error:

writing a global Lua variable ('store_name') which may lead to race conditions between concurrent requests, so prefer the use of 'local' variables

linux2014linux avatar Mar 11 '21 10:03 linux2014linux

Oops, my version of nginx+lua did not warn me :-(

Corrected in updated commit.

prigaux avatar Mar 11 '21 10:03 prigaux

@prigaux The cas.lua basic logci may be ok, but it has many lua grammar error.

linux2014linux avatar Mar 11 '21 10:03 linux2014linux

It has been tested and validated with debian 10 libnginx-mod-http-lua which uses lua nginx 0.10.13 (ref)

prigaux avatar Mar 11 '21 10:03 prigaux