Hide Forgot
Description of problem: Need clearer error message when register with system name exceeding max characters. Version-Release number of selected component (if applicable): subscription-manager: 1.17.10-1.el7 python-rhsm: 1.17.6-1.el7 How reproducible: always Steps to Reproduce: 1. Install RHEL-7.3-20160825.1. 2. Try to register the system with 256 characters system name: [root@intel-wildcatpass-05 rhsm]# subscription-manager register --name=qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert1 --force The system with UUID bda5cf6f-e8ac-4f53-8d8b-e32a6263e9ba has been unregistered Registering to: subscription.rhsm.stage.redhat.com:443/subscription Username: new_test Password: Problem creating unit Consumer<id=8a99f98656cb95fd0156d4db095b0a45, uuid=13439ca9-7041-4231-a27f-a3e6ce805535, type=system, name=qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert1> [root@intel-wildcatpass-05 rhsm]# echo $? 70 3. Try to register the system with 255 characters system name: [root@intel-wildcatpass-05 rhsm]# subscription-manager register --name=qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert12345qwert --force Registering to: subscription.rhsm.stage.redhat.com:443/subscription Username: new_test Password: The system has been registered with ID: 22ecdec6-ade1-4258-91d1-37d1d498a941 Actual results: As step 2, message is not reported clearly why this error happens. Expected results: A clear error message is needed to note the max system name should not exceed 255 characters. Such as: 'Name of the consumer should be shorter than 256 characters.' Or 'Validation failed: Name is too long (maximum is 255 characters)' Additional info: The attachment is rhsm.log
Created attachment 1195187 [details] rhsm.log
Candlepin should be validating the length of the consumer name before attempting to create the consumer.
This issue still exists when test RHEL-6.9-20161201.0 against stage,so reopen this issue
Now should be fixed.
(In reply to Wei Liu from comment #4) > This issue still exists when test RHEL-6.9-20161201.0 against stage,so > reopen this issue The fix for this bug was implemented in Candlepin version > candlepin-2.0.21-1 It was not a subscription-manager fix and is independent of a RHEL compose. The reason why you still observe the failure against stage is because it is currently running older version candlepin-0.9.51.20-1. Here is a verification of the fix against the current master candlepin using the current sub-man build for RHEL69... [root@jsefler-rhel6 ~]# subscription-manager version server type: This system is currently not registered. subscription management server: 2.0.21-1 subscription management rules: 5.20 subscription-manager: 1.18.6-1.el6 python-rhsm: 1.18.6-1.el6 [root@jsefler-rhel6 ~]# [root@jsefler-rhel6 ~]# subscription-manager register --username=testuser1 --password=password --org=admin --name="256_characters_6789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456" Registering to: jsefler-candlepin.usersys.redhat.com:8443/candlepin Name of the consumer should be shorter than 255 characters. [root@jsefler-rhel6 ~]# [root@jsefler-rhel6 ~]# subscription-manager register --username=testuser1 --password=password --org=admin --name="255_characters_678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345" Registering to: jsefler-candlepin.usersys.redhat.com:8443/candlepin The system has been registered with ID: a72437b9-6813-4bc1-910f-f1676716768f [root@jsefler-rhel6 ~]# FailedQA - the error message is not yet accurate. Change 255 to 256.
In addition to John's #Comment 6. Patch was applied to candlepin-0.23, candlepin-0.9.51, candlepin-0.9.54 and master branch. Typo was already corrected in mentioned branches and waiting for PR review.