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

webdevops/php-nginx no longer works on DigitalOcean App Platform #517

Open
sonjz opened this issue May 28, 2024 · 0 comments
Open

webdevops/php-nginx no longer works on DigitalOcean App Platform #517

sonjz opened this issue May 28, 2024 · 0 comments

Comments

@sonjz
Copy link

sonjz commented May 28, 2024

There are similar posts here, but thought it relevant to post this separately, with the intention of also pass this on to DigitalOcean support.

I have been using webdevops/php-nginx container for over a year, DigitalOcean App Platform performed some upgrades likely
Feb 2024 that broke after the app was auto-redeployed.

The issues are likely around root access and how .supervisor.sock can be accessed. None of these issues occur usig Docker Desktop, only after they are pushed to DigitalOcean App Platform.

They have recognized there is supervisor issues and offered a fix (to disable the [unix_http_server] which didn't solve the issue.

The Dockerfile is pretty bare bones and the nginx confs have been verified locally.

FROM webdevops/php-nginx

# copy nginx config and cleanup
COPY etc/nginx /opt/docker/etc/nginx

# copy app code
COPY src/redacted-name /app

# just need to host 80
EXPOSE 80

The issue this produces during DigitalOcean App Platform deployment is:

[redacted-name] [2024-05-28 17:31:30] -> Executing /opt/docker/provision/entrypoint.d/05-permissions.sh
[redacted-name] [2024-05-28 17:31:30] -> Executing /opt/docker/provision/entrypoint.d/20-nginx.sh
[redacted-name] [2024-05-28 17:31:30] -> Executing /opt/docker/provision/entrypoint.d/20-php-fpm.sh
[redacted-name] [2024-05-28 17:31:30] -> Executing /opt/docker/provision/entrypoint.d/20-php.sh
[redacted-name] [2024-05-28 17:31:31] -> Executing /opt/docker/bin/service.d/supervisor.d//10-init.sh
[redacted-name] [2024-05-28 17:31:31] 2024-05-28 17:31:31,676 CRIT Set uid to user 0
[redacted-name] [2024-05-28 17:31:31] 2024-05-28 17:31:31,676 INFO Included extra file "/opt/docker/etc/supervisor.d/cron.conf" during parsing
[redacted-name] [2024-05-28 17:31:31] 2024-05-28 17:31:31,676 INFO Included extra file "/opt/docker/etc/supervisor.d/dnsmasq.conf" during parsing
[redacted-name] [2024-05-28 17:31:31] 2024-05-28 17:31:31,676 INFO Included extra file "/opt/docker/etc/supervisor.d/nginx.conf" during parsing
[redacted-name] [2024-05-28 17:31:31] 2024-05-28 17:31:31,676 INFO Included extra file "/opt/docker/etc/supervisor.d/php-fpm.conf" during parsing
[redacted-name] [2024-05-28 17:31:31] 2024-05-28 17:31:31,676 INFO Included extra file "/opt/docker/etc/supervisor.d/postfix.conf" during parsing
[redacted-name] [2024-05-28 17:31:31] 2024-05-28 17:31:31,677 INFO Included extra file "/opt/docker/etc/supervisor.d/ssh.conf" during parsing
[redacted-name] [2024-05-28 17:31:31] 2024-05-28 17:31:31,677 INFO Included extra file "/opt/docker/etc/supervisor.d/syslog.conf" during parsing
[redacted-name] [2024-05-28 17:31:31] Unlinking stale socket /.supervisor.sock
[redacted-name] [2024-05-28 17:31:32] Unlinking stale socket /.supervisor.sock
[redacted-name] [2024-05-28 17:31:32] Unlinking stale socket /.supervisor.sock
[redacted-name] [2024-05-28 17:31:32] Unlinking stale socket /.supervisor.sock
[redacted-name] [2024-05-28 17:31:32] Unlinking stale socket /.supervisor.sock
[redacted-name] [2024-05-28 17:31:33] Unlinking stale socket /.supervisor.sock
[redacted-name] [2024-05-28 17:31:33] Unlinking stale socket /.supervisor.sock
...

Their support suggested removing [unix_http_server] from supervisor.conf at this point:

[supervisord]
nodaemon=true

# [unix_http_server]
# file = /.supervisor.sock
# chmod = 0700
# chown = root:root
# username = root
# password = {SHA}redacted-password

[supervisorctl]
serverurl = unix:///.supervisor.sock
username = root
password = redacted-password

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[include]
files = /opt/docker/etc/supervisor.d/*.conf

And to enable this, and ensured to copy it into the container by adding this line to Dockerfile:

# Possible fix for Unlinking stale socket /.supervisor.sock ?
COPY etc/supervisor.conf /opt/docker/etc/supervisor.conf

The resulting deployment gets further but breaks down trying to start php-fpm stage:

[redacted-name] [2024-05-28 17:28:09] -> Executing /opt/docker/provision/entrypoint.d/05-permissions.sh
[redacted-name] [2024-05-28 17:28:09] -> Executing /opt/docker/provision/entrypoint.d/20-nginx.sh
[redacted-name] [2024-05-28 17:28:09] -> Executing /opt/docker/provision/entrypoint.d/20-php-fpm.sh
[redacted-name] [2024-05-28 17:28:09] -> Executing /opt/docker/provision/entrypoint.d/20-php.sh
[redacted-name] [2024-05-28 17:28:09] -> Executing /opt/docker/bin/service.d/supervisor.d//10-init.sh
[redacted-name] [2024-05-28 17:28:10] 2024-05-28 17:28:10,076 CRIT Set uid to user 0
[redacted-name] [2024-05-28 17:28:10] 2024-05-28 17:28:10,077 INFO Included extra file "/opt/docker/etc/supervisor.d/cron.conf" during parsing
[redacted-name] [2024-05-28 17:28:10] 2024-05-28 17:28:10,077 INFO Included extra file "/opt/docker/etc/supervisor.d/dnsmasq.conf" during parsing
[redacted-name] [2024-05-28 17:28:10] 2024-05-28 17:28:10,077 INFO Included extra file "/opt/docker/etc/supervisor.d/nginx.conf" during parsing
[redacted-name] [2024-05-28 17:28:10] 2024-05-28 17:28:10,077 INFO Included extra file "/opt/docker/etc/supervisor.d/php-fpm.conf" during parsing
[redacted-name] [2024-05-28 17:28:10] 2024-05-28 17:28:10,077 INFO Included extra file "/opt/docker/etc/supervisor.d/postfix.conf" during parsing
[redacted-name] [2024-05-28 17:28:10] 2024-05-28 17:28:10,078 INFO Included extra file "/opt/docker/etc/supervisor.d/ssh.conf" during parsing
[redacted-name] [2024-05-28 17:28:10] 2024-05-28 17:28:10,078 INFO Included extra file "/opt/docker/etc/supervisor.d/syslog.conf" during parsing
[redacted-name] [2024-05-28 17:28:10] 2024-05-28 17:28:10,084 INFO supervisord started with pid 1
[redacted-name] [2024-05-28 17:28:11] 2024-05-28 17:28:11,100 INFO spawned: 'syslogd' with pid 43
[redacted-name] [2024-05-28 17:28:11] 2024-05-28 17:28:11,130 INFO spawned: 'nginxd' with pid 44
[redacted-name] [2024-05-28 17:28:11] 2024-05-28 17:28:11,220 INFO spawned: 'php-fpmd' with pid 45
[redacted-name] [2024-05-28 17:28:11] 2024-05-28 17:28:11,332 INFO spawned: 'crond' with pid 47
[redacted-name] [2024-05-28 17:28:11] -> Executing /opt/docker/bin/service.d/syslog-ng.d//10-init.sh
[redacted-name] [2024-05-28 17:28:11] -> Executing /opt/docker/bin/service.d/nginx.d//10-init.sh
[redacted-name] [2024-05-28 17:28:11] 2024-05-28 17:28:11,352 INFO success: nginxd entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
[redacted-name] [2024-05-28 17:28:11] 2024-05-28 17:28:11,352 INFO success: php-fpmd entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
[redacted-name] [2024-05-28 17:28:11] 2024-05-28 17:28:11,352 INFO success: crond entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
[redacted-name] [2024-05-28 17:28:11] -> Executing /opt/docker/bin/service.d/php-fpm.d//10-init.sh
[redacted-name] [2024-05-28 17:28:11] Setting php-fpm user to application
[redacted-name] [2024-05-28 17:28:11] -> Executing /opt/docker/bin/service.d/cron.d//10-init.sh
[redacted-name] [2024-05-28 17:28:12] [SYSLOG] syslog-ng[43]: syslog-ng starting up; version='3.13.2'
[redacted-name] [2024-05-28 17:28:12] 2024-05-28 17:28:12,267 INFO success: syslogd entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
[redacted-name] [2024-05-28 17:28:12] [28-May-2024 17:28:12] ERROR: failed to open access log (/docker.stdout): Operation not permitted (1)
[redacted-name] [2024-05-28 17:28:12] [28-May-2024 17:28:12] ERROR: failed to post process the configuration
[redacted-name] [2024-05-28 17:28:12] [28-May-2024 17:28:12] ERROR: FPM initialization failed
[redacted-name] [2024-05-28 17:28:12] [28-May-2024 17:28:12] ERROR: failed to open access log (/docker.stdout): Operation not permitted (1)
[redacted-name] [2024-05-28 17:28:12] [28-May-2024 17:28:12] ERROR: failed to post process the configuration
[redacted-name] [2024-05-28 17:28:12] [28-May-2024 17:28:12] ERROR: FPM initialization failed
[redacted-name] [2024-05-28 17:28:12] 2024-05-28 17:28:12,534 INFO exited: php-fpmd (exit status 78; not expected)
[redacted-name] [2024-05-28 17:28:13] 2024-05-28 17:28:13,538 INFO spawnerr: unknown error making dispatchers for 'php-fpmd': EPERM
[redacted-name] [2024-05-28 17:28:14] 2024-05-28 17:28:14,540 INFO spawnerr: unknown error making dispatchers for 'php-fpmd': EPERM
[redacted-name] [2024-05-28 17:28:16] 2024-05-28 17:28:16,542 INFO spawnerr: unknown error making dispatchers for 'php-fpmd': EPERM
[redacted-name] [2024-05-28 17:28:19] 2024-05-28 17:28:19,545 INFO spawnerr: unknown error making dispatchers for 'php-fpmd': EPERM
[redacted-name] [2024-05-28 17:28:19] 2024-05-28 17:28:19,546 INFO gave up: php-fpmd entered FATAL state, too many start retries too quickly
[redacted-name] [2024-05-28 17:28:30] 2024/05/28 17:28:30 [error] 59#59: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 10.244.8.147, server: redacted-name.ca, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.redacted-name.ca"
[redacted-name] [2024-05-28 17:28:30] 10.244.8.147 - - [28/May/2024:17:28:30 +0000] "GET / HTTP/1.1" 502 584 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"
[redacted-name] [2024-05-28 17:28:30] 10.244.8.147 - - [28/May/2024:17:28:30 +0000] "GET /favicon.ico HTTP/1.1" 304 0 "https://www.redacted-name.ca/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"

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

1 participant