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

Possible incorrect permissions inside container #35

Open
markbeazley opened this issue Oct 16, 2023 · 1 comment
Open

Possible incorrect permissions inside container #35

markbeazley opened this issue Oct 16, 2023 · 1 comment

Comments

@markbeazley
Copy link

I've run into an issue when developing a Sylius plugin (with the official skeleton) using this image, I'm not sure if its because I'm running Podman on Fedora in rootless mode (the default docker setup on Fedora), but I'm fairly sure this is a problem inside the image itself.

Basically if I try and save a product from the admin I get a 500 error, which after opening a terminal and checking /var/log/nginx/error.log I can see the error:

2023/10/16 10:45:38 [crit] 4#4: *1 open() "/var/lib/nginx/tmp/client_body/0000000001" failed (13: Permission denied), client: 10.89.3.5, server: , request: "POST /admin/products/1/edit HTTP/1.1", host: "127.0.0.1:8080", referrer: "http://127.0.0.1:8080/admin/products/1/edit"

This seems to be down to the folders /var/lib/nginx and /var/lib/nginx/tmp being owned by the user nginx but it seems NGINX and PHP are running under the user www-data, if I open the terminal on the container and change the owner on those two folders to www-data it works, but as these files are part of the container file system anytime you bring the container down and back up again their permissions are reset, which stops you being able to submit any forms that require to save the POST body to a temporary file (the product edit one seems to be one of those forms).

@ikamikaz3
Copy link

ikamikaz3 commented Nov 29, 2023

I'm running into exactly the same issues heres my nginx logs :

→ docker compose exec app cat /var/log/nginx/error.log                                                      [d3b0597]
2023/11/29 15:57:50 [crit] 10#10: *1 open() "/var/lib/nginx/tmp/client_body/0000000001" failed (13: Permission denied), client: 172.24.0.1, server: , request: "POST /admin/products/20/edit HTTP/1.1", host: "localhost", referrer: "http://localhost/admin/products/20/edit"
2023/11/29 16:00:21 [crit] 10#10: *5 open() "/var/lib/nginx/tmp/fastcgi/2/00/0000000002" failed (13: Permission denied) while reading upstream, client: 172.24.0.1, server: , request: "GET /media/cache/resolve/sylius_admin_admin_user_avatar_thumbnail/9d/c8/28f1d3bd69ef6b40e48ffe09b523.jpg HTTP/1.1", upstream: "fastcgi://unix:/var/run/php8-fpm.sock:", host: "localhost", referrer: "http://localhost/admin/products/20/edit"
2023/11/29 16:00:25 [crit] 10#10: *21 open() "/var/lib/nginx/tmp/client_body/0000000003" failed (13: Permission denied), client: 172.24.0.1, server: , request: "POST /admin/products/20/edit HTTP/1.1", host: "localhost", referrer: "http://localhost/admin/products/20/edit"

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

No branches or pull requests

2 participants