apache / apisix-go-plugin-runner

Go Plugin Runner for APISIX
https://apisix.apache.org/
Apache License 2.0
169 stars 69 forks source link

bug: #24

Closed suxi closed 3 years ago

suxi commented 3 years ago

Issue description

Environment

Minimal test code / Steps to reproduce the issue

1.set up a ext-plugin 2.do a request

  1. got 503 response

What's the actual result? (including assertion message & call stack if applicable)

2021/07/20 02:11:21 [warn] 46#46: 29715 [lua] plugin.lua:298: trace_plugins_info_fordebug(): Apisix-Plugins: ext-plugin-pre-req, prometheus, kafka-logger while logging request, client: 172.24.0.1, server: , request: "GET /apis/dianshang/anchor/sales_info?platform_id=71&room_id=100533727735 HTTP/1.1", host: "localhost:9080" 2021/07/20 02:39:28 [crit] 46#46: 75271 connect() to unix:/usr/local/apisix/conf/apisix-45.sock failed (13: Permission denied), client: 172.24.0.1, server: _, request: "GET /apis/dianshang/anchor/sales_info?platform_id=71&room_id=100533727735 HTTP/1.1", host: "localhost:9080" 2021/07/20 02:39:28 [error] 46#46: 75271 [lua] init.lua:553: phasefunc(): failed to connect to the unix socket unix:/usr/local/apisix/conf/apisix-45.sock: permission denied, client: 172.24.0.1, server: , request: "GET /apis/dianshang/anchor/sales_info?platform_id=71&room_id=100533727735 HTTP/1.1", host: "localhost:9080" 2021/07/20 02:39:28 [warn] 46#46: 75271 [lua] plugin.lua:646: runplugin(): ext-plugin-pre-req exits with http status code 503, client: 172.24.0.1, server: , request: "GET /apis/dianshang/anchor/sales_info?platform_id=71&room_id=100533727735 HTTP/1.1", host: "localhost:9080" 2021/07/20 02:39:28 [warn] 46#46: 75271 [lua] plugin.lua:298: trace_plugins_info_fordebug(): Apisix-Plugins: ext-plugin-pre-req, prometheus, kafka-logger, client: 172.24.0.1, server: , request: "GET /apis/dianshang/anchor/sales_info?platform_id=71&room_id=100533727735 HTTP/1.1", host: "localhost:9080" 2021/07/20 02:39:28 [warn] 46#46: 75271 [lua] plugin.lua:298: trace_plugins_info_fordebug(): Apisix-Plugins: ext-plugin-pre-req, prometheus, kafka-logger while logging request, client: 172.24.0.1, server: , request: "GET /apis/dianshang/anchor/sales_info?platform_id=71&roomid=100533727735 HTTP/1.1", host: "localhost:9080" 2021/07/20 02:48:31 [crit] 46#46: *89991 connect() to unix:/usr/local/apisix/conf/apisix-45.sock failed (13: Permission denied), client: 172.24.0.1, server: , request: "GET /apis/dianshang/anchor/sales_info?platform_id=71&room_id=100533727735 HTTP/1.1", host: "localhost:9080" 2021/07/20 02:48:31 [error] 46#46: 89991 [lua] init.lua:553: phasefunc(): failed to connect to the unix socket unix:/usr/local/apisix/conf/apisix-45.sock: permission denied, client: 172.24.0.1, server: , request: "GET /apis/dianshang/anchor/sales_info?platform_id=71&room_id=100533727735 HTTP/1.1", host: "localhost:9080" 2021/07/20 02:48:31 [warn] 46#46: 89991 [lua] plugin.lua:646: runplugin(): ext-plugin-pre-req exits with http status code 503, client: 172.24.0.1, server: , request: "GET /apis/dianshang/anchor/sales_info?platform_id=71&room_id=100533727735 HTTP/1.1", host: "localhost:9080" 2021/07/20 02:48:31 [warn] 46#46: 89991 [lua] plugin.lua:298: trace_plugins_info_fordebug(): Apisix-Plugins: ext-plugin-pre-req, prometheus, kafka-logger, client: 172.24.0.1, server: , request: "GET /apis/dianshang/anchor/sales_info?platform_id=71&room_id=100533727735 HTTP/1.1", host: "localhost:9080" 2021/07/20 02:48:31 [warn] 46#46: 89991 [lua] plugin.lua:298: trace_plugins_info_fordebug(): Apisix-Plugins: ext-plugin-pre-req, prometheus, kafka-logger while logging request, client: 172.24.0.1, server: , request: "GET /apis/dianshang/anchor/sales_info?platform_id=71&room_id=100533727735 HTTP/1.1", host: "localhost:9080"

What's the expected result?

ext plug works correctlly

spacewander commented 3 years ago

What is the permission of /usr/local/apisix/conf/apisix-45.sock?

suxi commented 3 years ago

it's srwxr-xr-x 1 root root 0 Jul 20 01:51 apisix-45.sock when i added a+w, it's work correctly

suxi commented 3 years ago

I fixed it temperately by adding a Nginx.conf setting user root in config.yml at nginx_config: to let Nginx work process run as root instead of nobody