-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 'item' (a boolean value) #8648
Comments
@cloorc Did you see any error log entries before these kinds of errors? I think this error is not the "primary crime scene". Also, is it possible to print the data in your ETCD? |
ETCD works fine. And what may results in this issue? I've no any thoughts about this issue. |
I have no idea because I cannot reproduce this issue. |
I often encounter this problem and need to restart apisix server to recover |
I guess it could be resulted from compaction(or related operations) of etcd. |
How much your apisixserver's memory using? I also have met many times, and I found apisixserver's memory is full last time. |
similar to #8492 ? |
I think …… yes |
We've reproduced it in our test env steadily, by inserting and deleting apisix resources while an etcd compaction occurred. And the issue will keep on exist until we restart apisix mannually. So I dive into the source code and find a weired spot: apisix/apisix/core/config_etcd.lua Lines 392 to 401 in e4e7c73
Line#397 returns a "false" while no "err" is provided. And the caller of this function checks err only: apisix/apisix/core/config_etcd.lua Lines 606 to 607 in e021266
After changing this line to But i have no time to reproduce it with minimal step way right now. |
It's intended. So that the sync will be reentered with apisix/apisix/core/config_etcd.lua Lines 651 to 653 in 02421e2
|
Current Behavior
Newly installed apisix cluster throws following exception:
Expected Behavior
Running without former issue.
Error Logs
2023/01/10 10:06:21 [error] 48#48: *1334880 [lua] config_etcd.lua:662: failed to fetch data from etcd: /usr/local/apisix/apisix/core/config_util.lua:99: attempt to index local 'item' (a boolean value)
stack traceback:
/usr/local/apisix/apisix/core/config_util.lua:99: in function 'fire_all_clean_handlers'
/usr/local/apisix/apisix/core/config_etcd.lua:379: in function 'sync_data'
/usr/local/apisix/apisix/core/config_etcd.lua:609: in function </usr/local/apisix/apisix/core/config_etcd.lua:599>
[C]: in function 'xpcall'
/usr/local/apisix/apisix/core/config_etcd.lua:599: in function </usr/local/apisix/apisix/core/config_etcd.lua:577>, etcd key: /apisix/routes, context: ngx.timer
2023/01/10 10:06:21 [error] 50#50: *1334917 [lua] config_etcd.lua:662: failed to fetch data from etcd: /usr/local/apisix/apisix/core/config_util.lua:99: attempt to index local 'item' (a boolean value)
stack traceback:
/usr/local/apisix/apisix/core/config_util.lua:99: in function 'fire_all_clean_handlers'
/usr/local/apisix/apisix/core/config_etcd.lua:379: in function 'sync_data'
/usr/local/apisix/apisix/core/config_etcd.lua:609: in function </usr/local/apisix/apisix/core/config_etcd.lua:599>
[C]: in function 'xpcall'
/usr/local/apisix/apisix/core/config_etcd.lua:599: in function </usr/local/apisix/apisix/core/config_etcd.lua:577>, etcd key: /apisix/routes, context: ngx.timer
2023/01/10 10:06:22 [error] 56#56: *1334983 [lua] config_etcd.lua:662: failed to fetch data from etcd: /usr/local/apisix/apisix/core/config_util.lua:99: attempt to index local 'item' (a boolean value)
stack traceback:
/usr/local/apisix/apisix/core/config_util.lua:99: in function 'fire_all_clean_handlers'
/usr/local/apisix/apisix/core/config_etcd.lua:379: in function 'sync_data'
/usr/local/apisix/apisix/core/config_etcd.lua:609: in function </usr/local/apisix/apisix/core/config_etcd.lua:599>
[C]: in function 'xpcall'
/usr/local/apisix/apisix/core/config_etcd.lua:599: in function </usr/local/apisix/apisix/core/config_etcd.lua:577>, etcd key: /apisix/routes, context: ngx.timer
Steps to Reproduce
apache/apisix:3.1.0-debian
Environment
apisix version
): 3.1.0 (3.1.0-debian official docker image)uname -a
): Linux apisix-v3-0-58d694d79d-8567j 4.4.0-210-generic update the doc of https for Chinese version. #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 GNU/Linuxopenresty -V
ornginx -V
): nginx version: openresty/1.21.4.1curl http://127.0.0.1:9090/v1/server_info
): {"boot_time":1672910773,"etcd_version":"3.4.0","hostname":"apisix-v3-0-58d694d79d-8567j","version":"3.1.0","id":"c978a662-9041-4e7b-9a4d-d5bea6ef32f9"}luarocks --version
):The text was updated successfully, but these errors were encountered: