-
Notifications
You must be signed in to change notification settings - Fork 24
bug: phase_func(): failed to connect to the unix socket unix:/usr/local/apisix/conf/apisix-1.sock: permission denied #53
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
Comments
Your APISIX worker processes run as the FYI:
|
Does python runner has a similar code like |
Look like we need to fix it in
CC @SkyeYoung |
Let me try to fix it. |
Yeah, I was surprised to see it. Why is it the case? I am using https://hub.docker.com/r/apache/apisix/tags?page=1&name=alpine v. 2.13.3-alpine |
def __init__(self, config: NewServerConfig):
self.fd = config.socket.file
if os.path.exists(self.fd):
os.remove(self.fd)
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.sock.bind(self.fd)
os.chmod(self.fd, 766) # HERE
self.sock.listen(1024) Well, this works but, for security reasons, I am not quite happy with this permissive approach. Would it be safer to get nobody's uid and |
I have a fix. MR in a few minutes |
Current Behavior
I can't use a python plugin as a
ext-plugin-post-req
. When I deactivate the plugin,the request reaches the upstream service.Here are the processes in the container
It seems that both apisix and my plugin run as root so they should be able to communicate through
/usr/local/apisix/conf/apisix-1.sock
:I just can't make sense of this behavior
Expected Behavior
Requests should reach the upstream service enriched with the headers defined in the plugin module
apisix-python-plugin-runner/apisix/plugins/rewrite.py
Error Logs
Steps to Reproduce
curl http://localhost:${mapped port of apisix gateway}/mock/
Environment
apisix version
): 2.13.3uname -a
): Linux apisix-6878f46cb5-hps57 5.15.0-47-generic doc: added document of plugin prometheus. apisix#51-Ubuntu SMP Thu Aug 11 07:51:15 UTC 2022 x86_64 Linux (????? The image is supposed to be Alpine based)openresty -V
ornginx -V
): 1.21.4.1luarocks --version
):The text was updated successfully, but these errors were encountered: