When going to:
Virtualmin -> Choose a domain from the dropdown. -> Edit Users -> Choose a user from the list. -> Click Delete -> Click Delete Now.
The user is removed but the following message shows up:
Failed to save mailbox : DBI connect failed : could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
PostgreSQL is not running on the system, though we did install the client libraries.
When a user is removed it looks like it looks for all "useradmin_delete_user" subroutines and runs them against the user being removed.
Within postgresql there is a useradmin_update.pl script with such a subroutine.
However it neglects to test if PostgreSQL is:
(1) Installed.
(2) Setup to run on the system.
(3) Setup for the Virtual Server for which the user being deleted is attached.
(4) Checking to see if PostgreSQL is actively running, and if it should be but is not it should probably try to start it to finalize the process or keep track for reference in some sort of cache for when the server comes back up. Of course this also means that if the same username is re-added the same cache will have to keep track of that as well.
Instead of giving an error message where the user is removed but claiming the user failed to remove it would be better if it lists each area the user was attempted to be removed from and the status of each.
For example:
User: john@example.com
apache: Removed Successfully
cron: Removed Successfully (Click here for saved copy of deleted cron job for user.)
mysql: Removed Successfully
postgresql: Removal Cached (Server not running.)
sshd: Removed Successfully
Comments
Submitted by rsecor on Mon, 06/27/2016 - 18:34 Comment #1
Not sure what approach the Webmin/Virtualmin team wants to take on this otherwise I would do a quick patch to the postgresql -> useradmin_update.pl myself.
Submitted by andreychek on Mon, 06/27/2016 - 18:50 Comment #2
Howdy -- I believe Jamie is traveling at the moment, so it might be a bit before he can respond about any sort of change or fix.
However, I can offer that Postgres should always be installed by default, that's surprising that it isn't in your case. You're right though, it certainly shouldn't be trying to interact with Postgres if it isn't there.
Are you looking to use Postgres though?
If not, one way to handle that issue would be to disable Virtualmin's Postgres support. To do that, you can look in System Settings -> Features and Plugins, and there, you can disable the Postgres feature.
Submitted by JamieCameron on Tue, 06/28/2016 - 02:44 Comment #3
The only way I can see this happening is if PostgreSQL was stopped or un-installed after Virtualmin was installed.
Submitted by rsecor on Fri, 07/01/2016 - 20:03 Comment #4
@andreychek - PostgreSQL was already turned off.
@JamieCameron - You are correct it was installed and I had to turn it off for a variety of reasons.
Let me know if there is anything I can do on my end or if it is just a waiting game and working around it for now.
Thanks.
Submitted by JamieCameron on Sat, 07/02/2016 - 05:39 Comment #5
The proper fix is to configure Virtualmin to stop using PostgreSQL, by un-checking it on the System Settings -> Features and Plugins page.
Submitted by rsecor on Tue, 07/05/2016 - 10:50 Comment #6
The feature is already unchecked and disabled. However, the default checkbox is still checked. I did try adding and removing another user and had the same message.
I tried to re-enable the PostgreSQL plugin, so I can uncheck the default checkbox, but it would not re-enable as virtualmin does not believe it is installed. I tried to figure out what config file (assuming webmin/virtual-server/config) had the setting in it but was unable to determine the actual item to add/change in the config file.
Is it plausible that just having the default checkbox checked with PostgreSQL disabled at the same time that the issue would happen?
Submitted by JamieCameron on Wed, 07/06/2016 - 05:00 Comment #7
The 'default' checkbox does nothing if the box in the first column isn't checked.
I wonder if maybe one of your domains still have PostgreSQL enabled, even though it is globally disabled? Try running :
grep postgres=1 /etc/webmin/virtual-server/domains/*
for any files found, you can change the line to
postgres=0
Submitted by rsecor on Mon, 07/25/2016 - 22:36 Comment #8
Found "limit_postgres=1" in one of the files and removed the line.
Still had the error on removing/deleting a user.
Tried restarting webmin.
Same error again.
Found "postgres-user=username" in 3 of the domain files.
Removed those lines and restarted webmin.
Same error again.
Went through and removed the server from every "Cluster *" area and restarted webmin.
Same error again.
Are there any other configs that should be checked?
Submitted by JamieCameron on Tue, 07/26/2016 - 19:59 Comment #9
Try going to Webmin -> Servers -> PosgreSQL Database -> PostgreSQL Users, and turning off all the sync options.
Submitted by rsecor on Fri, 07/29/2016 - 08:04 Comment #10
Ok, based on the information Jamie gave (which I could not follow with PostgreSQL being down or not installed)...
Edited /etc/webmin/postgresql/config
Changed
sync_delete=1
sync_modify=1
To
sync_delete=0
sync_modify=0
Looks like this clears it up.
Submitted by andreychek on Fri, 07/29/2016 - 09:43 Comment #11
Great, thanks for letting us know how you fixed it -- and we're glad to hear it's working now!