Bug 1371009 - Need clearer error message when register with system name exceeding max characters.
Summary: Need clearer error message when register with system name exceeding max chara...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 0.9.23
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: ---
Assignee: pjonasti
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-08-29 07:15 UTC by qianzhan
Modified: 2017-02-07 17:42 UTC (History)
9 users (show)

Fixed In Version: candlepin-0.9.23.4-1, candlepin-2.0.22-1, candlepin-0.9.51.21-1, candlepin-0.9.54.19-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-30 09:22:25 UTC


Attachments (Terms of Use)
rhsm.log (24.71 KB, text/plain)
2016-08-29 07:16 UTC, qianzhan
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github /candlepin candlepin pull 1443 0 None None None 2017-01-11 18:17:17 UTC
Red Hat Bugzilla 1094492 0 unspecified CLOSED consumer cert does not appear to accept a consumer name greater than 251 chars 2021-02-22 00:41:40 UTC

Internal Links: 1094492

Description qianzhan 2016-08-29 07:15:26 UTC
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

Comment 1 qianzhan 2016-08-29 07:16:13 UTC
Created attachment 1195187 [details]
rhsm.log

Comment 3 Chris Snyder 2016-09-30 15:19:47 UTC
Candlepin should be validating the length of the consumer name before attempting to create the consumer.

Comment 4 Wei Liu 2016-12-02 07:25:11 UTC
This issue still exists when test RHEL-6.9-20161201.0 against stage,so reopen this issue

Comment 5 pjonasti 2016-12-09 18:17:53 UTC
Now should be fixed.

Comment 6 John Sefler 2017-01-11 15:00:50 UTC
(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.

Comment 7 pjonasti 2017-01-11 18:17:17 UTC
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.


Note You need to log in before you can comment on or make changes to this bug.