Bug 1331117

Summary: Reinstalling satellite after katello-remove failed
Product: Red Hat Satellite Reporter: sthirugn <sthirugn>
Component: InstallationAssignee: Chris Roberts <chrobert>
Status: CLOSED ERRATA QA Contact: Chris Duryee <cduryee>
Severity: high Docs Contact:
Priority: high    
Version: 6.2.0CC: bbuckingham, bkearney, cduryee, chrobert, ehelms, mmello
Target Milestone: UnspecifiedKeywords: Regression, Triaged, UserExperience
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-07-27 11:28:25 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:

Description sthirugn@redhat.com 2016-04-27 18:58:13 UTC
Description of problem:


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


How reproducible:


Steps to Reproduce:
1. Install Satellite 6.2 Snap 9.3
2. Sync some repos, create/publish content views
3. backup satellite:
   - cd /mnt/backup
   - katello-backup .
5. Remote satellite:
   - katello-remove
6. Reinstall satellite to perform restore:
   - yum -y install katello
7. # foreman-installer --scenario=katello
Installing             +++ /tmp/puppet-file20160427-20128-1admhrkg/Exec[2016-04 [99%] [......................................................... /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: Failed to call refresh: /usr/sbin/foreman-rake db:seed returned 1 instead of one of [0]
 /Stage[main]/Foreman::Database/Foreman::Rake[db:seed]/Exec[foreman-rake-db:seed]: /usr/sbin/foreman-rake db:seed returned 1 instead of one of [0]
 Proxy ibm-x3550m3-10.lab.eng.brq.redhat.com cannot be registered (422 Unprocessable Entity): Unable to communicate with the Capsule: ERF12-2530 [ProxyAPI::ProxyException]: Unable to detect features ([OpenSSL::SSL::SSLError]: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verif...) for Capsule https://ibm-x3550m3-10.lab.eng.brq.redhat.com:8443/features Please check the Capsule is configured and running on the host.
 /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[ibm-x3550m3-10.lab.eng.brq.redhat.com]/ensure: change from absent to present failed: Proxy ibm-x3550m3-10.lab.eng.brq.redhat.com cannot be registered (422 Unprocessable Entity): Unable to communicate with the Capsule: ERF12-2530 [ProxyAPI::ProxyException]: Unable to detect features ([OpenSSL::SSL::SSLError]: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verif...) for Capsule https://ibm-x3550m3-10.lab.eng.brq.redhat.com:8443/features Please check the Capsule is configured and running on the host.
 /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[ibm-x3550m3-10.lab.eng.brq.redhat.com]: Failed to call refresh: Proxy ibm-x3550m3-10.lab.eng.brq.redhat.com cannot be registered (ApipieBindings::MissingArgumentsError: id): N/A
 /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[ibm-x3550m3-10.lab.eng.brq.redhat.com]: Proxy ibm-x3550m3-10.lab.eng.brq.redhat.com cannot be registered (ApipieBindings::MissingArgumentsError: id): N/A
Installing             Done                                               [100%] [....................................................................]
  Something went wrong! Check the log for ERROR-level output
  The full log is at /var/log/foreman-installer/katello.log


Actual results:
Installation failed

Expected results:
Installation should pass so I can run restore from backup

Additional info:

Comment 1 sthirugn@redhat.com 2016-04-27 18:59:23 UTC
Description of problem:
Reinstalling satellite after katello-remove failed

Version-Release number of selected component (if applicable):
Sat-6.2.beta-snap-9.3

How reproducible:
Always

Comment 6 Chris Roberts 2016-05-07 20:43:22 UTC
[root@dhcp-10-12-211-50 amqp]# cd /etc/gutterball/
[root@dhcp-10-12-211-50 gutterball]# ls
certs  gutterball.conf
[root@dhcp-10-12-211-50 gutterball]# ll -R
.:
total 4
drwxr-xr-x. 3 root   root    17 May  7 16:40 certs
-rw-r-----. 1 tomcat tomcat 575 Oct 30  2015 gutterball.conf

./certs:
total 0
drwxr-x---. 2 tomcat tomcat 6 Oct 30  2015 amqp

./certs/amqp:
total 0

Clean /etc/gutterball directory after my upstream remove script and a reinstall of katello (# yum install katello) Will test install now with katello-installer.

Comment 7 Chris Roberts 2016-05-07 20:54:02 UTC
[ERROR 2016-05-07 16:46:21 main]  /Stage[main]/Certs::Gutterball/Certs::Ssltools::Keytool::Import_keypair[import client certificate into gutterball keystore]/Certs::Ssltools::Keytool::Convert_pkcs12_to_jks[[import client certificate into gutterball keystore] convert tmp pkcs12 keystore to jks]/Exec[[import client certificate into gutterball keystore] convert tmp pkcs12 keystore to jks]: Failed to call refresh: keytool -importkeystore -destkeystore /etc/gutterball/certs/amqp//gutterball.jks -srckeystore /tmp/gutterballkeystore.p12 -srcstoretype pkcs12 -alias gutterball -storepass DSAkmyGZuSsS8dnthivTVWCuMeY2rxxe -srcstorepass DSAkmyGZuSsS8dnthivTVWCuMeY2rxxe -noprompt returned 1 instead of one of [0]
[ERROR 2016-05-07 16:46:21 main]  /Stage[main]/Certs::Gutterball/Certs::Ssltools::Keytool::Import_keypair[import client certificate into gutterball keystore]/Certs::Ssltools::Keytool::Convert_pkcs12_to_jks[[import client certificate into gutterball keystore] convert tmp pkcs12 keystore to jks]/Exec[[import client certificate into gutterball keystore] convert tmp pkcs12 keystore to jks]: keytool -importkeystore -destkeystore /etc/gutterball/certs/amqp//gutterball.jks -srckeystore /tmp/gutterballkeystore.p12 -srcstoretype pkcs12 -alias gutterball -storepass DSAkmyGZuSsS8dnthivTVWCuMeY2rxxe -srcstorepass DSAkmyGZuSsS8dnthivTVWCuMeY2rxxe -noprompt returned 1 instead of one of [0]
[root@dhcp-10-12-211-50 gutterball]# keytool -importkeystore -destkeystore /etc/gutterball/certs/amqp//gutterball.jks -srckeystore /tmp/gutterballkeystore.p12 -srcstoretype pkcs12 -alias gutterball -storepass DSAkmyGZuSsS8dnthivTVWCuMeY2rxxe -srcstorepass DSAkmyGZuSsS8dnthivTVWCuMeY2rxxe -noprompt
keytool error: java.lang.Exception: Keystore file exists, but is empty: /etc/gutterball/certs/amqp//gutterball.jks

Comment 11 Chris Roberts 2016-05-13 17:19:47 UTC
fixed katello-remove to allow 6.2 to be reinstalled

[ INFO 2016-05-13 13:01:06 verbose]  Class[Foreman_proxy::Register]: Scheduling refresh of Foreman_smartproxy[sat62.toledo.satellite.lab.eng.rdu2.redhat.com]
[ WARN 2016-05-13 13:01:44 verbose]  /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[sat62.toledo.satellite.lab.eng.rdu2.redhat.com]/ensure: created
[ WARN 2016-05-13 13:01:44 verbose]  /Stage[main]/Foreman_proxy::Register/Foreman_smartproxy[sat62.toledo.satellite.lab.eng.rdu2.redhat.com]: Triggered 'refresh' from 1 events
[ WARN 2016-05-13 13:01:45 verbose]  Finished catalog run in 819.79 seconds
[ INFO 2016-05-13 13:01:50 verbose] Puppet has finished, bye!
[ INFO 2016-05-13 13:01:50 verbose] Executing hooks in group post
  Success!
  * Katello is running at https://sat62.toledo.satellite.lab.eng.rdu2.redhat.com
      Initial credentials are admin / A5vnqsoEFowKzrAo
  * To install additional capsule on separate machine continue by running:

      capsule-certs-generate --capsule-fqdn "$CAPSULE" --certs-tar "~/$CAPSULE-certs.tar"

  The full log is at /var/log/foreman-installer/katello.log
[ INFO 2016-05-13 13:01:50 verbose] All hooks in group post finished


Bash history:

5  yum install satellite -y
8  vi /usr/bin/katello-remove 
9  katello-remove
12 yum install satellite -y 
54  foreman-installer --scenario katello -v

Comment 12 Chris Roberts 2016-05-16 16:41:40 UTC
Did smoketests on RHEL 6 and 7 with 6.2 and tested upstream as well and it reinstalls correctly. Going to submit PR this week.

- Chris

Comment 13 Chris Duryee 2016-07-08 18:48:44 UTC
verified on snap 19.1.

steps:

* install 19.1, create a product, sync a yum repo, publish a CV
* katello-backup /mnt/backup
* katello-remove, no errors
* ensure system has repos enabled to install sat again
* yum install -y satellite
* satellite-installer --scenario satellite
* katello-restore /mnt/backup

result: hit an unrelated error but opened a new BZ. this BZ verified OK.

opened new bz https://bugzilla.redhat.com/show_bug.cgi?id=1354028 for katello-restore issue.

Comment 14 Bryan Kearney 2016-07-27 11:28:25 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:1501