docker-images-php icon indicating copy to clipboard operation
docker-images-php copied to clipboard

ALERT: [pool www] user has not been defined

Open michalhlavka opened this issue 5 years ago • 29 comments

Hi, I am starting container from FROM thecodingmachine/php:7.4-v3-fpm and getting

php_1       | [07-Jul-2020 13:22:56] ALERT: [pool www] user has not been defined
php_1       | [07-Jul-2020 13:22:56] ALERT: [pool www] user has not been defined
php_1       | [07-Jul-2020 13:22:56] ERROR: failed to post process the configuration
php_1       | [07-Jul-2020 13:22:56] ERROR: failed to post process the configuration
php_1       | [07-Jul-2020 13:22:56] ERROR: FPM initialization failed
php_1       | [07-Jul-2020 13:22:56] ERROR: FPM initialization failed

At the local machine, everything is right but on the server, it's failing.

Distributor ID:	Debian
Description:	Debian GNU/Linux 10 (buster)
Release:	10
Codename:	buster

4.19.0-9-amd64

Any advice? One week I am trying to figure it out, what is wrong. Thank you.

michalhlavka avatar Jul 07 '20 13:07 michalhlavka

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

DepkaCZ avatar Sep 24 '20 16:09 DepkaCZ

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 :/

DepkaCZ avatar Sep 24 '20 18:09 DepkaCZ

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

beejaz avatar Oct 01 '20 19:10 beejaz

I've solved it by disabling WSL support in Docker for windows

DepkaCZ avatar Oct 01 '20 19:10 DepkaCZ

Thats strange. I get this error on a Linux host that has nothing to do with Docker for Windows also.

beejaz avatar Oct 04 '20 18:10 beejaz

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.

moufmouf avatar Oct 05 '20 08:10 moufmouf

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.

beejaz avatar Oct 06 '20 08:10 beejaz

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

michalhlavka avatar Oct 06 '20 12:10 michalhlavka

I've solved it by disabling WSL support in Docker for windows

This solved it for me as well.

mbrowngold avatar Oct 07 '20 20:10 mbrowngold

This started to work out of nowhere for me 👍 Both on Linux hosts and WSL2 host with docker for windows

beejaz avatar Oct 15 '20 18:10 beejaz

Still not working for me :/

On Thu, Oct 15, 2020 at 8:20 PM Björn [email protected] 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 .

DepkaCZ avatar Jan 18 '21 12:01 DepkaCZ

Happening to me too, windows 10, using WSL.

racinmat avatar Apr 08 '21 17:04 racinmat

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 .

DepkaCZ avatar Apr 08 '21 17:04 DepkaCZ

Thanks, I'll try it. Unfortunately, running it from wsl shell causes me https://github.com/docker/compose/issues/7899

racinmat avatar Apr 08 '21 17:04 racinmat

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

lordisp avatar May 29 '21 15:05 lordisp

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

leekung avatar Jun 19 '21 19:06 leekung

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.

csaeum avatar Jul 10 '21 09:07 csaeum

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.

csaeum avatar Sep 15 '21 07:09 csaeum

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

leekung avatar Sep 15 '21 07:09 leekung

use the following https://www.github.com/webdevops/Dockerfile Thanks @leekung However, this Docker image has no integrated cron service

csaeum avatar Sep 16 '21 07:09 csaeum

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.

stale[bot] avatar Nov 15 '21 10:11 stale[bot]

This should not be closed yet. Since it still affects some

csaeum avatar Nov 15 '21 10:11 csaeum

How does it go on here? Not much happening here lately?

csaeum avatar May 07 '22 19:05 csaeum

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).

mistraloz avatar May 08 '22 08:05 mistraloz

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)

alexmaurer-madis avatar May 11 '22 11:05 alexmaurer-madis

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

jsuos avatar May 17 '22 15:05 jsuos

got the exact same error, I used a script to build the dockercontainer turned out I accidentally left --user=root in my build command...

RobertoTorino avatar Mar 11 '23 03:03 RobertoTorino