Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

/entrypoint.sh: line 10: /etc/php-fpm.d/www.conf: Permission denied #266

Open
gebeer opened this issue Dec 16, 2021 · 5 comments
Open

/entrypoint.sh: line 10: /etc/php-fpm.d/www.conf: Permission denied #266

gebeer opened this issue Dec 16, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@gebeer
Copy link

gebeer commented Dec 16, 2021

Describe the bug
When viewing logs with docker-compose logs -f phpfpm I get following output:

Attaching to upday-test_phpfpm_1
phpfpm_1     | Added $DOCKER_INTERNAL_HOST to hosts /etc/hosts
phpfpm_1     | /entrypoint.sh: line 10: /etc/php-fpm.d/www.conf: Permission denied
phpfpm_1     | [16-Dec-2021 01:48:08] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
phpfpm_1     | [16-Dec-2021 01:48:08] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
phpfpm_1     | [16-Dec-2021 01:48:08] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
phpfpm_1     | [16-Dec-2021 01:48:08] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
phpfpm_1     | [16-Dec-2021 01:48:08] NOTICE: fpm is running, pid 1
phpfpm_1     | [16-Dec-2021 01:48:08] NOTICE: ready to handle connections
phpfpm_1     | [16-Dec-2021 01:48:08] NOTICE: systemd monitor disabled

Line 10 in entrypoint.sh tries to write to /etc/php-fpm.d/www.conf inside phpfpm container but can't because of missing permissions. Guess, the cat command needs to be executed as root or the file permissions on /etc/php-fpm.d/www.conf need to be adjusted.

I get no further log output.

Steps to Reproduce

  1. start an environement with 10updocker start xxx
  2. view php logs with docker-compose logs -f phpfpm

Expected behavior
PHP logs should display

Screenshots

Environment information

  • Device: Desktop
  • OS: Linux Arch latest
  • wp-local-docker version: 3.0.1-rc.2
  • node version 16.13.0

Additional context
Viewing logs with 10updocker logs phpfpm results in:

Checking available services...
 Error : Cannot read properties of undefined (reading 'trim')

as described in #251

@gebeer gebeer added the bug Something isn't working label Dec 16, 2021
@tylercherpak
Copy link
Collaborator

Hey @gebeer

I believe this issue is caused by the docker-compose file that is generated is referencing the wrong location for the ini file we add.

I think I have resolved in the latest RC release. You can test it out by installing the RC version with: npm i -g wp-local-docker@next. Once you have that installed you can run 10updocker upgrade on the environment and it should fix this.

Let me know if you have questions or still having issues. Thanks!

@gebeer
Copy link
Author

gebeer commented Dec 17, 2021

Hey @gebeer

I believe this issue is caused by the docker-compose file that is generated is referencing the wrong location for the ini file we add.

I think I have resolved in the latest RC release. You can test it out by installing the RC version with: npm i -g wp-local-docker@next. Once you have that installed you can run 10updocker upgrade on the environment and it should fix this.

Let me know if you have questions or still having issues. Thanks!

Thank you for the quick reply. I upgraded to latest RC and also upgraded the environment. But the old and new docker-compose.yml files are identical and behaviour is still the same.

Which php ini file do you suspect being in a wrong location? The only ini file referenced in docker-compose.yml is - './config/php-fpm/docker-php-ext-xdebug.ini:/etc/php/7.4/fpm/conf.d/docker-php-ext-xdebug.ini:cached'
EDIT: If I docker exec -it into the phpfpm container, I can see that /var/log/php-fpm directory is empty. So no logs are being created?

@tylercherpak
Copy link
Collaborator

Ok sorry that was not the issue and that is the correct path for the ini file.

This issue presents itself similar to the other bug I was working on so I thought it was related.

I am going to investigate further and will update when I have more info.

@tylercherpak
Copy link
Collaborator

@gebeer Can you make sure you are using the latest docker images by running 10updocker image update. Then run 10updocker configure and answer Yes to Do you want to reset your global services configuration? This will reset any customizations you have made.

@gebeer
Copy link
Author

gebeer commented Dec 20, 2021

@gebeer Can you make sure you are using the latest docker images by running 10updocker image update. Then run 10updocker configure and answer Yes to Do you want to reset your global services configuration? This will reset any customizations you have made.

Thank you for the reminder. I have done as advised.

10updocker image update
? Updating images requires all environments to be stopped. Is that okay? Yes
✔ cfe-civi-crm-test is stopped...
✔ citizensforeurope-test is stopped...
✔ event-location-nuernberg-test is stopped...
✔ jomag-test is stopped...
✔ lit-test is stopped...
✔ offsite-location-nuernberg-test is stopped...
✔ upday-test is stopped...
✔ Global services are stopped...
✔ jwilder/nginx-proxy:alpine has been updated...
✔ mariadb:10.3 has been updated...
✔ schickling/mailcatcher has been updated...
✔ phpmyadmin has been updated...
ℹ 10up/wp-php-fpm-dev:8.0-ubuntu doesn't exist on this system. Skipping update...
ℹ 10up/wp-php-fpm-dev:7.4-ubuntu doesn't exist on this system. Skipping update...
ℹ 10up/wp-php-fpm-dev:7.3-ubuntu doesn't exist on this system. Skipping update...
ℹ 10up/wp-php-fpm-dev:7.2-ubuntu doesn't exist on this system. Skipping update...
ℹ 10up/wp-php-fpm-dev:7.1-ubuntu doesn't exist on this system. Skipping update...
ℹ 10up/wp-php-fpm-dev:7.0-ubuntu doesn't exist on this system. Skipping update...
ℹ 10up/wp-php-fpm-dev:5.6-ubuntu doesn't exist on this system. Skipping update...
ℹ 10up/wpsnapshots:2 doesn't exist on this system. Skipping update...
✔ memcached:latest has been updated...
✔ nginx:latest has been updated...
ℹ docker.elastic.co/elasticsearch/elasticsearch:7.9.3 doesn't exist on this system. Skipping update...

After that

10updocker configure
? What directory would you like WP Local Docker to create environments within? /home/gbr/work/001-wp-local-docker-sites
? What directory would you like to store WP Snapshots data within? /home/gbr/.wpsnapshots
? Would you like WP Local Docker to manage your hosts file? Yes
? Do you want to reset your global services configuration? This will reset any customizations you have made. Yes
Successfully Configured WP Local Docker!

But logs are still not available:

docker-compose logs phpfpm
Attaching to upday-test_phpfpm_1
phpfpm_1     | Added $DOCKER_INTERNAL_HOST to hosts /etc/hosts
phpfpm_1     | /entrypoint.sh: line 10: /etc/php-fpm.d/www.conf: Permission denied
phpfpm_1     | [20-Dec-2021 13:04:21] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
phpfpm_1     | [20-Dec-2021 13:04:21] NOTICE: [pool www] 'user' directive is ignored when FPM is not running as root
phpfpm_1     | [20-Dec-2021 13:04:21] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
phpfpm_1     | [20-Dec-2021 13:04:21] NOTICE: [pool www] 'group' directive is ignored when FPM is not running as root
phpfpm_1     | [20-Dec-2021 13:04:21] NOTICE: fpm is running, pid 1
phpfpm_1     | [20-Dec-2021 13:04:21] NOTICE: ready to handle connections
phpfpm_1     | [20-Dec-2021 13:04:21] NOTICE: systemd monitor disabled

And

10updocker logs phpfpm
⠦ Checking available services...
 Error : Cannot read properties of undefined (reading 'trim')

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants