Hello!
On Fri, Nov 10, 2017 at 9:29 PM, <brandon@rabb.it> wrote:
> --broken code from below in init_by_lua
>
> init_by_lua error:
> ...nstributor/include.d/lua-resty-s3/libs/resty/s3_auth.lua:14: no request
> object found
>
init_by_lua* runs in the nginx master process while cosockets cannot
run in that context (yet).
>
> --broken code from below in init_worker_by_lua
> Nov 11 05:14:16 server.dockerd[1968]: 2017/11/11 05:14:16 [alert] 1#1:
> cache manager process 50 exited on signal 11 (core dumped)
> Nov 11 05:14:16 server.dockerd[1968]: 2017/11/11 05:14:16 [alert] 1#1:
> worker process 51 exited on signal 11 (core dumped)
>
I need the full backtrace from the gdb command "bt full" when
inspecting these core dumps. See
https://www.nginx.com/resources/admin-guide/debug/#backtrace
for more details.
BTW, please make sure you use the latest OpenResty release. See
https://openresty.org/en/download.html
>
>
> --broken code
>
> init_worker_by_lua_block {
>
> local cjson = require("cjson")
> local awss3 = require "resty.s3"
>
>
> local s3 = awss3:new("key", "secret", "bunstributor", {timeout=1000*10})
> }
You need to run the cosocket code in a timer handler (created by
ngx.timer.at or ngx.timer.every). The cosocket API is disabled in the
init_worker_by_lua* itself as well (just like init_by_lua*). But it's
available in the timer handler.
Please read the official documentation more carefully.
Regards,
Yichun