Backup fails due to pg_dump error. PostgreSQL is running on nonstandard port, and the port is correctly specified in webmin postgresql config page.
Steps to reproduce:
Install Odoo 8 (Python/PostgreSQL). Change PostgreSQL port from standard 5432 to 5433 as in the standard Odoo 8 install steps. Note, Odoo uses PostgreSQL on port 5433 this to avoid possibly conflicting with an already running postgresql running on the server standard port 5432. Similar to running Apache to listen on a different port.
Create the Vmin virtual subserver by Importing the Odoo 8 directory via the Virtualmin web console.
Specify nonstandard port 5433 in the webmin postgresql module "PostgreSQL port to connect to".
Add the postgresql database manually to the vmin subserver so that it'll be part of the backup data. Virtualmin gives success message because it detects the PostgreSQL server and database
Create a backup job by using the Vmin web console. Daily full backup of all virtual servers and all data, save to remote FTP server.
Let Vmin run the backup job at the scheduled time.
Return and look at backup log.
Backup has failed !?
It seems Virtualmin is failing to pass the nonstandard port parameter to the pg_dump script.
Exact error message:
Dumping PostgresSQL database xxxx .. .. dump failed! pg_dump: [archiver (db)] connection to database "xxxx" 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"?
Comments
Submitted by JamieCameron on Tue, 02/03/2015 - 21:36 Comment #1
Thanks for pointing this out - it will be fixed in the next Webmin release.
Submitted by Chris_C on Fri, 03/06/2015 - 17:22 Comment #2
Cheers Jamie. Any idea when the next webmin release might be.
Submitted by JamieCameron on Fri, 03/06/2015 - 19:30 Comment #3
Should be in a week or two. Actually, I just released a 1.733 development version today that will include this fix, if you want to get it sooner - see http://www.webmin.com/devel.html
Submitted by Chris_C on Thu, 03/19/2015 - 18:10 Comment #4
The new version is taking the correct non-default port number from the config.
However it's still failing the backup....
Dumping PostgresSQL database shop ..
.. dump failed! pg_dump: server version: 9.1.14; pg_dump version: 8.4.21
pg_dump: aborting because of server version mismatch
$ find / -name pg_dump -type f
/usr/lib/postgresql/9.1/bin/pg_dump
/usr/lib/postgresql/8.4/bin/pg_dump
How would you recommend clearing up this error?
Should Virtualmin/Webmin handle choosing the correct version of pg_dump ??
or should the older version of pg_dump be removed, and if so, how would you best recommend doing that.
Submitted by JamieCameron on Thu, 03/19/2015 - 18:51 Comment #5
Do you perhaps have multiple versions of the pg_dump command installed? You can configure the path Webmin uses at Webmin -> Servers -> PostgreSQL Database -> Module Config.
Submitted by Chris_C on Fri, 03/20/2015 - 15:20 Comment #6
That was it. 2 copies of postgresql were installed.
The commands listed in the Webmin module config for Postgresql are the symboli links to scripts that find and run the binaries for whichever version it deems appropriate, and that is somewhat arbitrary.
Commands to fix it.
Submitted by Chris_C on Sat, 03/21/2015 - 17:17 Comment #7
OK now this has uncovered another bug. It seems that 18 of the 19 servers in the full backup complete OK, but on the "View Backup" screen. The status shows:
Final status Failed
The one server with an error:
Creating backup for virtual server pm.mydomain.com ..
Copying virtual server configuration ..
.. done
Copying records in DNS domain ..
.. done
Saving mail aliases ..
.. done
Saving mail and FTP users ..
.. done
Backing up mail and FTP user Cron jobs ..
.. none to backup
Copying Apache virtual host configuration ..
.. done
Copying Apache log files ..
.. done
Copying Webalizer configuration files ..
.. no logging directive found in webserver configuration!
Saving Virtualmin configuration ..
.. done
Saving templates and plans ..
.. done
Saving email templates ..
.. done
Saving custom fields, links, categories and shells ..
.. done
Saving custom script installers ..
.. done
Saving scheduled backups ..
.. done
Saving FTP directory restrictions ..
.. done
Saving DKIM settings ..
.. done
Saving greylisting settings ..
.. done
Save mail rate limiting configuration ..
.. done
Saving mail server configuration ..
.. done
.. done
Any suggestion how to fix this no logging directive found in webserver configuration! ?
Submitted by JamieCameron on Sat, 03/21/2015 - 18:38 Comment #8
Check the Apache <Virtualhost> configuration for that domain - if it is missing a
CustomLog
orTransferLog
line, then you will get this error. That should only happen if the config was edited manually though..Submitted by Chris_C on Sat, 03/21/2015 - 19:15 Comment #9
Thanks jamie. You're close! The conf file for the server
/etc/apache2/sites-available/pm.mydomain.com.conf
was missingAccessLog
andErrorLog
The reason for the missing apache log lines from the conf file seems to be because this is a 3rd party PHP web app that installed itself via its own shell script, and created this conf file and home directory for itself in
/opt
.Because this PHP app installed itself in a location that doesn't fit Virtualmin's expected
/home/servername
structure. It installed itself into/opt/processmaker/
with its own conf file in its own etc folder,/opt/processmaker/etc/pmos.conf
.Virtualmin complains about missing folders
/home/servername/domains/mydomain/cgi-bin
,/home/servername/domains/mydomain/logs
, and/home/servername/domains/mydomain/homes
, so had to create those manually, set proper ownership, and then the Validate Virtual Servers finally showed clean results, with no errors in the virtual servers.However this app (virtual server) is still running off the wrong conf file, so it fails to actually run in the browser, you just get a blank screen, because the conf file in
/home
is empty, Virtualmin expects the code and conf to be located in the/home
folder but it's really installed in/opt
.Submitted by JamieCameron on Sat, 03/21/2015 - 21:29 Comment #10
Yeah, the way Virtualmin installs suexec will prevent PHP scripts from running outside of /home - we can't really support other install methods like this.