Foremain-maintain unable to restore

Problem:
After creating an offline full backup with foremain-maintain, I am unable to restore due to missing files/config.

Expected outcome:
Able to preform a restore from created full backup

Foreman and Proxy versions:
2.5.4

Foreman and Proxy plugin versions:
foreman-tasks : 4.1.5
foreman rex 4.5.6
katello 4.1.4

Distribution and version:
CentOS 7.9.2009

Other relevant data:
[root@uscdc01tlsat020 ~]# foreman-maintain backup offline /mnt/backup
Starting backup: 2021-12-30 12:16:49 -0500
Running preparation steps required to run the next scenarios

Make sure Foreman DB is up:
/ Checking connection to the Foreman DB [OK]

Running Backup

Confirm turning off services is allowed:
WARNING: This script will stop your services.

Do you want to proceed?, [y(yes), q(quit)] y
[OK]

Prepare backup Directory:
Creating backup folder /mnt/backup/katello-backup-2021-12-30-12-16-49 [OK]

Check if the directory exists and is writable: [OK]

Generate metadata:
\ Saving metadata to metadata.yml [OK]

Detect features available in the local proxy: [OK]

disable active sync plans:
\ Total 0 sync plans are now disabled. [OK]

Add maintenance_mode chain to iptables: [OK]

Stop applicable services:

Stopping the following service(s):
rh-redis5-redis, postgresql, pulpcore-api, pulpcore-content, rh-redis5-redis, pulpcore-api.socket, pulpcore-content.socket, tomcat, dynflow-sidekiq@orchestrator, foreman, httpd, puppetserver, foreman.socket, dynflow-sidekiq@worker-1, dynflow-sidekiq@worker-hosts-queue-1, foreman-proxy
| stopping pulpcore-content.socket
Warning: postgresql.service changed on disk. Run ‘systemctl daemon-reload’ to reload units.
/ All services stopped [OK]

Backup config files:

  • Collecting config files to backup [OK]

Backup Candlepin DB offline:
\ Collecting data from /var/opt/rh/rh-postgresql12/lib/pgsql/data/ [OK]

Backup Foreman DB offline:
Already done [OK]

Backup Pulpcore DB offline:
Already done [OK]

Start applicable services:

Starting the following service(s):
rh-redis5-redis, postgresql, pulpcore-api, pulpcore-content, rh-redis5-redis, tomcat, dynflow-sidekiq@orchestrator, foreman, httpd, puppetserver, dynflow-sidekiq@worker-1, dynflow-sidekiq@worker-hosts-queue-1, foreman-proxy
| starting rh-redis5-redis
Warning: postgresql.service changed on disk. Run ‘systemctl daemon-reload’ to reload units.
\ All services started [OK]

re-enable sync plans:

Total 0 sync plans are now enabled. [OK]

Remove maintenance_mode chain from iptables: [OK]

Compress backup data to save space:

  • Compressing backup of Postgres DB [OK]

Done with backup: 2021-12-30 12:19:36 -0500
**** BACKUP Complete, contents can be found in: /mnt/backup/katello-backup-2021-12-30-12-16-49 ****
[root@uscdc01tlsat020 ~]# cd /mnt/backup/katello-backup-2021-12-30-12-16-49/
[root@uscdc01tlsat020 katello-backup-2021-12-30-12-16-49]# ll
total 240284
-rw-r–r-- 1 root root 1358994 Dec 30 12:17 config_files.tar.gz
-rw-r–r-- 1 root root 44900 Dec 30 12:17 metadata.yml
-rw-r–r-- 1 root root 244642660 Dec 30 12:18 pgsql_data.tar.gz
[root@uscdc01tlsat020 katello-backup-2021-12-30-12-16-49]# foreman-maintain restore /mnt/backup/katello-backup-2021-12-30-12-16-49/
Running Restore backup

Check if command is run as root user: [OK]

Validate backup has appropriate files: [FAIL]

The given directory does not contain the required files or has too many files

All backup directories contain: config_files.tar.gz
An online or remote database backup directory contains: mongo_dump, candlepin.dump, foreman.dump, pulpcore.dump
An offline backup directory contains: mongo_data.tar.gz, pgsql_data.tar.gz
A logical backup directory contains: mongo_dump, candlepin.dump, foreman.dump, pulpcore.dump, mongo_data.tar.gz, pgsql_data.tar.gz
Including pulp_data.tar is optional and will restore pulp data to the filesystem if included.

Only the following files were found: pgsql_data.tar.gz, config_files.tar.gz, metadata.yml


Scenario [Restore backup] failed.

The following steps ended up in failing state:

[restore-validate-backup]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist=“restore-validate-backup”

Running Rescue Restore backup

[root@uscdc01tlsat020 katello-backup-2021-12-30-12-16-49]# ll
total 240284
-rw-r–r-- 1 root root 1358994 Dec 30 12:17 config_files.tar.gz
-rw-r–r-- 1 root root 44900 Dec 30 12:17 metadata.yml
-rw-r–r-- 1 root root 244642660 Dec 30 12:18 pgsql_data.tar.gz

Hi all,

Anyone have any suggestions on this issue I am having?

Thanks

Hi @gluciano,

I am having the same problem… please see here:

Someone just chimed in about using a new version of foreman-maintain so I am going to follow up with them there. Wondering why that version isn’t in the foreman repo though?

  • Eledor

Great thank you for that link, I’ll follow that as well.