Restroring from full offline Satellite backup fails with `pg_restore: error: could not uncompress data: (null)` error on Red Hat Satellite 6.16 server

Solution Verified - Updated

Environment

  • Red Hat Satellite 6.16 running on Red Hat Enetrprise Linux 8.x
  • Red Hat Satellite 6.16 running on Red Hat Enetrprise Linux 9.x

Issue

  • Restoration of Satellite full offline backup taken from Red Hat Satellite 6.16 server running on Red Hat Enetrprise Linux 8.x on Red Hat Satellite 6.16 server running on Red Hat Enetrprise Linux 9.x fails with the following error:

      \--------------------------------------------------------------------------------
      Restore candlepin postgresql dump from backup:
      | Restoring candlepin dump                                            [OK]
      \--------------------------------------------------------------------------------
      Restore foreman postgresql dump from backup:
      | Restoring foreman dump                                              [FAIL]
      Failed executing runuser - postgres -c 'pg_restore -C -d postgres /backup/satellite-backup-2025-05-30-10-57-07/foreman.dump', exit status 1:
       pg_restore: error: could not uncompress data: (null)
      \--------------------------------------------------------------------------------
      Scenario [Restore backup] failed.
    
      The following steps ended up in failing state:
    
        [restore-foreman-dump]
    
      Resolve the failed steps and rerun the command.
    

Resolution

  1. On the source Satellite server (the Satellite server running on RHEL 8.x), edit /var/lib/pgsql/data/postgresql.conf and increase max_wal_size to 2GB:
max_wal_size = 2GB
  1. Restart Satellite services:
# foreman-maintain service restart
  1. Take another full offline Satellite backup.

  2. Copy the backup file to the target Satellite server (the Satellite server running on RHEL 9.x), and restore.

For more KB articles/solutions related to Red Hat Satellite 6.x backup issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x backup-related Issues

Diagnostic Steps

  • In /var/log/foreman-maintain/foreman-maintain.log, the following error is logged while restoring the foreman database dump:

    I, [2025-06-02 15:22:43+0100 #17528]  INFO -- : --- Execution step 'Restore foreman postgresql dump from backup' [restore-foreman-dump] started ---
    E, [2025-06-02 15:23:48+0100 #17528] ERROR -- : Failed executing runuser - postgres -c 'pg_restore -C -d postgres /backup/satellite-backup-2025-05-30-10-57-07/foreman.dump', exit status 1:
     pg_restore: error: could not uncompress data: (null) (ForemanMaintain::Error::ExecutionError)
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/utils/command_runner.rb:52:in `execution_error'
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/concerns/system_helpers.rb:69:in `execute!'
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/concerns/base_database.rb:79:in `restore_dump'
    /usr/share/gems/gems/foreman_maintain-1.7.13/definitions/procedures/restore/foreman_dump.rb:26:in `restore_foreman_dump'
    /usr/share/gems/gems/foreman_maintain-1.7.13/definitions/procedures/restore/foreman_dump.rb:18:in `block in run'
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/reporter/cli_reporter.rb:146:in `with_spinner'
    /usr/share/ruby/forwardable.rb:238:in `with_spinner'
    /usr/share/ruby/forwardable.rb:238:in `with_spinner'
    /usr/share/gems/gems/foreman_maintain-1.7.13/definitions/procedures/restore/foreman_dump.rb:17:in `run'
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/executable.rb:142:in `__run__'
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/runner/execution.rb:87:in `block (2 levels) in run'
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/runner/execution.rb:111:in `capture_errors'
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/runner/execution.rb:86:in `block in run'
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/runner/execution.rb:105:in `with_metadata_calculation'
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/runner/execution.rb:85:in `run'
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/runner.rb:134:in `run_step'
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/runner.rb:123:in `run_steps'
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/runner.rb:116:in `execute_scenario_steps'
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/runner.rb:61:in `run_scenario'
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/runner.rb:42:in `block in run'
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/runner.rb:41:in `each'
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/runner.rb:41:in `run'
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/cli/base.rb:64:in `run_scenario'
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/cli/restore_command.rb:21:in `execute'
    /usr/share/gems/gems/clamp-1.3.2/lib/clamp/command.rb:66:in `run'
    /usr/share/gems/gems/clamp-1.3.2/lib/clamp/subcommand/execution.rb:18:in `execute'
    /usr/share/gems/gems/clamp-1.3.2/lib/clamp/command.rb:66:in `run'
    /usr/share/gems/gems/foreman_maintain-1.7.13/lib/foreman_maintain/cli.rb:40:in `run'
    /usr/share/gems/gems/clamp-1.3.2/lib/clamp/command.rb:140:in `run'
    /usr/share/gems/gems/foreman_maintain-1.7.13/bin/foreman-maintain:15:in `<top (required)>'
    /bin/satellite-maintain:25:in `load'
    /bin/satellite-maintain:25:in `<main>'
    
  • Cross-checking with /var/lib/pgsql/data/log/postgresql-*.log:

    2025-06-02 15:23:45 BST LOG:  checkpoints are occurring too frequently (13 seconds apart)
    2025-06-02 15:23:45 BST HINT:  Consider increasing the configuration parameter "max_wal_size".
    2025-06-02 15:23:48 BST ERROR:  canceling statement due to user request
    
  • In /var/lib/pgsql/data/postgresql.conf, max_wal_size is set with the default value of 1GB, which is a conservative setting:

    max_wal_size = 1GB
    
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.