Bug 1495847

Summary: capsule-certs-generate throws NoMethodError post migration to 6.3
Product: Red Hat Satellite Reporter: Jitendra Yejare <jyejare>
Component: InstallationAssignee: Martin Bacovsky <mbacovsk>
Status: CLOSED ERRATA QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: high    
Version: 6.3.0CC: bbuckingham, ehelms, inecas, mbacovsk
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 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 Jitendra Yejare 2017-09-26 12:29:06 UTC
Description of problem:
After upgrading satellite 6.2 to 6.3, generating capsule cert using 'capsule-certs-generate' is broken.
It throws NoMethodError:
------------------------------------------------------------
# capsule-certs-generate -v --foreman-proxy-fqdn <capsule_fqdn> --certs-tar <capsule_fqdn>_certs.tar

/usr/sbin/capsule-certs-generate:87:in `ensure in <main>': undefined method `cleanup' for nil:NilClass (NoMethodError)
	from /usr/sbin/capsule-certs-generate:87:in `<main>'
------------------------------------------------------------

Version-Release number of selected component (if applicable):
Satellite 6.3 snap 17

How reproducible:
Always

Steps to Reproduce:
1. Satellite and Capsule on 6.2
2. Upgrade Satellite
3. To upgrade capsule, generate latest capsule cert tar on upgrade satellite

Actual results:
capsule-certs-generate fails with NoMethodError:

------------------------------------------------------------
# capsule-certs-generate -v --foreman-proxy-fqdn <capsule_fqdn> --certs-tar <capsule_fqdn>_certs.tar

/usr/sbin/capsule-certs-generate:87:in `ensure in <main>': undefined method `cleanup' for nil:NilClass (NoMethodError)
	from /usr/sbin/capsule-certs-generate:87:in `<main>'
------------------------------------------------------------

Expected results:
capsule-certs-generate should be migrated properly, should be functional and shouldn't throw any incorrect errors.

Comment 2 Martin Bacovsky 2017-09-27 14:27:34 UTC
To reproduce it is necessary the 'initial_organization:' to be blank in the answers file before running capsule-certs-generate.

Comment 3 Martin Bacovsky 2017-09-27 14:28:17 UTC
Created redmine issue http://projects.theforeman.org/issues/21138 from this bug

Comment 4 Satellite Program 2017-09-27 16:08:29 UTC
Upstream bug assigned to mbacovsk

Comment 5 Satellite Program 2017-09-27 16:08:33 UTC
Upstream bug assigned to mbacovsk

Comment 6 Satellite Program 2017-09-27 22:08:25 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/21138 has been resolved.

Comment 7 Jitendra Yejare 2017-10-04 10:04:38 UTC
Verified!

Satellite 6.3 snap 18.0


Capsule_certs_generate is now creating certs tar without NoMethodError.

But there is another bug we found which is not related to this bug is that capsule cert generate throws below error after generating cert file:

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
[ERROR 2017-10-03 17:21:39 verbose] rpm -q puppet-agent failed! Check the output for error!
[ERROR 2017-10-03 17:21:39 verbose] rpm -q puppetserver failed! Check the output for error!
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

A separate issue has been filed to handle this issue:
https://bugzilla.redhat.com/show_bug.cgi?id=1498412

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

Comment 9 Bryan Kearney 2018-02-21 17:33:08 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