Restore failing from same new system

Infos:

  • Used Zammad version: 5.0.2
  • Installation method (source, package, …): package
  • Operating system: ubuntu 20.04
  • Database + version: postgres 12.9
  • Elasticsearch version: elasticsearch 7.15.2

Expected behavior:

  • Install zammad (hetzner cloud)
  • After install create backup (with #2508)
  • After backup restore same backup directly
  • Restoreing successful

Actual behavior:

  • Backup folder set as in #2508
  • try restore this backup
    • when restoreing with zammad user:
$ sudo -u zammad -H /opt/zammad/contrib/backup/zammad_restore.sh

# Zammad restored started - Sat 20 Nov 2021 01:45:26 PM UTC!

The restore will delete your current config and database!
Be sure to have a backup available!

Enter 'yes' if you want to proceed!
Restore?: yes
Enter file date to restore:
20211120134351
File date: 20211120134351
Enter db date to restore:
20211120134351
DB date: 20211120134351
# Stopping Zammad
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to stop 'zammad.service'.
Authenticating as: root
Password: Failed to stop zammad.service: Connection timed out
See system logs and 'systemctl status zammad.service' for details.
# Checking requirements
polkit-agent-helper-1: pam_authenticate failed: Authentication failure
# ... Dropping current database zammad
PG::ObjectInUse: ERROR:  database "zammad" is being accessed by other users
DETAIL:  There are 6 other sessions using the database.
Couldn't drop database 'zammad'
rake aborted!
ActiveRecord::StatementInvalid: PG::ObjectInUse: ERROR:  database "zammad" is being accessed by other users
  • When restoring with root user:
$ /opt/zammad/contrib/backup/zammad_restore.sh

# Zammad restored started - Sat 20 Nov 2021 01:48:10 PM UTC!

The restore will delete your current config and database!
Be sure to have a backup available!

Enter 'yes' if you want to proceed!
Restore?: yes
Enter file date to restore:
20211120134351
File date: 20211120134351
Enter db date to restore:
20211120134351
DB date: 20211120134351
# Stopping Zammad
# Checking requirements
# ... Dropping current database zammad
Dropped database 'zammad'
# ... Creating database zammad for owner zammad
CREATE DATABASE
# Restoring PostgreSQL DB
psql: error: FATAL:  Peer authentication failed for user "zammad"
# Restoring Files
# Ensuring correct file rights ...
# Clearing Cache ...
# Starting Zammad

# Zammad restored successfully - Sat 20 Nov 2021 01:48:36 PM UTC!

Steps to reproduce the behavior:

  • Install zammad (hetzner cloud)
  • After install create backup (with #2508)
  • After backup restore same backup directly