Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: attempt to index local 'opentracing' (a nil value) when using zipkin plugin #10590

Closed
junhao69535 opened this issue Dec 4, 2023 · 4 comments · Fixed by #10666
Closed
Labels
bug Something isn't working

Comments

@junhao69535
Copy link
Contributor

junhao69535 commented Dec 4, 2023

Description

this situation is rarely triggered, approximately tens of millions of occurrences only occur a few times. more likely to occur when the request is a websocket.

error msg:
51#51: 4824 failed to run log_by_lua: ...ocal/apisix/plugins/apisix/plugins/zipkin.lua:268: attempt to index local 'opentracing' (a nil value)
stack traceback:
...ocal/apisix/plugins/apisix/plugins/log-zipkin.lua:268: in function 'phase_func'
/usr/local/apisix/apisix/plugin.lua:1139: in function 'run_plugin'
/usr/local/apisix/apisix/plugin.lua:1172: in function 'run_global_rules'
/usr/local/apisix/apisix/init.lua:461: in function 'common_phase'
/usr/local/apisix/apisix/init.lua:870: in function 'http_log_phase'
log_by_lua(nginx.conf:417):2: in main chunk while logging request, client: 10.255.217.88, server: _, request: "GET / HTTP/1.1", upstream: "http://10.212.166.227:9082/", host: "xxx.com"

Environment

  • APISIX version (run apisix version): 2.14.1
  • Operating system (run uname -a): Linux apisix-b7d9c6fd4-5tn2r 4.19.0-10-amd64 change: added doc of how to load plugin. #1 SMP Debian 4.19.132-1 (2020-07-24) x86_64 GNU/Linux
  • OpenResty / Nginx version (run openresty -V or nginx -V): openresty/1.21.4.2
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info): 3.4.0
  • APISIX Dashboard version, if relevant: 3.0.1
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):
@moonming moonming changed the title help request: attempt to index local 'opentracing' (a nil value) when using zipkin plugin bug: attempt to index local 'opentracing' (a nil value) when using zipkin plugin Dec 4, 2023
@moonming moonming added the bug Something isn't working label Dec 4, 2023
@moonming moonming moved this to 📋 Backlog in Apache APISIX backlog Dec 4, 2023
@moonming
Copy link
Member

moonming commented Dec 4, 2023

I looked at the modification history of this file https://github.com/apache/apisix/commits/master/apisix/plugins/zipkin.lua, and there is no PR to modify this bug. So this bug still exists.
https://github.com/apache/apisix/blob/2.14.1/apisix/plugins/zipkin.lua#L268C2-L268C2 I haven't found a possible cause of this issue, @junhao69535 would you like to fix it?

@junhao69535
Copy link
Contributor Author

I looked at the modification history of this file https://github.com/apache/apisix/commits/master/apisix/plugins/zipkin.lua, and there is no PR to modify this bug. So this bug still exists. https://github.com/apache/apisix/blob/2.14.1/apisix/plugins/zipkin.lua#L268C2-L268C2 I haven't found a possible cause of this issue, @junhao69535 would you like to fix it?

If it happens again, I will find the cause and fix it.

@junhao69535
Copy link
Contributor Author

I looked at the modification history of this file https://github.com/apache/apisix/commits/master/apisix/plugins/zipkin.lua, and there is no PR to modify this bug. So this bug still exists. https://github.com/apache/apisix/blob/2.14.1/apisix/plugins/zipkin.lua#L268C2-L268C2 I haven't found a possible cause of this issue, @junhao69535 would you like to fix it?

@moonming , I found the cause and submitted a PR: #10666

@moonming moonming moved this from 📋 Backlog to 👀 In review in Apache APISIX backlog Dec 19, 2023
@moonming
Copy link
Member

I looked at the modification history of this file https://github.com/apache/apisix/commits/master/apisix/plugins/zipkin.lua, and there is no PR to modify this bug. So this bug still exists. https://github.com/apache/apisix/blob/2.14.1/apisix/plugins/zipkin.lua#L268C2-L268C2 I haven't found a possible cause of this issue, @junhao69535 would you like to fix it?

@moonming , I found the cause and submitted a PR: #10666

good work 👍

junhao69535 pushed a commit to junhao69535/apisix that referenced this issue Dec 21, 2023
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Apache APISIX backlog Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants