Description of problem: cdn-sync does not tell you when the Satellite is not activated while cdn-sync -l does Version-Release number of selected component (if applicable): Satellite 5.8 Beta How reproducible: 100% Steps to Reproduce: 1. Try cdn-sync without activation 2. 3. Actual results: [root@ktordeur-sat57 satellite]# cdn-sync ERROR: these channels either do not exist or are not available: rhel-x86_64-server-6 rhel-x86_64-server-7 rhel-x86_64-as-4 rhel-x86_64-as-4-cluster redhat-rhn-proxy-5.6-server-x86_64-6 redhat-rhn-satellite-5.6-server-x86_64-6 rhel-x86_64-server-6-rhscl-1 rhel-x86_64-as-4-els rhel-x86_64-server-supplementary-6 rhel-x86_64-server-7-rhscl-1 rhn-tools-rhel-x86_64-server-6 rhn-tools-rhel-x86_64-server-7 rhel-x86_64-server-6-thirdparty-oracle-java rhel-x86_64-server-7-thirdparty-oracle-java rhel-x86_64-server-7.2.eus rhel-x86_64-server-extras-6 (to see a list of channel labels: /usr/bin/cdn-sync --list-channels) [root@ktordeur-sat57 satellite]# cdn-sync -l 16:03:27 No available channels were found. Is your Red Hat Satellite activated for CDN? Expected results: 16:03:27 No available channels were found. Is your Red Hat Satellite activated for CDN? Additional info:
I think the behaviour is now different after bz1427238 fixes but we should make sure it's correct.
I installed a fresh spacewalk system from nightly repos, did not activate it, and now the behavior is different than before (as mentioned in comment #2). The cdn-sync commands mentioned in the description now have the following output: # cdn-sync -l 16:18:49 p = previously imported/synced channel 16:18:49 . = channel not yet imported/synced 16:18:49 ? = package count not available (try to run cdn-sync --count-packages) 16:18:49 Entitled base channels: 16:18:49 NONE 16:18:49 Entitled child channels: 16:18:49 NONE 16:18:49 Custom channels syncing from CDN: 16:18:49 NONE # cdn-sync 16:19:01 Total time: 0:00:00 With this new behavior, can this BZ be closed? Or should there be an indication that the system is not activated yet?
Follow up to comment #3... I put spacewalk in disconnected mode and get the output below. I think I need to deactivate my spacewalk server and try this again. # cdn-sync ERROR: the Satellite server is installed in disconnected mode, cannot continue syncing from CDN # cdn-sync -l ERROR: the Satellite server is installed in disconnected mode, cannot continue syncing from CDN
It would be nice to have an indication that the satellite is not yet activated.
I have re-tested this on a Satellite system (not spacewalk) and here is the behavior after cdn-sync'ing a channel, and then running `rhn-satellite-activate --cdn-deactivate`: # cdn-sync 14:20:45 ERROR: Channel 'rhel-x86_64-client-6' repositories are not available. 14:20:45 ERROR: these channels either do not exist or are not available: rhel-x86_64-client-6 14:20:45 Total time: 0:00:00 ERROR: these channels either do not exist or are not available: rhel-x86_64-client-6 # cdn-sync -l 13:58:58 p = previously imported/synced channel 13:58:58 . = channel not yet imported/synced 13:58:58 ? = package count not available (try to run cdn-sync --count-packages) 13:58:58 Entitled base channels: 13:58:58 NONE 13:58:58 Entitled child channels: 13:58:58 NONE 13:58:58 Custom channels syncing from CDN: 13:58:58 NONE
Yes, it seems it was my intentional change when I was adding support for syncing into custom channels, I don't remember why though. However, if I run it in verbose, I see following: # cdn-sync -lv ... 16:17:24 WARNING: No available channels from channel mappings were found. Is cdn-sync-mappings package installed and your Spacewalk activated? 16:17:24 p = previously imported/synced channel 16:17:24 . = channel not yet imported/synced 16:17:24 ? = package count not available (try to run cdn-sync --count-packages) 16:17:24 Entitled base channels: 16:17:24 NONE 16:17:24 Entitled child channels: 16:17:24 NONE 16:17:24 Custom channels syncing from CDN: 16:17:24 NONE Maybe we can change it back to print just a error message if it's not activated regardless if mappings package is installed or not (because it works on Spacewalk like that). Or we can keep the output like this, only display the WARNING on default verbosity setting. And we should improve the "cdn-sync" output, now it looks like below. It's same as in comment #0 but it's printed twice because of one of other bugzilla which prints not available channels on start and on end, which is the behavior I don't like when there isn't anything in between. # cdn-sync 16:23:14 ERROR: Channel 'rhel-x86_64-server-5' repositories are not available. 16:23:14 ERROR: Channel 'rhel-x86_64-server-6' repositories are not available. 16:23:14 ERROR: Channel 'rhel-x86_64-server-7' repositories are not available. 16:23:14 ERROR: Channel 'rhn-tools-rhel-x86_64-server-5' repositories are not available. 16:23:14 ERROR: Channel 'rhn-tools-rhel-x86_64-server-7' repositories are not available. 16:23:14 ERROR: Channel 'rhel-s390x-server-5' repositories are not available. 16:23:14 ERROR: Channel 'rhn-tools-rhel-x86_64-server-6' repositories are not available. 16:23:14 ERROR: Channel 'redhat-rhn-proxy-5.7-server-x86_64-6' repositories are not available. 16:23:14 ERROR: Channel 'rhn-tools-rhel-s390x-server-5' repositories are not available. 16:23:14 ERROR: Channel 'rhel-x86_64-workstation-7' repositories are not available. 16:23:14 ERROR: Channel 'rhel-ppc64le-server-sap-7' repositories are not available. 16:23:14 ERROR: Channel 'rhn-tools-rhel-s390x-server-6' repositories are not available. 16:23:14 ERROR: Channel 'rhel-x86_64-ost-10-tools-workstation-debuginfo' repositories are not available. 16:23:14 ERROR: Channel 'rhel-x86_64-server-extras-7' repositories are not available. 16:23:14 ERROR: Channel 'rhel-ppc64le-server-7' repositories are not available. 16:23:14 ERROR: Channel 'rhel-s390x-server-6' repositories are not available. 16:23:14 ERROR: these channels either do not exist or are not available: rhel-x86_64-server-5 rhel-x86_64-server-6 rhel-x86_64-server-7 rhn-tools-rhel-x86_64-server-5 rhn-tools-rhel-x86_64-server-7 rhel-s390x-server-5 rhn-tools-rhel-x86_64-server-6 redhat-rhn-proxy-5.7-server-x86_64-6 rhn-tools-rhel-s390x-server-5 rhel-x86_64-workstation-7 rhel-ppc64le-server-sap-7 rhn-tools-rhel-s390x-server-6 rhel-x86_64-ost-10-tools-workstation-debuginfo rhel-x86_64-server-extras-7 rhel-ppc64le-server-7 rhel-s390x-server-6 16:23:14 Total time: 0:00:00 ERROR: these channels either do not exist or are not available: rhel-x86_64-server-5 rhel-x86_64-server-6 rhel-x86_64-server-7 rhn-tools-rhel-x86_64-server-5 rhn-tools-rhel-x86_64-server-7 rhel-s390x-server-5 rhn-tools-rhel-x86_64-server-6 redhat-rhn-proxy-5.7-server-x86_64-6 rhn-tools-rhel-s390x-server-5 rhel-x86_64-workstation-7 rhel-ppc64le-server-sap-7 rhn-tools-rhel-s390x-server-6 rhel-x86_64-ost-10-tools-workstation-debuginfo rhel-x86_64-server-extras-7 rhel-ppc64le-server-7 rhel-s390x-server-6
I will update the cdn-sync command (with no args) output. This "extra" messaging will be displayed when any previously sync'd channels are not available to be sync'd, as well as there are no available channels to be sync'd. In that specific case, the added messaging will be: Perhaps your Red Hat Satellite is not activated for CDN. (to see details about currently used SSL certificates for accessing CDN: /usr/bin/cdn-sync --cdn-certs)
I will also working on getting rid of the duplicate output. It's coming from the logging in the CdnSync object.
spacewalk.github: e3cf201a40db3ed0eb8c43557fd51d386dc72a74 spacewalk-backend-2.7.74-1
additional commit for spacewalk. Below is all commits. spacewalk.github: e3cf201a40db3ed0eb8c43557fd51d386dc72a74 19f36074dc174f7370db9e41d485eecb4cad1459 spacewalk-backend-2.7.75-1
The second commit above changes slightly the messaging to more closely match existing messaging to the user. It now says: WARNING: Is your Red Hat Satellite activated for CDN? (to see details about currently used SSL certificates for accessing CDN: /usr/bin/cdn-sync --cdn-certs)
spacewalk.github: 16cca402518a83048c8d1caae4197e1b7e943ac7 spacewalk-backend-2.7.83-1 NOTE: this commit adds a fix for traceback caused by attempt to release lockfile twice as a result of calling system_exit() after lock is first released - sys.exit() raises SystemExit exception.
I deactivated Satellite by command: >> rhn-satellite-activate --deactivate 1) >> cdn-sync -l 07:04:21 p = previously imported/synced channel 07:04:21 . = channel not yet imported/synced 07:04:21 ? = package count not available (try to run cdn-sync --count-packages) 07:04:21 Entitled base channels: 07:04:21 NONE 07:04:21 Entitled child channels: 07:04:21 NONE 07:04:21 Custom channels syncing from CDN: 07:04:21 NONE >> echo $? 0 Is it good that exit code is 0? I think no. 2) >> cdn-sync -rv 07:05:20 ERROR: No SSL certificates were found for repository '/content/dist/rhel/server/5/5Server/x86_64/os' 07:05:20 ERROR: Channel 'rhel-x86_64-server-5' repositories are not available. 07:05:20 ERROR: No SSL certificates were found for repository '/content/dist/rhel/server/6/6Server/x86_64/os' 07:05:20 ERROR: Channel 'rhel-x86_64-server-6' repositories are not available. 07:05:20 ERROR: No SSL certificates were found for repository '/content/dist/rhel/server/7/7Server/x86_64/os' 07:05:20 ERROR: Channel 'rhel-x86_64-server-7' repositories are not available. 07:05:20 Total time: 0:00:00 ERROR: these channels either do not exist or are not available: rhel-x86_64-server-5 rhel-x86_64-server-6 rhel-x86_64-server-7 WARNING: Is your Red Hat Satellite activated for CDN? (to see details about currently used SSL certificates for accessing CDN: /usr/bin/cdn-sync --cdn-certs) >> echo $? 1 I suppose that it is good. But when I try to show cdn-certs: 3) >> cdn-sync --cdn-certs 07:06:52 No SSL certificates were found. Is your Red Hat Satellite activated for CDN? >> echo $? 0 It is not valid state and exit code should be different. Same situation is for option count-packages: >> dn-sync --count-packages 07:17:20 Number of channels: 0 07:17:20 Number of repositories: 0 07:17:20 Total time: 0:00:00 >> echo $? 0
These cases should now result in an appropriate warning message and an exit status of 1. NOTE: I also fixed a problem in one warning message where the message was not using PRODUCT_NAME.
spacewalk.github: 170a3c3a6fb7ab760302d9676125509904d6c550 fixed in spacewalk-backend-2.7.103-1
Verified with spacewalk-backend-cdn-2.5.3-137.el6sat.noarch >> cdn-sync --count-packages 17:12:15 ERROR: Your Red Hat Satellite is not activated for CDN (to see details about currently used SSL certificates for accessing CDN: /usr/bin/cdn-sync --cdn-certs) >> echo $? 1 >> cdn-sync -l 17:11:39 ERROR: Your Red Hat Satellite is not activated for CDN (to see details about currently used SSL certificates for accessing CDN: /usr/bin/cdn-sync --cdn-certs)