Submitted by Brook on Fri, 07/17/2015 - 12:40
Virtualmin... Backup and Restore... Backup Virtual Servers
is failing on the PG backup, but Webmin... PostgreSQL Database Server... Backup databases
works. (See attached screenshots.)
I have upgraded Postgres to 9.3 and updated the Postgres settings in the module (see screenshot) so it seems as though the Virtualmin backup doesn't honour these settings (as the backup from the postgres server page seems to work fine).
Status:
Closed (fixed)
Comments
Submitted by andreychek on Fri, 07/17/2015 - 13:13 Comment #1
It looks like the error Postgres is giving is as follows:
Connection to database XXX failed: fe_sendauth: no password supplied
Jamie, do you have any thoughts as to why the password wouldn't be seen in this newer Postgres version (9.3)?
Newer distros use that version, so it should be possible for that version to work.
Submitted by JamieCameron on Fri, 07/17/2015 - 19:19 Comment #2
The issue may be that Virtualmin is using the domain's PostgreSQL login and password to perform the backups, rather than the
root
login. If you go to Webmin -> Servers -> PostgreSQL Database, do all your databases appear?Submitted by Brook on Fri, 07/17/2015 - 19:51 Comment #3
Yes they appear (that is the page where I can back-up all databases).
Submitted by JamieCameron on Fri, 07/17/2015 - 20:44 Comment #4
Ok .. and can you login to your PostgreSQL database from the command line, using the
psql
command?Submitted by Brook on Fri, 07/17/2015 - 21:08 Comment #5
If I type in
psql
it asks for a password (which I can't remember or remember setting)psql: FATAL: password authentication failed for user "root"
Submitted by JamieCameron on Fri, 07/17/2015 - 23:25 Comment #6
What if you use a command like
psql -U domainuser -W
(replacing domainuser with the admin user for the domain)Submitted by Brook on Sat, 07/18/2015 - 04:29 Comment #7
...I'm able to log in fine.
Submitted by JamieCameron on Sat, 07/18/2015 - 13:28 Comment #8
So Virtualmin uses a
.pgpass
file to set the password for logging in - I wonder if perhaps in PostgreSQL 9.3 the semantics or format of this file changed.Which Linux distribution are you running there, and how did you do the upgrade to 9.3 ?
Submitted by Brook on Sun, 07/19/2015 - 13:35 Comment #9
/Post removed as the details were incorrect/
Submitted by Brook on Sun, 07/19/2015 - 13:34 Comment #10
Hi Jamie, sorry I posted the wrong instructions - the one in the previous post are for CentOS 7, but the error is actually on my CentOS 6 server - sorry!
Here's how I installed it on CentOS 6:
Submitted by JamieCameron on Sun, 07/19/2015 - 15:14 Comment #11
So I just installed the exact same PostgreSQL version on a CentOS 6 system, and with both Virtualmin 4.17 and 4.18 I was able to backup a domain with a PostgreSQL database just fine.
I wonder, are you using hashed passwords on your system (so that they PostgreSQL login is different from the admin login for the domain) ?
Submitted by Brook on Sun, 07/19/2015 - 15:20 Comment #12
Do you mean in the post-installation set-up page Jamie? If so, then yes I always choose hashed passwords.
Submitted by JamieCameron on Sun, 07/19/2015 - 15:25 Comment #13
Also, do you have PostgreSQL setup to allow connections from the Unix user with the same name as the DB login, without a password being required?
Submitted by JamieCameron on Sun, 07/19/2015 - 15:25 Comment #14
Also, do you have PostgreSQL setup to allow connections from the Unix user with the same name as the DB login, without a password being required?
Submitted by Brook on Sun, 07/19/2015 - 15:40 Comment #15
Do you mean what's in the attached screen?
Submitted by JamieCameron on Sun, 07/19/2015 - 15:50 Comment #16
No, I was referring to the "Allowed Hosts" page.
Submitted by Brook on Sun, 07/19/2015 - 16:40 Comment #17
Ok... MD5 password - see attached screen grab:
Submitted by Brook on Sun, 07/19/2015 - 20:12 Comment #18
Hi Jamie,
I have changed the settings for 'Local connection' and '127.0.0.1/32' to no authentication required (see attached image) and it is working now ...is that the correct settings?
What about '::1/128' do I need to change that too?
Submitted by JamieCameron on Sun, 07/19/2015 - 20:33 Comment #19
Ok, I found the bug that causes this - it happens only when MD5 password authenticate is in use. Your change is a suitable work-around - a proper fix will be in the 4.19 Virtualmin release.
Submitted by Brook on Sun, 07/19/2015 - 21:03 Comment #20
Thanks Jamie.
Will I need to make any further changes when 4.19 is out, or will the update take care of reverting/updating the settings?
Submitted by JamieCameron on Sun, 07/19/2015 - 21:22 Comment #21
If you want to revert to MD5 password authentication, you will have to do that manually after 4.19 comes out.
Submitted by Brook on Mon, 07/20/2015 - 06:20 Comment #22
Are there any negatives to leaving it as it is?
I've just found the guide I used to install it, so it's actually more involved than the details in the post above (sorry, those were in my notes) http://www.davidghedini.com/pg/entry/install_postgresql_9_on_centos
Here is my set-up notes for installing it on CentOS 7, looking at the guide in the link above, and the instructions below, do you feel these are adequate - or would you recommend following all or more of the guide in the link?
[quote] How to upgrade PostgresCentOS 7 (From: http://www.liquidweb.com/kb/how-to-install-and-connect-to-postgresql-on-...) yum install uuid
HOW TO LOG INTO THE POSTGRES DATABASE
HOW TO UPDATE VIRTUALMIN SO THAT IT HAS DETAILS OF THE CORRECT PG VERSION
[/quote]
Submitted by JamieCameron on Mon, 07/20/2015 - 16:16 Comment #23
I don't think there are any negatives ... in fact, on my system when I installed PostgreSQL 9.3 it was using ident-based authentication by default.
Submitted by Brook on Mon, 07/20/2015 - 18:14 Comment #24
Thanks Jamie. FYI, I think I had to change it on the CentOS 7 install too (to no authentication required) as it wouldn't create databases otherwise.
Submitted by Issues on Mon, 08/03/2015 - 18:18 Comment #25
Automatically closed -- issue fixed for 2 weeks with no activity.