bukaleyang / zhongkui-waf

WAF based on lua-nginx-module.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

部署后功能不可用,能登录钟馗,但是功能全都不能用

Lijuming33 opened this issue · comments

(base) w@XiaoXin-15-Air:/usr/local/openresty/nginx/logs$ tail -f error.log
2024/05/20 12:39:12 [error] 673227#673227: 2 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /login HTTP/1.1", host: "127.0.0.1:1226"
2024/05/20 12:39:12 [error] 673227#673227: 2 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/css/pear.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/login"
2024/05/20 12:39:12 [error] 673227#673227: 2 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /admin/css/other/login.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/login"
2024/05/20 12:39:12 [error] 673227#673227: 3 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /admin/images/logo.png HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/login"
2024/05/20 12:39:12 [error] 673227#673227: 5 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/pear.js HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/login"
2024/05/20 12:39:12 [error] 673227#673227: 4 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/layui/layui.js HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/login"
2024/05/20 12:39:12 [error] 673227#673227: 2 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/font/iconfont.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/pear/css/pear.css"
2024/05/20 12:39:12 [error] 673227#673227: 3 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/layui/css/layui.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/pear/css/pear.css"
2024/05/20 12:39:12 [error] 673227#673227: 5 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/css/module/nprogress.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/pear/css/pear.css"
2024/05/20 12:39:12 [error] 673227#673227: 7 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/css/module/message.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/pear/css/pear.css"
2024/05/20 12:39:12 [error] 673227#673227: 6 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/css/module/loading.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/pear/css/pear.css"
2024/05/20 12:39:12 [error] 673227#673227: 4 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/css/module/topBar.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/pear/css/pear.css"
2024/05/20 12:39:12 [error] 673227#673227: 3 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/css/module/layout.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/pear/css/pear.css"
2024/05/20 12:39:12 [error] 673227#673227: 5 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/css/module/button.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/pear/css/pear.css"
2024/05/20 12:39:12 [error] 673227#673227: 7 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/css/module/table.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/pear/css/pear.css"
2024/05/20 12:39:12 [error] 673227#673227: 4 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/css/module/frame.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/pear/css/pear.css"
2024/05/20 12:39:12 [error] 673227#673227: 2 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/css/module/layer.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/pear/css/pear.css"
2024/05/20 12:39:12 [error] 673227#673227: 6 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/css/module/toast.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/pear/css/pear.css"
2024/05/20 12:39:12 [error] 673227#673227: 3 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/css/module/menu.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/pear/css/pear.css"
2024/05/20 12:39:12 [error] 673227#673227: 5 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/css/module/form.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/pear/css/pear.css"
2024/05/20 12:39:12 [error] 673227#673227: 7 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/css/module/link.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/pear/css/pear.css"
2024/05/20 12:39:12 [error] 673227#673227: 4 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/css/module/tab.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/pear/css/pear.css"
2024/05/20 12:39:12 [error] 673227#673227: 2 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/css/module/tag.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/pear/css/pear.css"
2024/05/20 12:39:12 [error] 673227#673227: 6 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/css/module/fullscreen.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/pear/css/pear.css"
2024/05/20 12:39:12 [error] 673227#673227: 3 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/css/module/popover.min.css HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/pear/css/pear.css"
2024/05/20 12:39:12 [error] 673227#673227: 3 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/module/theme.js?v=3.40.0 HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/login"
2024/05/20 12:39:12 [error] 673227#673227: 6 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/module/button.js?v=3.40.0 HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/login"
2024/05/20 12:39:12 [error] 673227#673227: 2 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/layui/font/iconfont.woff2?v=282 HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/component/layui/css/layui.css"
2024/05/20 12:39:12 [error] 673227#673227: 2 failed to run log_by_lua: /usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/nginx/zhongkui/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "GET /component/pear/module/popup.js?v=3.40.0 HTTP/1.1", host: "127.0.0.1:1226", referrer: "http://127.0.0.1:1226/login"

有没有正确配置IP位置数据库文件?是否最新版?

我是最新的,也不行

2024/05/20 18:19:21 [error] 81385#81385: *44 [lua] config.lua:350: reloadNginx(): failed to reload Nginx configuration., client: 127.0.0.1, server: localhost, request: "POST /defense/basic/update HTTP/1.1", host: "localhost:1226", referrer: "http://localhost:1226/view/defense/basic.html"
2024/05/20 18:19:21 [error] 81385#81385: 44 failed to run log_by_lua: /usr/local/openresty/zhongkui-waf/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/zhongkui-waf/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/zhongkui-waf/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "POST /defense/basic/update HTTP/1.1", host: "localhost:1226", referrer: "http://localhost:1226/view/defense/basic.html"
2024/05/20 18:19:23 [error] 81385#81385: *44 [lua] file.lua:110: writeStringToFile(): Failed to open file /usr/local/openresty/zhongkui-waf/conf/zhongkui.conf: Permission denied, client: 127.0.0.1, server: localhost, request: "POST /defense/basic/update HTTP/1.1", host: "localhost:1226", referrer: "http://localhost:1226/view/defense/basic.html"
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required
2024/05/20 18:19:23 [error] 81385#81385: *44 [lua] config.lua:350: reloadNginx(): failed to reload Nginx configuration., client: 127.0.0.1, server: localhost, request: "POST /defense/basic/update HTTP/1.1", host: "localhost:1226", referrer: "http://localhost:1226/view/defense/basic.html"
2024/05/20 18:19:23 [error] 81385#81385: 44 failed to run log_by_lua: /usr/local/openresty/zhongkui-waf/log_and_traffic.lua:191: attempt to index field 'names' (a nil value)
stack traceback:
/usr/local/openresty/zhongkui-waf/log_and_traffic.lua:191: in function 'countTrafficStats'
/usr/local/openresty/zhongkui-waf/log_and_traffic.lua:249: in main chunk while logging request, client: 127.0.0.1, server: localhost, request: "POST /defense/basic/update HTTP/1.1", host: "localhost:1226", referrer: "http://localhost:1226/view/defense/basic.html"

目前定位到是文件没有写权限导致的

2024/05/20 18:58:14 [error] 100013#100013: *11 [lua] file.lua:110: writeStringToFile(): Failed to open file /usr/local/openresty/zhongkui-waf/conf/zhongkui.conf: Permission denied, client: 127.0.0.1, server: localhost, request: "POST /defense/basic/update HTTP/1.1", host: "localhost:1226", referrer: "http://localhost:1226/view/common/storage.html"
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required
2024/05/20 18:58:14 [error] 100013#100013: *11 [lua] config.lua:350: reloadNginx(): failed to reload Nginx configuration., client: 127.0.0.1, server: localhost, request: "POST /defense/basic/update HTTP/1.1", host: "localhost:1226", referrer: "http://localhost:1226/view/common/storage.html"

@xincao9 @Lijuming33 IP地理位置默认没开情况下的一个bug,今天已经修复,你们可以把原来的zhongkui文件删掉重新下载,另外一定要保证nginx对日志和钟馗文件目录有读写权限,详情见文档。

ok