Backup fails: failed: connection to server on socket


  • Used Zammad version: 5.0.3-1642755691.7ff7be80.focal
  • Used Zammad installation type: package
  • Operating system: Ubuntu 20.04
  • Browser + version: any

Expected behavior:

  • Backup completed

Actual behavior:

  • Backup fails:
# /opt/zammad/contrib/backup/

# Zammad backup started - Tue 01 Feb 2022 08:23:28 AM CET!

creating file backup...
creating postgresql backup...
pg_dump: error: connection to database "zammad" failed: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATALE:  autenticazione Peer fallita per l'utente "zammad"

# Zammad backuped successfully - Tue 01 Feb 2022 08:27:19 AM CET!

I’ll file a new issue for the last message, as it shouldn’t return success if in fact it’s failing. But I see there’s not much error checking into the backup script…

I suspect this happens because I have two Postgresql versions, 12 and 14, which I personally didn’t install myself, but likely came from upgrades.

Steps to reproduce the behavior:

  • Just run /opt/zammad/contrib/backup/

Zammad is using Postgres 12. The script attempts connection using socket, while I assume Zammad itself uses TCP for connection.

Passing --host and --port to pg_dump completes successfully. Adding those params to database.yml solves the issue.

I’m wondering if those should be added by default.

The backup script isn’t using socket commands since Zammad 5 any more.
This may be a environment specific issue because above shouldn’t happen to default package installations (I’ve bombed more than a whole day in the verification process).

You seem to be using the initial version as your output does not match the current version output.
Ensure you’re on the latest Zammad version and try again and see:

Also make sure the correct server is up and running and listening on the default port.
If it doesn’t make sure to define it in your database.yml.

It’s a 4.x install upgraded to 5. Maybe this matters?

I checked the whole contrib/backup directory on the server against the latest develop source and the files are the same. What isn’t matching to you?

I mean sorry… just have a look here - it’s a classic and documented:

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