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

ALERT: [pool www] user has not been defined #206

Open
michalhlavka opened this issue Jul 7, 2020 · 27 comments
Open

ALERT: [pool www] user has not been defined #206

michalhlavka opened this issue Jul 7, 2020 · 27 comments
Labels
bug confirmed Bug reproduced and qualified
Projects
Milestone

Comments

@michalhlavka
Copy link

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.

@DepkaCZ
Copy link

DepkaCZ commented Sep 24, 2020

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
Copy link

DepkaCZ commented Sep 24, 2020

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

@beejaz
Copy link

beejaz commented Oct 1, 2020

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

@DepkaCZ
Copy link

DepkaCZ commented Oct 1, 2020

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

@beejaz
Copy link

beejaz commented Oct 4, 2020

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

@moufmouf
Copy link
Member

moufmouf commented Oct 5, 2020

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.

@beejaz
Copy link

beejaz commented Oct 6, 2020

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.

@michalhlavka
Copy link
Author

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

@mbrowngold
Copy link

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

This solved it for me as well.

@beejaz
Copy link

beejaz commented Oct 15, 2020

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

@DepkaCZ
Copy link

DepkaCZ commented Jan 18, 2021 via email

@racinmat
Copy link

racinmat commented Apr 8, 2021

Happening to me too, windows 10, using WSL.

@DepkaCZ
Copy link

DepkaCZ commented Apr 8, 2021 via email

@racinmat
Copy link

racinmat commented Apr 8, 2021

Thanks, I'll try it. Unfortunately, running it from wsl shell causes me docker/compose#7899

@lordisp
Copy link

lordisp commented May 29, 2021

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

@leekung
Copy link

leekung commented Jun 19, 2021

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

@csaeum
Copy link

csaeum commented Jul 10, 2021

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
Copy link

csaeum commented Sep 15, 2021

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.

@leekung
Copy link

leekung commented Sep 15, 2021

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

@csaeum
Copy link

csaeum commented Sep 16, 2021

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

@stale
Copy link

stale bot commented Nov 15, 2021

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 stale bot added the stale Issues inactives for a while (automatically) label Nov 15, 2021
@csaeum
Copy link

csaeum commented Nov 15, 2021

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

@stale stale bot removed the stale Issues inactives for a while (automatically) label Nov 15, 2021
@mistraloz mistraloz added the bug Something isn't working label Nov 22, 2021
@mistraloz mistraloz added this to Needs triage in Issue via automation Nov 22, 2021
@mistraloz mistraloz added this to the V4 milestone Nov 22, 2021
@mistraloz mistraloz added bug confirmed Bug reproduced and qualified and removed bug Something isn't working labels Jan 4, 2022
@csaeum
Copy link

csaeum commented May 7, 2022

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

@mistraloz
Copy link
Collaborator

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

@alexmaurer-madis
Copy link

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)

@jsuos
Copy link

jsuos commented May 17, 2022

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

@RobertoTorino
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug confirmed Bug reproduced and qualified
Projects
Issue
Needs triage
Development

No branches or pull requests