Bug 1311313 - katello-restore fails returned 1: unable to load Private Key
Summary: katello-restore fails returned 1: unable to load Private Key
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Backup & Restore
Version: 6.1.7
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: Unspecified
Assignee: Chris Roberts
QA Contact: sthirugn@redhat.com
URL: http://projects.theforeman.org/issues...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-23 22:24 UTC by Ash Westbrook
Modified: 2019-11-14 07:29 UTC (History)
5 users (show)

Fixed In Version: katello-3.0.0-5
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-16 07:10:22 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 14125 0 Normal Closed katello-remove does not remove many things 2020-10-22 17:41:59 UTC
Red Hat Product Errata RHBA-2016:1615 0 normal SHIPPED_LIVE Satellite 6.2.1 bug fix update 2016-08-16 11:09:48 UTC

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


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