Bug 1482164

Summary: Can still run katello-restore for an online backup without pg_globals.dump
Product: Red Hat Satellite Reporter: John Mitsch <jomitsch>
Component: Backup & RestoreAssignee: John Mitsch <jomitsch>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbuckingham, chrobert, ehelms
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: katello-3.4.5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-02-21 17:02:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1488590    

Description John Mitsch 2017-08-16 15:25:15 UTC
Description of problem:

An online backup produces pg_globals.dump. A user can still run katello-restore without this file, even though katello-restore expects it to be there.

Version-Release number of selected component (if applicable):
6.3.0

How reproducible:
%100

Steps to Reproduce:
1.katello-backup --online-backup /backup
2.change name of pg_globals.dump in backup
3.run katello-restore on backup

Actual results:
Katello-restore script executes


Expected results:
A warning message that pg_globals is missing/modified and script exits.


Additional info:

Comment 2 John Mitsch 2017-08-17 14:46:39 UTC
Created redmine issue http://projects.theforeman.org/issues/20632 from this bug

Comment 3 Satellite Program 2017-08-17 16:18:01 UTC
Upstream bug assigned to jomitsch

Comment 4 Satellite Program 2017-08-23 18:18:03 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20632 has been resolved.

Comment 5 Chris Roberts 2017-09-06 16:20:30 UTC
[root@rhel7 ~]# katello-restore /tmp/backup/katello-backup-20170906161439/
WARNING: This script will drop and restore your database.
Your existing installation will be replaced with the backup database.
Once this operation is complete there is no going back.
Are you sure(Y/N)? y 
Starting restore from /tmp/backup/katello-backup-20170906161439/: 2017-09-06 16:19:12 +0000
Setting file security
Done.
Resetting Katello
yes | foreman-installer -v --reset --scenario katello
Failed 'yes | foreman-installer -v --reset --scenario katello'

Comment 6 John Mitsch 2017-09-06 16:57:07 UTC
This is blocked being verified by https://bugzilla.redhat.com/show_bug.cgi?id=1488590

Once that is resolved, we can verify this.

Comment 7 Peter Ondrejka 2017-11-10 14:37:05 UTC
Verified on sat 6.3 snap 24:

Using backup with renamed pg_globals:

~]# katello-restore /backup/satellite-backup-20171110092110

DEPRECATION WARNING: katello-restore is deprecated and will
be removed in the next Satellite release. It is being replaced by
satellite-restore. Redirecting to satellite-restore now.

---- The given directory does not contain the required files or has too many files
---- All backup directories contain: config_files.tar.gz, pulp_data.tar*
---- An online backup directory contains: mongo_dump, candlepin.dump, foreman.dump, pg_globals.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, pg_globals.dump, mongo_data.tar.gz, pgsql_data.tar.gz
---- *pulp_data.tar is optional
---- Please choose a valid backup directory
Usage: satellite-restore /path/to/dir [options]
 eg: $ satellite-restore /tmp/backup/satellite-backup-20171002150106
    -y, --assumeyes                  Answer yes for all questions

Comment 8 Bryan Kearney 2018-02-21 17:02:59 UTC
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