Kong/kong-plugin-zipkin

Kong zipkin plugin on 1.2.0rc1 errors/problems

jeremyjpj0916 opened this issue · 4 comments

I specifically see this error printing over and over:

2019/05/29 16:29:56 [error] 36#0: *2801 lua coroutine: runtime error: .../local/share/lua/5.1/kong/plugins/zipkin/opentracing.lua:26: attempt to index field 'conf_to_tracer' (a nil value)
--
  | stack traceback:
  | coroutine 0:
  | .../local/share/lua/5.1/kong/plugins/zipkin/opentracing.lua: in function 'get_tracer'
  | .../local/share/lua/5.1/kong/plugins/zipkin/opentracing.lua:48: in function 'initialise_request'
  | .../local/share/lua/5.1/kong/plugins/zipkin/opentracing.lua:87: in function 'get_context'
  | .../local/share/lua/5.1/kong/plugins/zipkin/opentracing.lua:97: in function <.../local/share/lua/5.1/kong/plugins/zipkin/opentracing.lua:93>
  | coroutine 1:
  | [C]: in function 'resume'
  | coroutine.wrap:21: in function <coroutine.wrap:21>
  | /usr/local/share/lua/5.1/kong/init.lua:665: in function 'access'
  | access_by_lua(nginx.conf:139):2: in function <access_by_lua(nginx.conf:139):1>, client: 10.xxx.xx.x, server: kong, request: "GET /ping HTTP/1.1", host: "gateway-dev-core.company.com"

Code snippit the nil call fails on:

local tracer = self.conf_to_tracer[conf]

Note the /ping endpoint has the request termination plugin on it and makes it throws a 200 success with http body of Success in kongs standard { message : Successs } json.

Due to the error this endpoint actually stops functioning:

With zipkin errors a flying:

/ $ curl localhost:8000/ping
curl: (52) Empty reply from server

No Zipkin:

/ $ curl localhost:8000/ping
{"message":"Success"} 

Was on Kong 1.0.3 prior and it was working fine there.

OS: Docker Kong Alpine 3.6
Kong version: 1.2.0rc1

Zipkin was enabled globally fyi.

Thanks,
Jeremy

Hunch for future readers (haven't checked any of this):

We ensure backwards-compatibility to execute old plugins' :new() handler here: https://github.com/Kong/kong/blob/next/kong/db/dao/plugins.lua#L273-L278

However, iirc, Zipkin has some sort of multiple inheritance, so the getmetatable(handler) == BasePlugin condition may not be true. In which case, maybe we need to call is().

As per usual dropping a fix in under 24 hours 💯 . Good stuff, will test on the next bintray drop.

@thibaultcha confirmed rc2 fixes this as well on my end. Closing the issue!