Comments (2)
Dug into this a little bit more. This is due to running the container as www-data
user and the pkg install owning/grouping a bunch of things with default php-fpm
user, which normally if container was executed as root, would work. Notice the difference when the container is run as root: the php-fpm workers are running as php-fpm user vs www-data user. That would be good in production, but not in a local dev environment. :)
davidalger:04:04 PM:~$ docker run --rm -d --name test-01 davidalger/warden:mage2-fpm-7.2
77e5a0cb324dfada7e3bb519ca9496480b85875c05ee7ce6b88bb08042a35a43
davidalger:04:05 PM:~$ docker exec -it test-01 bash
www-data@77e5a0cb324d:10:05 PM:/var/www/html$ grep 'group = ' /etc/php-fpm.d/www.conf
group = php-fpm
;listen.group = root
www-data@77e5a0cb324d:10:05 PM:/var/www/html$ ps uax
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
www-data 1 0.3 0.1 832776 35292 ? Ss 22:05 0:00 php-fpm: master process (/etc/php-fpm.conf)
www-data 14 0.0 0.0 832776 7636 ? S 22:05 0:00 php-fpm: pool www
www-data 15 0.0 0.0 832776 7636 ? S 22:05 0:00 php-fpm: pool www
www-data 16 0.0 0.0 832776 7636 ? S 22:05 0:00 php-fpm: pool www
www-data 17 0.0 0.0 832776 7640 ? S 22:05 0:00 php-fpm: pool www
www-data 18 0.0 0.0 832776 7640 ? S 22:05 0:00 php-fpm: pool www
www-data 19 0.3 0.0 12764 4000 pts/0 Ss 22:05 0:00 bash
www-data 44 0.0 0.0 51752 3416 pts/0 R+ 22:05 0:00 ps uax
www-data@77e5a0cb324d:10:05 PM:/var/www/html$ sudo -i
root@77e5a0cb324d:10:05 PM:~# ls -lhd /var/lib/php/fpm/*
drwxrwx--- 2 root php-fpm 4.0K Oct 24 19:58 /var/lib/php/fpm/opcache
drwxrwx--- 2 root php-fpm 4.0K Oct 24 19:58 /var/lib/php/fpm/session
drwxrwx--- 2 root php-fpm 4.0K Oct 24 19:58 /var/lib/php/fpm/wsdlcache
root@77e5a0cb324d:10:05 PM:~# logout
www-data@77e5a0cb324d:10:05 PM:/var/www/html$ exit
davidalger:04:05 PM:~$ docker kill test-01
test-01
davidalger:04:05 PM:~$ docker run --rm -d --name test-01 --user root davidalger/warden:mage2-fpm-7.2
c3a0cab469f4019df8ef5567f8c3c2473da0b736595620e24d197039dcf79652
davidalger:04:06 PM:~$ docker exec -it test-01 bash
root@c3a0cab469f4:10:06 PM:/var/www/html# ls -lhd /var/lib/php/fpm/*
drwxrwx--- 2 root php-fpm 4.0K Oct 24 19:58 /var/lib/php/fpm/opcache
drwxrwx--- 2 root php-fpm 4.0K Oct 24 19:58 /var/lib/php/fpm/session
drwxrwx--- 2 root php-fpm 4.0K Oct 24 19:58 /var/lib/php/fpm/wsdlcache
root@c3a0cab469f4:10:06 PM:/var/www/html# ps uax
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.4 0.1 832776 35444 ? Ss 22:06 0:00 php-fpm: master process (/etc/php-fpm.conf)
php-fpm 13 0.0 0.0 832776 12728 ? S 22:06 0:00 php-fpm: pool www
php-fpm 14 0.0 0.0 832776 12728 ? S 22:06 0:00 php-fpm: pool www
php-fpm 15 0.0 0.0 832776 12728 ? S 22:06 0:00 php-fpm: pool www
php-fpm 16 0.0 0.0 832776 12732 ? S 22:06 0:00 php-fpm: pool www
php-fpm 17 0.0 0.0 832776 12736 ? S 22:06 0:00 php-fpm: pool www
root 18 0.5 0.0 12880 4032 pts/0 Ss 22:06 0:00 bash
root 41 0.0 0.0 51752 3480 pts/0 R+ 22:06 0:00 ps uax
root@c3a0cab469f4:10:06 PM:/var/www/html# exit
Going to work on a couple updates to the startup script in the base fpm image to own/group any files owned/grouped as php-fpm
to the user container is started as if the user is not root.
from warden.
File based sessions should now work as expected. The resolution here was to remove setup of www-data
from base (generic) fpm
images (making them more portable as a base really, and usable on production setups in the future) and move that into the Warden specific fpm
images. Once I did that, fixing this was as simple and as complicated as resolving the owner/group on files in /var/log
and /var/lib
which need to be owned/grouped by the user which php-fpm
workers run under.
Big thank you to @martinssu, @adexandros, and @vbuck for bringing this issue to my attention. I've tested this on a local fresh install of Magento 2.3.3, but let me know if you guys see this again (although I would still recommend using redis sessions as a matter of std practice, even on local).
To fix the issue on local environments, simply run the following command to pull updated images and recreate affected containers:
warden env pull && warden env up -d && warden sync start
from warden.
Related Issues (20)
- [Image] magento 2 error pull maria db HOT 6
- [Command] warden env up HOT 3
- Mutagen syncing is taking ages HOT 2
- tunnel panubo/sshd:latest HOT 1
- Too many networks HOT 1
- DB_DISTRIBUTION and DB_DISTRIBUTION_VERSION are not working? HOT 5
- tunnel reports chmod operation not permitted HOT 6
- Present a warning during `warden env up` if `warden svc up` / `warden install` needs to be re-ran due to an operating system upgrade HOT 1
- Add in-depth ZSH Autocompletion
- [Image] php containers exiting with code (2) HOT 8
- Unable to run integration tests HOT 3
- [Image] Docker not found after sys reboot HOT 2
- [Brew] On linux Warden files for SSL certs created under root user when installed via brew
- warden svc up for first time issue in Linux 20.04
- db containter not working HOT 8
- Feature: Ability to Pipe into `warden shell` HOT 3
- Varnish v7.3 needed by Magento 2.4.6p1 HOT 2
- I can not connect to ssh server HOT 1
- [Command] warden env up does not work on main branch on linux as a result of mutagen sync fixes 3 weeks ago
- [Command] No output when initializing environment HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from warden.