Description of problem: The command `# rhn-satellite-activate --manifest-info` should show currently activated manifest however it gets updated with the manifest of a failed activation. ~~~ --manifest-info show information about currently activated manifest ~~~ Version-Release number of selected component (if applicable): [root@ktordeur-sat58 home]# rpm -qa | grep satellite ~~~ satellite-schema-5.8.0.31-1.el6sat.noarch satellite-branding-5.8.0.8-1.el6sat.noarch satellite-repo-5.8.0.2-2.el6sat.noarch satellite-doc-indexes-5.8.0-1.el6sat.noarch ~~~ How reproducible: 100% Steps to Reproduce: 1) Current manifest: [root@ktordeur-sat57 home]# rhn-satellite-activate --manifest-info ~~~ Name: ktordeur-satellite58 UUID: 58576be4-01a7-43f1-b015-3dc28baf406e Owner ID: xxxxxx Satellite version: 5.8 Created: 2017-07-26T08:06:53.255+0000 API URL: https://subscription.rhn.redhat.com/subscription/consumers/ ~~~ 2) Try to activate a new manifest (but it fails) [root@ktordeur-sat57 home]# rhn-satellite-activate --manifest=manifest.zip ~~~ Certificate specifies 14 of rhel-server-6 non-flex entitlements. There are 20 non-flex entitlements allocated to non-base org(s) (0 used). You might need to deallocate some entitlements from non-base organization(s). You need to free 6 entitlements to match the new certificate. Certificate specifies 14 of rhel-server-7 non-flex entitlements. There are 20 non-flex entitlements allocated to non-base org(s) (0 used). You might need to deallocate some entitlements from non-base organization(s). You need to free 6 entitlements to match the new certificate. Activation failed, will now exit with no changes. ~~~ 3) --manifest-info gets updated with failed manifest information: [root@ktordeur-sat57 home]# rhn-satellite-activate --manifest-info ~~~ Name: satellite01.example.com UUID: 58576be4-01a7-43f1-b015-3dc28baf7452e Owner ID: xxxxxx Satellite version: 5.8 Created: 2017-07-20T12:02:37.995+0000 API URL: https://subscription.rhn.redhat.com/subscription/consumers/ ~~~ Actual results: [root@ktordeur-sat57 home]# rhn-satellite-activate --manifest-info ~~~ Name: satellite01.example.com UUID: 58576be4-01a7-43f1-b015-3dc28baf7452e Owner ID: xxxxxx Satellite version: 5.8 Created: 2017-07-20T12:02:37.995+0000 API URL: https://subscription.rhn.redhat.com/subscription/consumers/ ~~~ Expected results: [root@ktordeur-sat57 home]# rhn-satellite-activate --manifest-info ~~~ Name: ktordeur-satellite58 UUID: 58576be4-01a7-43f1-b015-3dc28baf406e Owner ID: xxxxxx Satellite version: 5.8 Created: 2017-07-26T08:06:53.255+0000 API URL: https://subscription.rhn.redhat.com/subscription/consumers/ ~~~ Additional info:
This is result of how rhn-satellite-activate works. First, it copies manifest to default location, then it tries to activate it, it doesn't care about result of activation. --manifest-info only reads last attempted manifest from default location. It worked same way for certificates in Sat < 5.8, however there wasn't such info feature so it wasn't noticeable. It could be improved by rewriting rhn-satellite-activate to store it here after activation succeeds or by storing manifest in DB table etc.
@Jan according to man page it should be the currently activated manifest which can be misleading in that case. [root@ktordeur-sat58 ~]# rhn-satellite-activate --help | grep manifest-info --manifest-info show information about currently activated manifest
This is true. I'll try to investigate how to fix it.
fixed in spacewalk.git(master): 55e2af89e54ae3a0363f4f86230885ac8d18afc1
Verified with spacewalk-backend-2.5.3-157. Used reproducer from OP. After failing to activate with different manifest, the original manifest info is still shown.
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-2017:3445