Restoring Red Hat Satellite Server from existing backup fails with permission error

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.x

Issue

  • Restoring backup of Red Hat Satellite server fails with below error:

      # satellite-maintain restore /var/backup_directory
      Restore candlepin postgresql dump from backup: 
      \ Restoring candlepin dump                                            [FAIL]    
      Failed executing runuser - postgres -c 'pg_restore -C -d postgres /var/satellite-backup-path/candlepin.dump', exit status 1:
      pg_restore: '[archiver]' could not open input file "/var/satellite-backup-path/candlepin.dump": Permission denied
    
      Scenario [Restore backup] failed.
    
      The following steps ended up in failing state:
    
       [restore-candlepin-dump]
    
      Resolve the failed steps and rerun
      the command. In case the failures are false positives,
      use --whitelist="restore-candlepin-dump"
    

Resolution

  • Assign correct ownership and permission to backup directory path and files following below command:

      # chown root:postgres /var/satellite-backup-path/
      # chmod 770 /var/satellite-backup-path/
      # chown root:root /var/satellite-backup-path/candlepin.dump
      # chmod 644 /var/satellite-backup-path/candlepin.dump
      # chown root:root /var/satellite-backup-path/foreman.dump
      # chmod 644 /var/satellite-backup-path/foreman.dump
      # chown postgres:postgres /var/satellite-backup-path/pg_globals.dump
      # restorecon -Rv /var/satellite-backup-path
    
  • After assigning correct permission , re-run restore command on your Red Hat Satellite server.

Root Cause

  • Ownership and permission of the backup files were manually modified.

Diagnostic Steps

  • Verify ownership and permission of the file for backup directory path using below command.

      # ls -alZd /var/satellite-backup-path/
      # ls -alZ /var/satellite-backup-path/
    
SBR
Product(s)
Components
Category

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.