Submitted by gb.123 on Wed, 04/22/2020 - 13:19
Deleting & Recreating a Virtual Server with same Admin name & Domain leads to socket connection failure.
Steps to Recreate :
- Create a Virtual Server - example.net and manually enter any admin name (say exadmin)
- Create 1-2 email users
- Delete Virtual Server
- Create the Virtual Sever with the same info as in step 1. (All info must be same)
- Reboot
Issue :
1 .FastCGI socket will be broken and site will not server PHP on reboot.
Additional Bugs on Delete :
- Mailbox folders remain the same and not reset
- Dovecot Fails to start because SSL reference does not get removed
Cause of Bug :
File : php-fcgi-example-net does NOT get updated with the new admin name and socket number
Workaround :
Manually edit the file with new socket number.
Status:
Fixed (pending)
Comments
Submitted by JamieCameron on Thu, 04/23/2020 - 00:06 Comment #1
It looks like the real issue is that the PHP FPM config wasn't properly removed when the domain was deleted.
Does this only happen when you reboot the system?
Submitted by gb.123 on Thu, 04/23/2020 - 08:42 Comment #2
The problem occurs even before the reboot since the file link is broken but
While the System is on, you can always go to : Virtualmin > Server Configuration > Website Options & change the PHP script execution mode (just click on any of the options)
While the above works till you reboot, you need to do it every-time you reboot until you manually change the php-fcgi-example-net file.
There is another problem I noticed. On Deleting and then adding the same user, his mailbox folders remain the same (even though the mailbox directory is completely deleted) To further elaborate, if you delete your Archive Folder, it will not be created again when you create the user. Still trying to find the work-around it.
Submitted by gb.123 on Fri, 04/24/2020 - 13:34 Comment #3
Another Problem on Deleting Domains : Dovecot reference to SSL certificates do not get removed and DoveCot fails to start (until config file it edited to remove those refrences)
Submitted by gb.123 on Fri, 04/24/2020 - 13:34 Comment #4
Submitted by JamieCameron on Sat, 04/25/2020 - 14:12 Comment #5
The Dovecot issue is a known bug that will be fixed in the next release.
For the original issue, it looks like the init script which starts the FPM server
php-fcgi-example-net
isn't being removed when switching away from FPM mode.Submitted by gb.123 on Sat, 04/25/2020 - 15:43 Comment #6
Also, did you get a chance to check user mailbox preferences ? For some reason if I delete a mailbox (eg. Archive) and then delete a user, and then recreate the same user, the new mailbox automatically has archive folder deleted.
Submitted by gb.123 on Tue, 06/02/2020 - 06:06 Comment #7
The file php-fcgi-example-net should be deleted along with deleting the server right ?
Also, I believe another file "[SomeLongNumber].conf" under /etc/php/7.2/fpm/pool.d/ should also get updated. After deleting the Virtual Sever, the username of the deleted server still remains in the file and the php-fpm has trouble upgrading because of that.
Submitted by gb.123 on Sat, 11/07/2020 - 05:22 Comment #8
Just an update .....After deleting the server, the file still persists in the current version also.
Submitted by cydactyl on Wed, 11/18/2020 - 20:20 Comment #9
Can confirm deleting and re-adding a domain is still an issue, the aforementioned php-fcgi-example-com file is located in /etc/init.d/php-fcgi-example-com for anyone who comes across this via search like me and had issues finding it.
Also to help bring relevant google searches to this page there are the errors I would come across in my log before switching PHP Execution Modes from FPM to FCGId in 'Website Options' under affected Virtualmin Virtual Server
connect() to unix:/var/php-nginx/15851138403793.sock/socket failed (2: No such file or directory) while connecting to upstream, client: xx.xx.xx.xx, server: example.com, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://unix:/var/php-nginx/15851138403793.sock/socket:", host: "example.com"
What Webmin and Virtualmin versions this error happens on? What virtualmin-nginx module version do you have installed?
We don't listen on sockets by default. Did you re-configured anything manually? Did you try re-running config check?
We have released Virtualmin-Nginx module version 2.18, which should fix this issue!