You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SaltStack (using Python subprocess) hangs when running php-fpm 8.1.11 #9754
I am cross-posting saltstack/salt#62891 because I'm not sure what's happening, but it is related to PHP 8.1.11 and 8.0.24, previous versions worked fine.
I tested on Ubuntu with Python 3.10 and FreeBSD with Python 3.9. Running
salt-call -l all cmd.run 'php-fpm8.1'
on Ubuntu or the equivalent on FreeBSD just hangs. It didn't use to do that.
To reproduce:
start an Ubuntu instance
install PHP 8.1:
apt-get install software-properties-common
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt install php8.1-fpm
install SaltStack:
sudo apt install python3-pip
sudo pip3 install --upgrade salt
sudo salt-minion <- run once. it will set up /etc, then it's not needed any more
run some random command with SaltStack, just to see how it should work:
sudo salt-call -l all cmd.run 'ls'
run php-fpm with SaltStack, this should just hang, although php-fpm does start:
I think you might want to run FPM in foreground in this case so maybe try to run FPM as php-fpm8.1 -F (basically just add -F option to run it in foreground). If you need it run as a root, you might also need to add -R option... See php-fpm8.1 --help for more details.
That's not an option, what I'm actually trying to do is start the php-fpm service, which means -D. That's the actual problem, I can no longer set up PHP through config management. The cmd.run line is just the easiest way to reproduce that I could find. If I ran it in the foreground, Salt would still hang, but then I wouldn't know if it is because of the bug, or because it's just waiting for the process to exit.
There are some other details in the related issue I opened in SaltStack repo.
Ok this might need some deeper investigation and might also need more looking to the SaltStack integration. I added that to my big TODO list but there are bunch of other higher priority tasks in front of it so it will likely take some time to get into it.
Actually I put a bit higher on my TODO list in case it's a regression. It shouldn't hopefully take that much time to look into it. So should be hopefully able to look more in the next few weeks.
Just a quick update that I spent some time on this today and did some debugging. I managed to recreate the issue under the Salt stack and then extract it to the subprocess call that hangs with PHP-8.0 but works with PHP-7.4:
Thanks that helped me to find the cause a bit quicker - the fix is in #9852 and should be hopefully part of PHP 8.0.26 and 8.1.13. I managed to put together a test for this so it won't hopefully happen again.
Activity
bukka commentedon Oct 21, 2022
I think you might want to run FPM in foreground in this case so maybe try to run FPM as
php-fpm8.1 -F(basically just add-Foption to run it in foreground). If you need it run as a root, you might also need to add-Roption... Seephp-fpm8.1 --helpfor more details.bgdnlp commentedon Oct 21, 2022
That's not an option, what I'm actually trying to do is start the php-fpm service, which means
-D. That's the actual problem, I can no longer set up PHP through config management. Thecmd.runline is just the easiest way to reproduce that I could find. If I ran it in the foreground, Salt would still hang, but then I wouldn't know if it is because of the bug, or because it's just waiting for the process to exit.There are some other details in the related issue I opened in SaltStack repo.
bukka commentedon Oct 22, 2022
Ok this might need some deeper investigation and might also need more looking to the SaltStack integration. I added that to my big TODO list but there are bunch of other higher priority tasks in front of it so it will likely take some time to get into it.
bukka commentedon Oct 22, 2022
Actually I put a bit higher on my TODO list in case it's a regression. It shouldn't hopefully take that much time to look into it. So should be hopefully able to look more in the next few weeks.
bukka commentedon Oct 28, 2022
Just a quick update that I spent some time on this today and did some debugging. I managed to recreate the issue under the Salt stack and then extract it to the subprocess call that hangs with PHP-8.0 but works with PHP-7.4:
Now I will need to figure out what changed in 8.0 and why it's not working.
bgdnlp commentedon Oct 29, 2022
It worked with the previous minor version of PHP too. PHP 8.1.10 didn't have this problem. Should help narrow it down.
bukka commentedon Oct 29, 2022
Thanks that helped me to find the cause a bit quicker - the fix is in #9852 and should be hopefully part of PHP 8.0.26 and 8.1.13. I managed to put together a test for this so it won't hopefully happen again.
Fix GH-9754: SaltStack hangs when running php-fpm 8.1.11