craftcms / image

Container images that are used as the base for Craft CMS container applications
https://craftcms.com
11 stars 0 forks source link

Deploying in a Linux target yields permissions errors #15

Open simonprev opened 3 months ago

simonprev commented 3 months ago

Description

Deploying to ECS/Fargate yields permissions error

2024/08/07 15:08:23 [crit] 35#35: *35 connect() to unix:/var/run/php/php-fpm.sock failed (13: Permission denied) while connecting to upstream, client: 10.0.128.102, server: _, request: "GET /ping HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php-fpm.sock:", host: "10.0.34.223:8080"

CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.

ERROR: failed to open error_log (/proc/self/fd/2): Permission denied (13)

As I understand it, ECS execute tasks as user root. There is a mismatch somewhere with php-fpm/supervisord/nginx. The closest report of the bug I found was this: https://github.com/shipping-docker/vessel-docs/blob/master/source/docs/linux-permissions.md#docker-and-linux-permissions

If I force the task to execute as appuser, it also yields other permissions errors.

The bug is not present in my macos dev setup.

Steps to reproduce

  1. Build a docker image with the default Dockerfile in the examples
  2. Deploy it in a linux environment
  3. See error about permissions
jasonmccallister commented 2 months ago

Hi @simonprev, we are deploying these images to ECS and I have not seen this issue. I will try to reproduce this and let you know what I find.