LUA connector fails after a stream is stopped

nope, again the app wasn’t able after some time to authenticate. see below the debug output of nginx errs. and the third is keep trying until the rtmp is stopped. also having and postgresql notice, and i wonder if this could be the issue

[notice] 23067#23067: *3 [lua] postgres.lua:73: select(): ^[[0m^[[1m^[[36mSQL: ^[[0m^[[35mSELECT key, value, extract(epoch from expires_at - (now() at time zone 'UTC')) as expires_in, extract(epoch from expires_at) as expires_at from keystore where account_id = 19 and stream_id = 1 and (expires_at > (now() at time zone 'UTC') or expires_at is null)^[[0m^[[0m, context: ngx.timer

2017/11/14 16:54:40 [debug] 23067#23067: *381 [lua] http.lua:631: send_request():
PUT /kraken/channels/59085056 HTTP/1.1^M
Content-Length: 90^M
User-Agent: lua-resty-http/0.11 (Lua) ngx_lua/10010^M
Accept: application/vnd.twitchtv.v5+json^M
Content-Type: application/json^M
Authorization: OAuth 2ixdxjwk7kmdmmu5rdrjzug6iqyl3c^M
Host: api.twitch.tv^M

2017/11/14 16:54:40 [debug] 23067#23067: *3 [lua] http.lua:631: send_request():
GET /kraken/user/ HTTP/1.1^M
Accept: application/vnd.twitchtv.v5+json^M
User-Agent: lua-resty-http/0.11 (Lua) ngx_lua/10010^M
Authorization: OAuth 2ixdxjwk7kmdmmu5rdrjzug6iqyl3c^M
Host: api.twitch.tv^M


2017/11/14 16:54:41 [debug] 23067#23067: *3 [lua] http.lua:631: send_request():
GET /kraken/streams/59085056 HTTP/1.1^M
Accept: application/vnd.twitchtv.v5+json^M
User-Agent: lua-resty-http/0.11 (Lua) ngx_lua/10010^M
Authorization: OAuth 2ixdxjwk7kmdmmu5rdrjzug6iqyl3c^M
Host: api.twitch.tv^M