Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1311313

Summary: katello-restore fails returned 1: unable to load Private Key
Product: Red Hat Satellite Reporter: Ash Westbrook <awestbro>
Component: Backup & RestoreAssignee: Chris Roberts <chrobert>
Status: CLOSED ERRATA QA Contact: sthirugn <sthirugn>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1.7CC: anerurka, bbuckingham, chrobert, ehelms, sthirugn
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
URL: http://projects.theforeman.org/issues/14125
Whiteboard:
Fixed In Version: katello-3.0.0-5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-16 07:10:22 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:
Attachments:
Description Flags
Foreman-debug
none
console_output.log none

Description Ash Westbrook 2016-02-23 22:24:32 UTC
Created attachment 1129930 [details]
Foreman-debug

Description of problem:


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

Satellite 6.1.7

How reproducible:

Always

Steps to Reproduce:
Steps to reproduce:

1) yum -y install katello
2) katello-installer
3) cd /mnt/backup1
4) katello-backup .
5) cd ~
6) katello-remove
7) yum -y install katello
8) katello-installer
9) cd /mnt/backup1
10) katello-restore .
11) Above error is produced.


Actual results:

Fails with  returned 1: unable to load Private Key

Expected results:

Successful restore from backup.

Additional info:

Another attempt with --reset or --certs-skip-check results in the same error.

yum -y install katello
katello-installer --reset
cd /mnt/backup1
katello-restore .


I noticed that that is the command 'katello-installer --reset' is run in the katello-restore script, right after it applies the configuration to the system.

if I go to the root of the system and untar the configuration files:
cd / && tar xf /mnt/backup1/config_files.tar.gz

then run the command that appears to be erroring:
/usr/bin/openssl rsa -in /root/ssl-build/katello-default-ca.key -out /root/ssl-build/katello-default-ca.key.tmp -passin file:/etc/pki/katello/private/katello-default-ca.pwd

It succeeds.  Then when I try to run katello-installer again, or even capsule-certs-generate, the password file changes so that the command does not work anymore.


[root@sat6 ~]# katello-installer --certs-skip-check
 /Stage[main]/Certs/Privkey[/etc/pki/katello/private/katello-default-ca.key]: Could not evaluate: Execution of '/usr/bin/openssl rsa -in /root/ssl-build/katello-default-ca.key -out /root/ssl-build/katello-default-ca.key.tmp -passin file:/etc/pki/katello/private/katello-default-ca.pwd' returned 1: unable to load Private Key
 /Stage[main]/Gutterball::Database/Postgresql::Server::Db[gutterball]/Postgresql::Server::Database[gutterball]/Exec[/usr/bin/createdb --port='5432' --owner='postgres' --template=template0 --encoding 'utf8' --locale=en_US.utf8  'gutterball']: Failed to call refresh: /usr/bin/createdb --port='5432' --owner='postgres' --template=template0 --encoding 'utf8' --locale=en_US.utf8  'gutterball' returned 1 instead of one of [0]
 /Stage[main]/Gutterball::Database/Postgresql::Server::Db[gutterball]/Postgresql::Server::Database[gutterball]/Exec[/usr/bin/createdb --port='5432' --owner='postgres' --template=template0 --encoding 'utf8' --locale=en_US.utf8  'gutterball']: /usr/bin/createdb --port='5432' --owner='postgres' --template=template0 --encoding 'utf8' --locale=en_US.utf8  'gutterball' returned 1 instead of one of [0]

Comment 2 Chris Roberts 2016-03-14 21:15:08 UTC
Installed a satellite on RHEL 6/7 and did a backup and restore and this issue is not longer present in the 6.1.8 build. I also tested a 6.1.7 upgraded to 6.1.8 and then a restore and this did not happen. Moving to ON_QA

- Chris Roberts

Comment 6 sthirugn@redhat.com 2016-04-27 19:04:54 UTC
Blocked with https://bugzilla.redhat.com/show_bug.cgi?id=1331117.  Due to BZ 1331117, this bug will be moved to failed state.

Comment 7 sthirugn@redhat.com 2016-04-27 19:05:18 UTC
Version tested: Sat-6.2.beta-snap-9.3

Comment 9 Chris Roberts 2016-05-18 16:19:46 UTC
Fixed in PR

https://github.com/Katello/katello-packaging/pull/189

Comment 12 sthirugn@redhat.com 2016-08-09 14:17:01 UTC
Verified in satellite-6.2.1-1.0.el7sat.noarch

Verification steps:
    1  mkdir mnt/backup
    2  mkdir /mnt/backup
    3  cd /mnt/backup/
    4  katello-backup .
    5  katello-remove 
    6  rpm -qa | grep satellite
    7  yum -y install satellite
    8  satellite-installer --scenario=satellite
    9  cd /mnt/backup/
   10  katello-restore .
   11  echo $? (displayedc 0)

Output log is attached in output.log for reference.

Comment 13 sthirugn@redhat.com 2016-08-09 14:17:25 UTC
Created attachment 1189278 [details]
console_output.log

Comment 15 errata-xmlrpc 2016-08-16 07:10:22 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/RHBA-2016:1615