502 Bad Gateway error with webmin1.962

Hi! I’m using NGINX, today I update all packages to the last version.
All seems to be ok. All websites was working! yeah!
I saw that PHP v8 was enabled so I tried to select it on Server Configuration -> PHP Version of a test website. It was already v.8 on Default HTML directory because the default template was configured to use the last version.
I tried to click on Save Version button but nothing happens, my website told me that it was using v. 7.4.13
So, I tried to configure PHP version on previus page to 7.4.13 (default settings before update), from that moment I got 502 error on my website.

I have lots of that error on php.log:
2020/12/11 02:31:48 [crit] 17072#17072: *475947 connect() to unix:/var/php-nginx/154774005721825.sock/socket failed (2: No such file or directory) while connecting to upstream, client: x.x.x.x, server: <websitename>, request: "POST / HTTP/1.1", upstream: "fastcgi://unix:/var/php-nginx/154774005721825.sock/socket:", host: "<websitename>"

php-fcgi- file on /etc/init.d/ is disappeared!!
obviously if I try to start the service, it doesn’t exist:
sudo service php-fcgi- start
Failed to start php-fcgi-.service: Unit php-fcgi-.service not found.

but others php-fcgi-* websites files exist!!

Into /etc/systemd/system/multi-user.target.wants now I have a new file named php-fcgi-.service but same files of other websites don’t exist!!

$ sudo ls -latr /etc/systemd/system/multi-user.target.wants/php*
lrwxrwxrwx 1 root root 38 Jan  5  2019 /etc/systemd/system/multi-user.target.wants/php7.2-fpm.service -> /lib/systemd/system/php7.2-fpm.service
lrwxrwxrwx 1 root root 38 Nov 16  2019 /etc/systemd/system/multi-user.target.wants/php7.3-fpm.service -> /lib/systemd/system/php7.3-fpm.service
lrwxrwxrwx 1 root root 38 Jan  6  2020 /etc/systemd/system/multi-user.target.wants/php7.4-fpm.service -> /lib/systemd/system/php7.4-fpm.service
lrwxrwxrwx 1 root root 38 Nov  5 03:13 /etc/systemd/system/multi-user.target.wants/php8.0-fpm.service -> /lib/systemd/system/php8.0-fpm.service
lrwxrwxrwx 1 root root 51 Dec 11 01:42 /etc/systemd/system/multi-user.target.wants/php-fcgi-<websitename>.service -> /lib/systemd/system/php-fcgi-<websitename>.service

I’m a little bit confused…

If I have to reboot my server or restart nginx probably I’ll block all my website…
please help me to understand was happens and how I can fix it!

The following PHP versions are available : 7.2.34 (/usr/bin/php-cgi7.2), 7.3.24 (/usr/bin/php-cgi7.3), 7.4.13 (/usr/bin/php-cgi7.4), 8.0.0 (/usr/bin/php-cgi8.0)

The following PHP execution modes are available : fcgid fpm

The following PHP-FPM versions are available on this system : 7.2.3 (php7.2-fpm) 7.3.24 (php7.3-fpm) 7.4.13 (php7.4-fpm) 8.0.0 (php8.0-fpm)

Operating system Ubuntu Linux 18.04.1
Webmin version 1.962
Usermin version 1.812
Virtualmin version 6.14

other info:

$ sudo systemctl status php-fcgi-<websitename>.service 
● php-fcgi-<websitename>.service - Starts Nginx PHP FastCGI server for <websitename> (Virtualmin)
   Loaded: error (Reason: **Exec format error**)
   Active: inactive (dead)

 systemd[1]: /lib/systemd/system/php-fcgi-<websitename>.service:5: Ignoring unknown escape sequences: "su <user> -c PHPRC\=\/home\/n...
 systemd[1]: /lib/systemd/system/php-fcgi-<websitename>.service:6: Executable path is not absolute: su <user> -c kill\ \`cat\ \/var...

the .service file that exists only for my test website.

/etc/systemd/system/multi-user.target.wants$ more php-fcgi-<websitename>.service

        Description=Starts Nginx PHP FastCGI server for <websitename> (Virtualmin)

    ExecStart=/bin/sh -c 'su <user> -c PHP_FCGI_CHILDREN\=4\ PHPRC\=\/home\/<user>\/etc\/php7\.4\ \/usr\/bin\/php\-loop\.pl\ \/usr\/bin\/php\-cgi7\.4\ \-b\ \/var\/php\-ng
    inx\/154774005721825\.sock\/socket\ \>\>\/home\/<user>\/logs\/php\.log\ 2\>\&1\ \<\/dev\/null & echo $! >/var/php-nginx/154774005721825.php.pid && chmod +r /var/php-nginx
    ExecStop=su <user> -c kill\ \`cat\ \/var\/php\-nginx\/154774005721825\.php\.pid\` ; sleep 1


I removed the Executable path is not absolute error on line 6 simply adding the absolute path to su, kill and sleep commands. Now I have Ignoring unknown escape sequences error 2 times on lnes 5 and 6 (ExecStart and ExecStop commands)

if I execute ExecStart command via bash I have no errors and my website goes UP!
but if I do the ExecStop command I receive this error:
kill: (17388): Operation not permitted
The command read the correct PID 17388 but it can’t kill it.
this PID is a root process, if I try to kill from root it works (and my website is no longer available)
root 17388

there is something like a configuration’s migration on last version of virtualmin?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.