Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1311313 - katello-restore fails returned 1: unable to load Private Key
katello-restore fails returned 1: unable to load Private Key
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Backup & Restore (Show other bugs)
6.1.7
x86_64 Linux
medium Severity medium (vote)
: 6.2.1
: Unused
Assigned To: Chris Roberts
sthirugn@redhat.com
http://projects.theforeman.org/issues...
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-23 17:24 EST by Ash Westbrook
Modified: 2016-08-16 03:10 EDT (History)
5 users (show)

See Also:
Fixed In Version: katello-3.0.0-5
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-08-16 03:10:22 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Foreman-debug (1.18 MB, application/x-xz)
2016-02-23 17:24 EST, Ash Westbrook
no flags Details
console_output.log (90.13 KB, text/plain)
2016-08-09 10:17 EDT, sthirugn@redhat.com
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 14125 None None None 2016-05-18 13:02 EDT
Red Hat Product Errata RHBA-2016:1615 normal SHIPPED_LIVE Satellite 6.2.1 bug fix update 2016-08-16 07:09:48 EDT

  None (edit)
Description Ash Westbrook 2016-02-23 17:24:32 EST
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 17:15:08 EDT
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 15:04:54 EDT
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 15:05:18 EDT
Version tested: Sat-6.2.beta-snap-9.3
Comment 9 Chris Roberts 2016-05-18 12:19:46 EDT
Fixed in PR

https://github.com/Katello/katello-packaging/pull/189
Comment 12 sthirugn@redhat.com 2016-08-09 10:17:01 EDT
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 10:17 EDT
Created attachment 1189278 [details]
console_output.log
Comment 15 errata-xmlrpc 2016-08-16 03:10:22 EDT
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

Note You need to log in before you can comment on or make changes to this bug.