Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 639320

Summary: Entitlement Certificate with serial number 57,867,160,117,995 could not be found.
Product: Red Hat Enterprise Linux 6 Reporter: John Sefler <jsefler>
Component: subscription-managerAssignee: Bryan Kearney <bkearney>
Status: CLOSED ERRATA QA Contact: John Sefler <jsefler>
Severity: medium Docs Contact:
Priority: low    
Version: 6.1CC: bkearney, shaines
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-05-19 13:42:34 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 568421    

Description John Sefler 2010-10-01 12:54:20 UTC
Description of problem:
When trying to unsubscribe from a serial number that does not exist, the error message reformats the serial number with commas.  In my opinion this is not necessary and looks wrong since the string I asked to unsubscribe with is not what is being echoed in the error message:

# subscription-manager-cli unsubscribe --serial=57867160117995
Entitlement Certificate with serial number 57,867,160,117,995 could not be found.

Expected results:
Entitlement Certificate with serial number 57867160117995 could not be found.


Because of this formatting, the following will throw an error where as it wouldn't if no formatter was used:
[root@jsefler-rhel6-client01 ~]# subscription-manager-cli unsubscribe --serial=TRY_THIS
Runtime Error null at java.lang.NumberFormatException.forInputString:65



Version-Release number of selected component (if applicable):
# rpm -q subscription-manager
subscription-manager-0.83-1.git.26.31d0d84.fc12.i386

Comment 1 Ajay Kumar Nadathur Sreenivasan 2010-10-04 17:42:00 UTC
Fix in
  sha: 3e49f9daf3020b1d721c1e83421930855f9953c3 [rhsm]
  sha: 2b5bc5260836b4f602bf8efc95d12c60a0fdb1b5 [candlepin]

In case of subscription manager, no check was done to determine whether the input was a number. On the server side, functionality has been changed to return http code: 400(badly formed request).

Examples:
1) Unsubscribe with a non-existing serial number.
[ajay@garuda-rh src{master}]$ sudo ./subscription-manager-cli unsubscribe --serial=123812982392934324
Entitlement Certificate with serial number 123,812,982,392,934,324 could not be found.

2) Unsubscribe with a very very long serial number
[ajay@garuda-rh src{master}]$ sudo ./subscription-manager-cli unsubscribe --serial=1238129823929343242934823974923747239497942
1238129823929343242934823974923747239497942 is not a valid value for serial

3) Unsubscribe with a Nan
[ajay@garuda-rh src{master}]$ sudo ./subscription-manager-cli unsubscribe --serial=NOT_A_NUMBER
'NOT_A_NUMBER' is not a valid serial number

Comment 2 Jeff Weiss 2010-10-06 15:02:50 UTC
Ajay, I think you misread the original description.  The problem is the commas should not be there.  The error handling is improved but the problem John described has not been fixed:


[root@jweiss-rhel6-1 src]# ./subscription-manager-cli unsubscribe --serial=123812982392934324
Entitlement Certificate with serial number 123,812,982,392,934,324 could not be found.

commit 243c44544ccb2ecdaf8963500b36ce81a5aa5dd6

Comment 3 Ajay Kumar Nadathur Sreenivasan 2010-10-07 16:00:07 UTC
Fix in sha: 2d7bb319c7278468040253700c4c2fb5cf5da181

[ajay@garuda-rh src{master}]$ sudo ./subscription-manager-cli unsubscribe --serial=123432423423423
Entitlement Certificate with serial number 123432423423423 could not be found

Comment 4 John Sefler 2010-10-07 18:46:53 UTC
VERIFIED...

# rpm -q subscription-manager
subscription-manager-0.89-1.git.2.f5b5a45.fc12.i386


# subscription-manager-cli unsubscribe --serial FOOBAR
'FOOBAR' is not a valid serial number

# subscription-manager-cli unsubscribe --serial 1234567890
Entitlement Certificate with serial number 1234567890 could not be found.

# subscription-manager-cli unsubscribe --serial 11111111111111111111111111111111111111111111111111111111110
11111111111111111111111111111111111111111111111111111111110 is not a valid value for serial

# subscription-manager-cli unsubscribe --serial 11
Entitlement Certificate with serial number 11 could not be found.

# subscription-manager-cli unsubscribe --serial 1111111111
Entitlement Certificate with serial number 1111111111 could not be found.

# subscription-manager-cli unsubscribe --serial x
'x' is not a valid serial number

# subscription-manager-cli unsubscribe --serial
Usage: subscription-manager-cli unsubscribe [OPTIONS]

subscription-manager-cli: error: --serial option requires an argument

Comment 6 errata-xmlrpc 2011-05-19 13:42:34 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2011-0611.html