Description of problem: Trying to synchronize (internal) capsule, command: hammer capsule content synchronize --id 1 fails. Despite id 1 works fine for other "hammer capsule" subcommands: [root@pmoravec-rhel7-sat6 ~]# hammer -u admin -p <password> capsule list ---|-------------------------------------------|------------------------------------------------------- ID | NAME | URL ---|-------------------------------------------|------------------------------------------------------- 1 | pmoravec-rhel7-sat6.example.com | https://pmoravec-rhel7-sat6.example.com:9090 ---|-------------------------------------------|------------------------------------------------------- [root@pmoravec-rhel7-sat6 ~]# hammer -u admin -p <password> capsule info --id 1 Id: 1 Name: pmoravec-rhel7-sat6.example.com URL: https://pmoravec-rhel7-sat6.example.com:9090 Features: Puppet, Puppet CA, Pulp Created at: 2014/11/12 11:36:26 Updated at: 2014/11/12 11:36:26 [root@pmoravec-rhel7-sat6 ~]# Version-Release number of selected component (if applicable): Satellite 6.0.6 How reproducible: 100% Steps to Reproduce: 1. Even on freshly installed Sat6, check capsule with id 1 exists (and is the internal one, usually): hammer -u admin -p <password> capsule info --id 1 2. Try to sync this capsule: hammer -u admin -p <password> capsule content synchronize --id 1 Actual results: 2. fails with: Could not synchronize capsule content: Couldn't find SmartProxy with id=1 [WHERE "features"."name" IN ('Pulp Node')] Expected results: 2. to successfully sync the capsule. Additional info: If _internal_ capsule within Sat6 server can't be synchronized this way, then please update installation manual having explicit command: "# hammer capsule content synchronize --id 1 --environment-id 1" (just before Section 5.5)
Btw expected workaround in using --name instead of --id does _not_ work: # hammer -u admin -p <password> capsule content synchronize --name pmoravec-sat6.example.com Could not synchronize capsule content: Error: undefined method `[]' for nil:NilClass #
Since this issue was entered in Red Hat Bugzilla, the release flag has been set to ? to ensure that it is properly evaluated for this release.
Running hammer in debug mode, it apparently makes proper REST API method: [ INFO 2014-11-14 13:13:54 API] POST /katello/api/capsules/1/content/sync [DEBUG 2014-11-14 13:13:54 API] Params: {} [DEBUG 2014-11-14 13:13:54 API] Headers: {} [ERROR 2014-11-14 13:13:54 API] 404 Resource Not Found That corresponds to API guide, Section "12.5. Synchronize Content to Capsule".
After discussing with akrzos, this is "almost" expected behaviour. Capsule sync can be done only for _external_ capsules while id 1 has the internal one (that can by synced via "hammer repository synchronize" command). But the error when invoking: POST /katello/api/capsules/1/content/sync is confusing, as capsule with id 1 exists. Please provide some better error string in this case.
*** Bug 1296843 has been marked as a duplicate of this bug. ***
As mentioned in comment 5, performing a 'capsule content synchronize' is not supported for the 'default'/'internal' capsule that is part of the Satellite server. It looks like a better error is being displayed to the user with Satellite 6.2 Beta Snap 9: hammer> capsule content synchronize --id 1 Could not synchronize capsule content: This request may only be performed on a Capsule that has the Pulp Node feature. however, there is still an issue with the support for --name: hammer> capsule content synchronize --name sat-test-rhel7.example.com Could not synchronize capsule content: Error: undefined method `[]' for nil:NilClass For this BZ, I will address the second the above nil:NilClass error.
Upstream hammer-cli-katello PR: https://github.com/Katello/hammer-cli-katello/pull/389
Upstream bug component is Hammer
~]# hammer -u admin -p changeme capsule content synchronize --environment DEV --name abc.redhat.com --organization "Default Organization"Could not synchronize capsule content: This request may only be performed on a Capsule that has the Pulp Node feature. hammer -u admin -p changeme capsule content synchronize --id 1 Could not synchronize capsule content: This request may only be performed on a Capsule that has the Pulp Node feature. VERIFIED with sat62-snap12.1
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