BUG - php-fpm dont start when all virtual servers are deleted

Ubuntu 20.04 LEMP + Virtualmin 6.14 / Webmin 1.970
(installed with sh /root/virtualmin-install.sh -b LEMP -m)
(everything updated with latest in february 1st, 2021)
(selected php-fpm as default)

There is a bug in Virtualmin with PHP-FPM if you delete all the virtual servers. When you restart php-fpm (sudo systemctl stop php7.4-fpm.service and then sudo systemctl start php7.4-fpm.service) you will get the error:
Job for php7.4-fpm.service failed because the control process exited with error code.
See "systemctl status php7.4-fpm.service" and "journalctl -xe" for details.

After a lot of research and read the log, what is happening is that the last user.conf is not deleted from the /etc/php/7.4/fpm/pool.d/ folder. If I manually delete it (in my case is 1612737320410801.conf) I can start PHP-FPM again.
Also, it is not possible to add a new Virtual Server because php-fpm will not start it with this error.

[How to reproduce this bug]
Create some virtual servers - it doesn’t matter how many - and then delete them one by one. After you delete the last one everything will still okay.
But if you try to create a new Virtual Server, PHP-FPM will output the above error message (because Virtualmin script will restart php-fpm service).

Hope this can help other people.

1 Like

I have to ask:

Why on earth would you delete ALL of your virtual servers?

To create a default image for all my Virtual Machines.
This way I will not need to install everything again and again.

In that case I would have simply created my new default image first, created the prototype virtual server with it, then removed and replaced the other virtual servers one by one.

May I ask what you have against FCGID? (I’m curious as to why you’d prefer FPM)

Ok… but I needed to test it. Test if WordPress works, test ssllabs.com cert rating, test redis cache etc.

Absolutely nothing! I always used FCGID. This is the first time I setup a machine with php-fpm. I always read about it, and my researches showed me that it uses less resources and are faster. Is it true? I don’t know. Does it make difference? I don’t know either. I never hosted a million access website (my biggest website was 100k visits in a month).
But the ‘big tech’ guys use it, so I wanted to give it a try.

My first impression is that it is using less RAM. But that’s only 2 days.

2 Likes