php:8.2-fpm (bullseye) docker (swarm) no log
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- docker, php
- Domain
- devops, infrastructure
Research direction
Start with the 8.2/bullseye/fpm/Dockerfile and the generated local/etc/php-fpm.d/docker.conf, then reproduce the missing logs using Docker 24.0.2 with Docker Swarm. Compare /proc/self/fd/2, /proc/1/fd/2, and /dev/stderr behavior inside the container; done means identifying the cause and establishing a verified log-forwarding fix or documented limitation.
Written by the indexing model from the issue text.
Description
hi, after some time i am convinced that there is a bug in php:8.2-fpm image or in connection with docker swarm or in docker?
When using the php:8.2-fpm image, this repo writes a docker config which redirects the access and error log to the proc self fd 2. Unfortunately all logs that should end up in the docker logs are lost.
Environment
- Docker version 24.0.2, build cb74dfc
- Dockerhost: Ubuntu 22 LTS
- Image: php:8.2-fpm
further information
# cat local/etc/php-fpm.d/docker.conf
[global]
error_log = /proc/self/fd/2
; https://github.com/docker-library/php/pull/725#issuecomment-443540114
log_limit = 8192
[www]
; php-fpm closes STDOUT on startup, so sending logs to /proc/self/fd/1 does not work.
; https://bugs.php.net/bug.php?id=73886
access.log = /proc/self/fd/2
clear_env = no
; Ensure worker stdout and stderr are sent to the main error log.
catch_workers_output = yes
decorate_workers_output = no
Inside docker container:
# ls -la /proc/self/fd/2
lrwx------ 1 root root 64 May 30 09:43 /proc/self/fd/2 -> /dev/pts/0
# ls -la /proc/self/fd/1
lrwx------ 1 root root 64 May 30 09:44 /proc/self/fd/1 -> /dev/pts/0
# ls -la /proc/1/fd/2
l-wx------ 1 root root 64 May 30 01:33 /proc/1/fd/2 -> 'pipe:[1118282]'
# ls -la /dev/stderr
lrwxrwxrwx 1 root root 15 May 30 01:33 /dev/stderr -> /proc/self/fd/2
- /dev/stderr --> PARTLY WORKING (only from php, not in bash/sh)
- /proc/self/fd/2 --> NOT WORKING
- /proc/1/fd/2 --> WORKING
- some file in mount --> WORKING
I'm not the only one with this behavior, for example: https://github.com/docker-library/php/issues/878#issuecomment-1345275524
- Dominant language
- Dockerfile
- Stars
- 4k
- Forks
- 2k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from docker-library/php
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
docker-library/php#1674 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
docker-library/php#1680 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
docker-library/php#1675 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
docker-library/php#1673 · 5 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
docker-library/php#1631 · 9 comments · 6 reactions ·
All issues in docker-library/php
Similar issues
-
bot-found bug priority: P3
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
madenvel/KalinkaPlayer#179 ·
-
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
makeplane/helm-charts#332 ·
Maintainers usually reply within 1 day
-
bug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
microsoft/fabric-cicd#1141 · 1 comment ·
-
agentic-workflows
Difficulty 1/5 Under an hour Newbie friendliness 85/100
githubnext/gh-aw-workshop#3933 ·
Maintainers usually reply within 2 days
-
Remove CAAPFOpenkind/chore kind/cleanup needs-area
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
rancher/turtles#2848 · 3 comments ·
Maintainers usually reply within 1 day