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

lua entry thread aborted: runtime error: /app/nginx-1.12.1/lua/lib/resty/kafka/request.lua:73: bad argument #1 to 'rshift' (number expected, got cdata) #139

Open
xiaocaichao opened this issue Jun 10, 2022 · 8 comments

Comments

@xiaocaichao
Copy link

报错如下 请教下如何解决?
2022/06/10 16:01:05 [error] 15470#0: 6042419 lua entry thread aborted: runtime error: /app/nginx-1.12.1/lua/lib/resty/kafka/request.lua:73: bad argument #1 to 'rshift' (number expected, got cdata)
stack traceback:
coroutine 0:
[C]: in function 'rshift'
/app/nginx-1.12.1/lua/lib/resty/kafka/request.lua:73: in function 'str_int64'
/app/nginx-1.12.1/lua/lib/resty/kafka/request.lua:248: in function 'message_set'
/app/nginx-1.12.1/lua/lib/resty/kafka/producer.lua:79: in function 'produce_encode'
/app/nginx-1.12.1/lua/lib/resty/kafka/producer.lua:157: in function '_send'
/app/nginx-1.12.1/lua/lib/resty/kafka/producer.lua:209: in function '_batch_send'
/app/nginx-1.12.1/lua/lib/resty/kafka/producer.lua:256: in function </app/nginx-1.12.1/lua/lib/resty/kafka/producer.lua:229>, context: ngx.timer, client: 10.
.., server: 0.0.0.0:8888

相关版本如下
nginx-1.12.1 LuaJIT-2.0.5 lua-nginx-module-0.10.10

@Pink-Maserati
Copy link

请问你最后有解决吗?我也遇到了

@doujiang24
Copy link
Owner

这个错误看起来不太正常,可能是 LuaJIT 版本太低,或者编译选项的问题
请用 OpenResty 官方版本测试下呢?

@doujiang24
Copy link
Owner

另外,这个错误是一直会出现,还是偶尔出现呢?

@Pink-Maserati
Copy link

它一直出现,我早上最后参考#82 这个把str_int64换了之后运行好了

@doujiang24
Copy link
Owner

那就是用了标准 Lua,没有用 luajit ?还是没太明白

@Pink-Maserati
Copy link

我没用 OpenResty ,因为我之前的nginx是用yum方式安装的,然后平滑升级添加了lua-nginx-module模块,期间有安装luajit。

@doujiang24
Copy link
Owner

这个设计之初,就只考虑了 OpenResty/LuaJIT 呢
如果是 OpenResty/LuaJIT 应该是没有问题的,建议你使用 OpenResty 的官方安装包

如果有你有兴趣支持非标准 OpenResty/LuaJIT 的话,欢迎 PR ~
不过 #82 中的修复,我初步看下来,感觉不太对的样子

@Pink-Maserati
Copy link

好的

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

No branches or pull requests

3 participants