charles1503 commented on issue #4897:
URL: https://github.com/apache/apisix/issues/4897#issuecomment-907089171


   > Would you apply the change from 
https://github.com/apache/apisix/pull/4900/files, and show us the raised error 
message?
   I passed your hint, this problem is solved, File permissions caused。
   Your code reported an error:
   ```
   2021/08/27 09:45:05 [error] 45#45: init_worker_by_lua error: 
/usr/local/apisix/apisix/plugin.lua:241: bad argument #2 to 'error' (number 
expected, got string)
   stack traceback:
           [C]: in function 'error'
           /usr/local/apisix/apisix/plugin.lua:241: in function 'load'
           /usr/local/apisix/apisix/plugin.lua:498: in function 'init_worker'
           /usr/local/apisix/apisix/init.lua:115: in function 'http_init_worker'
           init_worker_by_lua:2: in main chunk
   2021/08/27 09:45:05 [error] 46#46: init_worker_by_lua error: 
/usr/local/apisix/apisix/plugin.lua:241: bad argument #2 to 'error' (number 
expected, got string)
   stack traceback:
           [C]: in function 'error'
           /usr/local/apisix/apisix/plugin.lua:241: in function 'load'
           /usr/local/apisix/apisix/plugin.lua:498: in function 'init_worker'
           /usr/local/apisix/apisix/init.lua:115: in function 'http_init_worker'
           init_worker_by_lua:2: in main chunk
   2021/08/27 09:45:05 [warn] 49#49: *3 [lua] plugin.lua:150: load(): new 
plugins: 
{"limit-conn":true,"proxy-cache":true,"request-id":true,"zipkin":true,"http-logger":true,"proxy-mirror":true,"fault-injection":true,"prometheus":true,"ip-restriction":true,"udp-logger":true,"redirect":true,"jwt-auth":true,"proxy-rewrite":true,"response-rewrite":true,"example-plugin":true,"traffic-split":true,"ext-plugin-pre-req":true,"hmac-auth":true,"wolf-rbac":true,"api-breaker":true,"uri-blocker":true,"grpc-transcode":true,"request-validation":true,"key-auth":true,"limit-req":true,"kafka-logger":true,"ext-plugin-post-req":true,"limit-count":true,"client-control":true,"serverless-post-function":true,"syslog":true,"referer-restriction":true,"tcp-logger":true,"sls-logger":true,"echo":true,"basic-auth":true,"openid-connect":true,"batch-requests":true,"cors":true,"serverless-pre-function":true,"consumer-restriction":true,"authz-keycloak":true,"server-info":true},
 context: init_worker_by_lua*
   2021/08/27 09:45:05 [warn] 49#49: *3 [lua] plugin.lua:192: load_stream(): 
new plugins: {"mqtt-proxy":true,"limit-conn":true}, context: init_worker_by_lua*
   ```
   Changed to string splicing solved
   ```
   2021/08/27 09:48:02 [error] 46#46: init_worker_by_lua error: 
/usr/local/apisix/apisix/plugin.lua:241: failed to load the configuration file: 
failed to open file: /usr/local/apisix/conf/config.yaml, error 
info:/usr/local/apisix/conf/config.yaml: Permission denied
   stack traceback:
           [C]: in function 'error'
           /usr/local/apisix/apisix/plugin.lua:241: in function 'load'
           /usr/local/apisix/apisix/plugin.lua:498: in function 'init_worker'
           /usr/local/apisix/apisix/init.lua:115: in function 'http_init_worker'
           init_worker_by_lua:2: in main chunk
   2021/08/27 09:48:02 [error] 45#45: init_worker_by_lua error: 
/usr/local/apisix/apisix/plugin.lua:241: failed to load the configuration file: 
failed to open file: /usr/local/apisix/conf/config.yaml, error 
info:/usr/local/apisix/conf/config.yaml: Permission denied
   stack traceback:
           [C]: in function 'error'
           /usr/local/apisix/apisix/plugin.lua:241: in function 'load'
           /usr/local/apisix/apisix/plugin.lua:498: in function 'init_worker'
           /usr/local/apisix/apisix/init.lua:115: in function 'http_init_worker'
           init_worker_by_lua:2: in main chunk
   2021/08/27 09:48:02 [warn] 49#49: *3 [lua] plugin.lua:150: load(): new 
plugins: 
{"ext-plugin-post-req":true,"tcp-logger":true,"sls-logger":true,"kafka-logger":true,"ext-plugin-pre-req":true,"api-breaker":true,"proxy-mirror":true,"redirect":true,"cors":true,"zipkin":true,"authz-keycloak":true,"request-id":true,"uri-blocker":true,"limit-count":true,"response-rewrite":true,"fault-injection":true,"client-control":true,"proxy-rewrite":true,"batch-requests":true,"proxy-cache":true,"wolf-rbac":true,"limit-conn":true,"referer-restriction":true,"traffic-split":true,"http-logger":true,"prometheus":true,"serverless-post-function":true,"udp-logger":true,"limit-req":true,"example-plugin":true,"request-validation":true,"jwt-auth":true,"echo":true,"serverless-pre-function":true,"syslog":true,"ip-restriction":true,"basic-auth":true,"hmac-auth":true,"consumer-restriction":true,"grpc-transcode":true,"openid-connect":true,"key-auth":true,"server-info":true},
 context: init_worker_by_lua*
   2021/08/27 09:48:02 [warn] 49#49: *3 [lua] plugin.lua:192: load_stream(): 
new plugins: {"mqtt-proxy":true,"limit-conn":true}, context: init_worker_by_lua*
   ```
   I adjusted the file permissions and it can run normally。
   Thanks a lot!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to