Open michalhlavka opened 4 years ago
The user is really not defined in /etc/php/7.4/fpm/pool.d/www.conf
this also applies to 7.1 images as well please fix it.
Temporary solution is to get the /etc/php/7.4/fpm/pool.d/www.conf
out of the container, modify it by uncommenting the user = www-data
line and then overwrite it e.g. in docker compose
Hmm, my previous post is only partial solution as I'm getting error when trying to install new composer packages :
Cannot create cache directory /home/docker/.composer/cache/repo/https---repo.packagist.org/, or directory is not writable. Proceeding without cache
I've tried to change group/user to docker/docker
as stated in readme but without any luck :/
We have the same error since recently. Trying to load thecodingmachine/php:7.4-v3-slim-fpm on a fresh computer without previous installation/cache gives this: php_1 | [01-Oct-2020 19:28:49] ALERT: [pool www] user has not been defined php_1 | [01-Oct-2020 19:28:49] ALERT: [pool www] user has not been defined php_1 | [01-Oct-2020 19:28:49] ERROR: failed to post process the configuration php_1 | [01-Oct-2020 19:28:49] ERROR: failed to post process the configuration php_1 | [01-Oct-2020 19:28:49] ERROR: FPM initialization failed php_1 | [01-Oct-2020 19:28:49] ERROR: FPM initialization failed
I've solved it by disabling WSL support in Docker for windows
Thats strange. I get this error on a Linux host that has nothing to do with Docker for Windows also.
Hey guys,
Could you explain me how to reproduce this problem (on a Linux host if possible)?
Because right now, I don't know how to generate this error.
$ docker run thecodingmachine/php:7.4-v3-fpm
[05-Oct-2020 08:17:27] NOTICE: fpm is running, pid 3338
[05-Oct-2020 08:17:27] NOTICE: ready to handle connections
[05-Oct-2020 08:17:27] NOTICE: systemd monitor interval set to 10000ms
I'm looking at a way to add a breaking test before trying to solve this issue.
Hi @moufmouf
It worked on all my hosts that has previous cache (or something) from your image even if i choose --no-cache option. But when I use a fresh new VM with Linux (Ubuntu) it didnt work.
I tried to replicate this, again, today on a fresh machine and now it works for me. I will test on one of the old hosts that didnt work. Ill get back.
With docker run thecodingmachine/php:7.4-v3-fpm
everything it's ok.
But when I use docker-compose along with nginx, it's again
[06-Oct-2020 12:37:39] ALERT: [pool www] user has not been defined
php_1 | [06-Oct-2020 12:37:39] ALERT: [pool www] user has not been defined
php_1 | [06-Oct-2020 12:37:39] ERROR: failed to post process the configuration
php_1 | [06-Oct-2020 12:37:39] ERROR: failed to post process the configuration
php_1 | [06-Oct-2020 12:37:39] ERROR: FPM initialization failed
php_1 | [06-Oct-2020 12:37:39] ERROR: FPM initialization failed
docker-compose
services:
nginx:
build:
context: .
dockerfile: ./.docker/nginx/Dockerfile
volumes:
- ./:/var/www/html/
- ./.docker/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./.docker/nginx/sites/:/etc/nginx/sites-available
- ./.docker/nginx/conf.d/:/etc/nginx/conf.d
depends_on:
- php
ports:
- "80:80"
- "443:443"
php:
build:
context: .
dockerfile: ./.docker/php/Dockerfile
volumes:
- ./:/var/www/html
environment:
PHP_EXTENSION_XDEBUG: 0
PHP_EXTENSION_PGSQL: 1
PHP_EXTENSION_PDO_PGSQL: 1
PHP_EXTENSION_MYSQLI: 0
STARTUP_COMMAND_1: chown docker /proc/self/fd/{1,2} // this should be fix, but it's not working
PHP Dockerfile
FROM thecodingmachine/php:7.4-v3-fpm
COPY ./ /var/www/html/
WORKDIR /var/www/html/
CMD ["php-fpm"]
EXPOSE 9000
Nginx Dockerfile
FROM nginx:alpine
COPY ./ /var/www/html/
CMD ["nginx"]
EXPOSE 80 443
I've solved it by disabling WSL support in Docker for windows
This solved it for me as well.
This started to work out of nowhere for me 👍 Both on Linux hosts and WSL2 host with docker for windows
Still not working for me :/
On Thu, Oct 15, 2020 at 8:20 PM Björn notifications@github.com wrote:
This started to work out of nowhere for me 👍 Both on Linux hosts and WSL2 host with docker for windows
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/thecodingmachine/docker-images-php/issues/206#issuecomment-709505974, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAOTQVIJZ75I3O67EM3RXTSK44O5ANCNFSM4OS2GVZQ .
Happening to me too, windows 10, using WSL.
Arent you trying to run the docker compose from windows shell ? I found that you must run it from wsl shell
čt 8. 4. 2021 v 19:14 odesílatel Matěj Račinský @.***> napsal:
Happening to me too, windows 10, using WSL.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/thecodingmachine/docker-images-php/issues/206#issuecomment-815996085, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABAOTQW75DN5HCNTDGZHVQLTHXP7TANCNFSM4OS2GVZQ .
Thanks, I'll try it. Unfortunately, running it from wsl shell causes me https://github.com/docker/compose/issues/7899
Arent you trying to run the docker compose from windows shell ? I found that you must run it from wsl shell
seams that did it. however the cause for this would be good to understand
Here is what I fix this issue I replace all 3 pools with this
in docker-compose file
php8:
image: "thecodingmachine/php:8.0-v4-fpm-node14"
volumes:
- ./htdocs:/var/www/htdocs
- ./docker.conf:/etc/php/8.0/fpm/pool.d/docker.conf
- ./www.conf:/etc/php/8.0/fpm/pool.d/www.conf
- ./zz-docker.conf:/etc/php/8.0/fpm/pool.d/zz-docker.conf
www.conf and zz-docker.conf is empty file docker.conf is custom pool with user, group defined. example
[global]
daemonize = no
[docker]
user = docker
group = docker
listen = 9000
listen.owner = root
listen.group = docker
access.log = /proc/self/fd/2
catch_workers_output = yes
decorate_workers_output = no
Hello I have the problem too.
[10-Jul-2021 08:58:12] ALERT: [pool www] user has not been defined
[10-Jul-2021 08:58:12] ALERT: [pool www] user has not been defined
[10-Jul-2021 08:58:12] ERROR: failed to post process the configuration
[10-Jul-2021 08:58:12] ERROR: failed to post process the configuration
[10-Jul-2021 08:58:12] ERROR: FPM initialization failed
[10-Jul-2021 08:58:12] ERROR: FPM initialization failed
My server runs under Ubuntu 20.04.2 LTS, only Docker and Docker-Compose and SSH are installed.
I've tried several options and suggestions on the net.
Here is what I fix this issue I replace all 3 pools with this
in docker-compose file
php8: image: "thecodingmachine/php:8.0-v4-fpm-node14" volumes: - ./htdocs:/var/www/htdocs - ./docker.conf:/etc/php/8.0/fpm/pool.d/docker.conf - ./www.conf:/etc/php/8.0/fpm/pool.d/www.conf - ./zz-docker.conf:/etc/php/8.0/fpm/pool.d/zz-docker.conf
www.conf and zz-docker.conf is empty file docker.conf is custom pool with user, group defined. example
[global] daemonize = no [docker] user = docker group = docker listen = 9000 listen.owner = root listen.group = docker access.log = /proc/self/fd/2 catch_workers_output = yes decorate_workers_output = no
Today I checked again whether it could be done. I also tried that from @leekung . Unfortunately, I just can't get it to work.
The developers don't seem to care about the issues at the moment because it has been open for a long time.
Who can recommend an alternative Docker image with phpFPM and Crontab.
Here is what I fix this issue I replace all 3 pools with this in docker-compose file
php8: image: "thecodingmachine/php:8.0-v4-fpm-node14" volumes: - ./htdocs:/var/www/htdocs - ./docker.conf:/etc/php/8.0/fpm/pool.d/docker.conf - ./www.conf:/etc/php/8.0/fpm/pool.d/www.conf - ./zz-docker.conf:/etc/php/8.0/fpm/pool.d/zz-docker.conf
www.conf and zz-docker.conf is empty file docker.conf is custom pool with user, group defined. example
[global] daemonize = no [docker] user = docker group = docker listen = 9000 listen.owner = root listen.group = docker access.log = /proc/self/fd/2 catch_workers_output = yes decorate_workers_output = no
Today I checked again whether it could be done. I also tried that from @leekung . Unfortunately, I just can't get it to work.
The developers don't seem to care about the issues at the moment because it has been open for a long time.
Who can recommend an alternative Docker image with phpFPM and Crontab.
use the following https://www.github.com/webdevops/Dockerfile
use the following https://www.github.com/webdevops/Dockerfile Thanks @leekung However, this Docker image has no integrated cron service
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please update it if any action still required.
This should not be closed yet. Since it still affects some
How does it go on here? Not much happening here lately?
Yes yes... it's difficult currently. I should have more time soon. In addition, if someone would like help us to manage thoses images, s/he can contact me (we will continue to support but sometime we have less time so someone in backup maybe helpful).
I had similar issue and found why.
The message was the following :
ALERT: [pool www] user has not been defined
ALERT: [pool www] user has not been defined
ERROR: failed to post process the configuration
ERROR: failed to post process the configuration
ERROR: FPM initialization failed
ERROR: FPM initialization failed
My container was created with Portainer and the user field under Command and Logging has been set automatically to "root" instead of "nobody".
The user has already been specified in the Dockerfile with
USER nobody
So you can leave the field under portainer empty, it will be automatically assigned to nobody
Or run your container with --user=nobody (i didn't try this method)
Here is what I fix this issue I replace all 3 pools with this
in docker-compose file
php8: image: "thecodingmachine/php:8.0-v4-fpm-node14" volumes: - ./htdocs:/var/www/htdocs - ./docker.conf:/etc/php/8.0/fpm/pool.d/docker.conf - ./www.conf:/etc/php/8.0/fpm/pool.d/www.conf - ./zz-docker.conf:/etc/php/8.0/fpm/pool.d/zz-docker.conf
www.conf and zz-docker.conf is empty file docker.conf is custom pool with user, group defined. example
[global] daemonize = no [docker] user = docker group = docker listen = 9000 listen.owner = root listen.group = docker access.log = /proc/self/fd/2 catch_workers_output = yes decorate_workers_output = no
Bro, you saved me after hours of becoming more and more suicidal.
<3
got the exact same error, I used a script to build the dockercontainer turned out I accidentally left --user=root
in my build command...
I had similar issue and found why.
The message was the following :
ALERT: [pool www] user has not been defined ALERT: [pool www] user has not been defined ERROR: failed to post process the configuration ERROR: failed to post process the configuration ERROR: FPM initialization failed ERROR: FPM initialization failed
My container was created with Portainer and the user field under Command and Logging has been set automatically to "root" instead of "nobody".
The user has already been specified in the Dockerfile with
USER nobody
So you can leave the field under portainer empty, it will be automatically assigned to nobody
Or run your container with --user=nobody (i didn't try this method)
Where does this change actually get made?
Hi, I am starting container from
FROM thecodingmachine/php:7.4-v3-fpm
and gettingAt the local machine, everything is right but on the server, it's failing.
4.19.0-9-amd64
Any advice? One week I am trying to figure it out, what is wrong. Thank you.