[go: nahoru, domu]

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

help request: can't hot-reload limit-count #11382

Open
ShuLian1984 opened this issue Jul 2, 2024 · 2 comments
Open

help request: can't hot-reload limit-count #11382

ShuLian1984 opened this issue Jul 2, 2024 · 2 comments

Comments

@ShuLian1984
Copy link

Description

The execution steps are as follows:

  1. Apisix is run, Add the limit-count plugin to the config.yml configuration
  2. Configure limit-count to take effect on the specified route through apisix dashboard
  3. Request and response an 500 error

response context

<html>

<head>
    <title>500 Internal Server Error</title>
</head>

<body>
    <center>
        <h1>500 Internal Server Error</h1>
    </center>
    <hr>
    <center>openresty</center>
    <p><em>Powered by <a href="https://apisix.apache.org/">APISIX</a>.</em></p>
</body>

</html>

apisix error.log

2024/07/01 18:08:08 [error] 2900479#2900479: *1548899123 lua entry thread aborted: runtime error: .../apisix/apisix/plugins/limit-count/limit-count-local.lua:67: attempt to index field 'limit_count' (a nil value)
stack traceback:
coroutine 0:
        .../apisix/apisix/plugins/limit-count/limit-count-local.lua: in function 'incoming'
        /usr/local/apisix/apisix/plugins/limit-count/init.lua:302: in function 'phase_func'
        /usr/local/apisix/apisix/plugin.lua:1148: in function 'run_plugin'
        /usr/local/apisix/apisix/init.lua:725: in function 'http_access_phase'
        access_by_lua(nginx.conf:356):2: in main chunk, client: 100.123.22.18, server: _, request: "GET /device-manager/v1/qms/device-active/list?startTimestamp=1461686400000&endTimestamp=1461772799999&domain=cn&pageNumber=1&pageSize=100&productKey=96d90227fd8 HTTP/1.1", host: "www.example.com"

Environment

  • APISIX version (run apisix version):
[root@ali-01 conf]# rpm -qa|grep apisix
apache-apisix-repo-1.0-1.noarch
apisix-runtime-1.0.1-0.el7.x86_64
apisix-dashboard-local-3.0.1-0.el7.x86_64
apisix-3.7.0-0.el7.x86_64
  • Operating system (run uname -a):
Linux ali-01 3.10.0-1160.102.1.el7.x86_64 #1 SMP Tue Oct 17 15:42:21 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
  • OpenResty / Nginx version (run openresty -V or nginx -V):
nginx version: openresty/1.21.4.2
built by gcc 9.3.1 20200408 (Red Hat 9.3.1-2) (GCC) 
built with OpenSSL 1.1.1s  1 Nov 2022
TLS SNI support enabled
configure arguments: --prefix=/usr/local/openresty/nginx --with-cc-opt='-O2 -DAPISIX_RUNTIME_VER=1.0.1 -DNGX_GRPC_CLI_ENGINE_PATH=/usr/local/openresty/libgrpc_engine.so -DNGX_HTTP_GRPC_CLI_ENGINE_PATH=/usr/local/openresty/libgrpc_engine.so -DNGX_LUA_ABORT_AT_PANIC -I/usr/local/openresty/zlib/include -I/usr/local/openresty/pcre/include -I/usr/local/openresty/openssl111/include' --add-module=../ngx_devel_kit-0.3.2 --add-module=../echo-nginx-module-0.63 --add-module=../xss-nginx-module-0.06 --add-module=../ngx_coolkit-0.2 --add-module=../set-misc-nginx-module-0.33 --add-module=../form-input-nginx-module-0.12 --add-module=../encrypted-session-nginx-module-0.09 --add-module=../srcache-nginx-module-0.33 --add-module=../ngx_lua-0.10.25 --add-module=../ngx_lua_upstream-0.07 --add-module=../headers-more-nginx-module-0.34 --add-module=../array-var-nginx-module-0.06 --add-module=../memc-nginx-module-0.19 --add-module=../redis2-nginx-module-0.15 --add-module=../redis-nginx-module-0.3.9 --add-module=../ngx_stream_lua-0.0.13 --with-ld-opt='-Wl,-rpath,/usr/local/openresty/luajit/lib -Wl,-rpath,/usr/local/openresty/wasmtime-c-api/lib -L/usr/local/openresty/zlib/lib -L/usr/local/openresty/pcre/lib -L/usr/local/openresty/openssl111/lib -Wl,-rpath,/usr/local/openresty/zlib/lib:/usr/local/openresty/pcre/lib:/usr/local/openresty/openssl111/lib' --add-module=/tmp/tmp.xJPlkBGY23/openresty-1.21.4.2/../mod_dubbo-1.0.2 --add-module=/tmp/tmp.xJPlkBGY23/openresty-1.21.4.2/../ngx_multi_upstream_module-1.1.1 --add-module=/tmp/tmp.xJPlkBGY23/openresty-1.21.4.2/../apisix-nginx-module-1.15.0 --add-module=/tmp/tmp.xJPlkBGY23/openresty-1.21.4.2/../apisix-nginx-module-1.15.0/src/stream --add-module=/tmp/tmp.xJPlkBGY23/openresty-1.21.4.2/../apisix-nginx-module-1.15.0/src/meta --add-module=/tmp/tmp.xJPlkBGY23/openresty-1.21.4.2/../wasm-nginx-module-0.6.5 --add-module=/tmp/tmp.xJPlkBGY23/openresty-1.21.4.2/../lua-var-nginx-module-v0.5.3 --add-module=/tmp/tmp.xJPlkBGY23/openresty-1.21.4.2/../grpc-client-nginx-module-v0.4.4 --with-poll_module --with-pcre-jit --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module --with-http_v2_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --with-http_stub_status_module --with-http_realip_module --with-http_addition_module --with-http_auth_request_module --with-http_secure_link_module --with-http_random_index_module --with-http_gzip_static_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-threads --with-compat --with-stream --with-http_ssl_module
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info):
[root@ali-01 conf]# etcdctl endpoint status -w table
+----------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
|    ENDPOINT    |        ID        | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |
+----------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
| 127.0.0.1:2379 | 8ce6dbde018f11d9 |   3.5.9 |  307 kB |      true |      false |         2 |       5617 |               5617 |        |
+----------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
  • APISIX Dashboard version, if relevant:
apisix-dashboard-local-3.0.1-0.el7.x86_64
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):
  • other
[root@ali-01 plugins]# md5sum limit-count.lua limit-count/*
15cb4555fdd1c02155b55b1171ffc669  limit-count.lua
43718af7c1138ad3d02c0eae50f5b907  limit-count/init.lua
f52a2b62833108e6020545796ceed3ae  limit-count/limit-count-local.lua
df6cb9bb121731f6dacca75a66f51cdc  limit-count/limit-count-redis-cluster.lua
e786381dd7f363536def279d5f87870e  limit-count/limit-count-redis.lua
@ShuLian1984
Copy link
Author
ShuLian1984 commented Jul 2, 2024

All 5 environments are like this,Only after restarting can it function properly.

@shreemaan-abhishek
Copy link
Contributor

you need to run the plugin reload api or reload apisix for hot reload.

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

No branches or pull requests

2 participants