Creating an online backup (satellite-6.2.9-4.0.el7sat.noarch), both on rhel6 and 7: # katello-backup --online-backup backup_directory Starting backup: 2017-04-20 09:26:30 -0400 Creating backup folder backup_directory/katello-backup-2017-04-20T09:26:30-04:00 Generating metadata ... /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_theme_satellite-0.1.42/app/models/concerns/satellite_packages.rb:4: warning: already initialized constant Katello::Ping::PACKAGES /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.0.0.123/app/models/katello/ping.rb:7: warning: previous definition of PACKAGES was here Backing up config files... Done. Backing up postgres db... -bash: backup_directory/katello-backup-2017-04-20T09:26:30-04:00/foreman.dump: No such file or directory -bash: backup_directory/katello-backup-2017-04-20T09:26:30-04:00/candlepin.dump: No such file or directory Done. Backing up mongo db... Done. Backing up Pulp data... tar: Removing leading `/' from member names Done. Done with backup: 2017-04-20 09:28:07 -0400 **** BACKUP Complete, contents can be found in: backup_directory/katello-backup-2017-04-20T09:26:30-04:00 **** Note the "No such file or directory" messages, foreman.dump and candlepin.dump are not created: # ls -la backup_directory/katello-backup-2017-04-20T09\:26\:30-04\:00/ total 3720648 drwxrwx---. 3 root postgres 126 Apr 20 09:26 . drwxr-xr-x. 4 root root 102 Apr 20 09:26 .. -rw-r--r--. 1 root root 1823740 Apr 20 09:26 config_files.tar.gz -rw-r--r--. 1 root root 19577 Apr 20 09:26 .config.snar -rw-r--r--. 1 root root 346 Apr 20 09:28 metadata drwxr-xr-x. 5 root root 52 Apr 20 09:26 mongo_dump -rw-r--r--. 1 root root 3806085120 Apr 20 09:28 pulp_data.tar -rw-r--r--. 1 root root 2005528 Apr 20 09:28 .pulp.snar Seems like the pg_dump wants the dump file to be created beforehand. Expected results: candlepin.dump and foreman.dump are created successfully. katello-backup should chechk if all files were created as expected. Actual resutls: Missing candlepin.dump and foreman.dump in the backup folder -- prevents successful restoring. katello-backup prints BACKUP Complete, even though the files are missing
workaround: this issue does not occur when the backup directory is created under /tmp/ When attempting to create backups using a full path to a custom destination directory like this: # katello-backup --online-backup /root/backup_directory ...pg_dump produces a different error: -bash: /root/backup_directory/katello-backup-2017-04-20T10:36:36-04:00/foreman.dump: Permission denied -bash: /root/backup_directory/katello-backup-2017-04-20T10:36:36-04:00/candlepin.dump: Permission denied This occurs with setenforce 0 as well, may be related to https://bugzilla.redhat.com/show_bug.cgi?id=1432013 So there are 2 problems here: - pg_dump used in online backup requires full path to the destination dir - pg_dump doesn't get permission to write to custom destination dirs
Hi Peter, Currently right now this is an issue that is fixed but will not be available until 6.1.12: https://bugzilla.redhat.com/show_bug.cgi?id=1432013 For right now in the docs we need to provide a note to run katello-backup --online-backup in the /tmp directory. Once this is fixed in 6.2.12 we can remove this note from the docs. Most customers should be using /tmp anyways and then push it to where they want to store it.
Hi Christine, good to know, thanks. I filed https://bugzilla.redhat.com/show_bug.cgi?id=1452659 to let documentation know.
Verified on satellite-6.3.0-17.0.beta.el7sat.noarch, when obeying the recommendation to use /tmp or /var/tmp, the dump files are created as expected ~]# ll /var/tmp/backup/katello-backup-20170905084527/ total 4980 -rw-r--r--. 1 postgres postgres 267615 Sep 5 08:46 candlepin.dump -rw-r--r--. 1 root root 674369 Sep 5 08:45 config_files.tar.gz -rw-r--r--. 1 postgres postgres 4099807 Sep 5 08:46 foreman.dump -rw-r--r--. 1 root root 48812 Sep 5 08:45 metadata.yml drwxr-xr-x. 5 root root 52 Sep 5 08:46 mongo_dump -rw-r--r--. 1 postgres postgres 650 Sep 5 08:46 pg_globals.dump
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. > > > > For information on the advisory, and where to find the updated files, follow the link below. > > > > If the solution does not work for you, open a new bug report. > > > > https://access.redhat.com/errata/RHSA-2018:0336