Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Plugin throws lua stacktrace errors on endpoints leveraging request termination plugin #32

Closed
jeremyjpj0916 opened this issue Dec 12, 2018 · 4 comments

Comments

@jeremyjpj0916
Copy link
Contributor

jeremyjpj0916 commented Dec 12, 2018

Lua stacktrace:

2018/12/12 16:04:04 [error] 238#0: *2313102 failed to run log_by_lua*: .../local/share/lua/5.1/kong/plugins/zipkin/opentracing.lua:174: attempt to perform arithmetic on field 'KONG_ACCESS_ENDED_AT' (a nil value)
stack traceback:
	.../local/share/lua/5.1/kong/plugins/zipkin/opentracing.lua:174: in function 'log'
	/usr/local/share/lua/5.1/kong/plugins/zipkin/handler.lua:34: in function 'log'
	/usr/local/share/lua/5.1/kong/init.lua:529: in function 'log'
log_by_lua(nginx.conf:150):2: in function <log_by_lua(nginx.conf:150):1> while logging request, client: 10.119.116.11, server: kong, request: "GET /F5/status HTTP/1.1", host: "edge-kong-gateway-stage.****-***-***.company.com"

Just need to anticipate that field being null occasionally I suppose and maybe set that value to -1 or 0 of some sort(HTTP Log plugin takes a similar approach on endpoints that don't actually route or fail to proxy).

@james-callahan
Copy link
Contributor

This should have been fixed back in October with 174737f.
What version are you running?

@jeremyjpj0916
Copy link
Contributor Author

I think @rsbrisci just set it as an environment variable, and maybe it came bundled with 0.14.1 in that case? If so I can force a luarocks install on it and get the latest that way. Will give that a go, thx.

@jeremyjpj0916
Copy link
Contributor Author

jeremyjpj0916 commented Dec 12, 2018

@james-callahan

Seems to be the case(to run log_by_lua*: ...lugin_zipkin_0_0_4_0-kong/plugins/zipkin/opentracing.lua), trying to add a luarocks install to overwrite it adds this to my build, first time I have seen of this msg before:

Step 22/38 : RUN luarocks install kong-plugin-zipkin
 ---> Running in 745db4762940

Warning: The directory '/root/.cache/luarocks' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing /usr/local/bin/luarocks with sudo, you may want sudo's -H flag.
Installing https://luarocks.org/kong-plugin-zipkin-0.1.1-0.src.rock 
Will not remove kong-plugin-zipkin 0.0.4-0.
Removing it would break dependencies for: 
kong 0.14.1-0

Use --force to force removal (warning: this may break modules).
Failed removing.
kong-plugin-zipkin 0.1.1-0 is now installed in /usr/local (license: Apache 2.0)

Checking stability of dependencies in the absence of
kong-plugin-zipkin 0.0.4-0...

Would it be okay to --force remove under these circumstances?

https://github.com/Kong/kong/blob/master/kong-0.14.1-0.rockspec#L39

Maybe this ^ is the issue, since the Kong release bundled it and includes an early iteration in the rockspec?

Edit - Yep I see its in the lua/5.1/kong_plugin_zipkin_0_0_4_0-kong/ folder then /plugins/zipkin/{src here}, any reason this was not treated like every other custom plugin and got a dedicated folder? I suppose I could overwrite the rockspec after I pull the tar, then rm rf this directory and install via luarocks... A bit painful might just wait to use zipkin on 1.0 .

@jeremyjpj0916
Copy link
Contributor Author

jeremyjpj0916 commented Dec 13, 2018

But yeah I see how I could probs patchwork around to get newest one running on 0.14.1 but not worth the time since 1.0 is close by. will just deploy latest on that, hopefully they are decoupled now xD .

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

No branches or pull requests

2 participants