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 744536 - [ALL LANG] [RHSM CLI] unsubscribe module _unexpected 'ascii' code can't decode ...message.
Summary: [ALL LANG] [RHSM CLI] unsubscribe module _unexpected 'ascii' code can't decod...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager
Version: 6.2
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Adrian Likins
QA Contact: IDM QE LIST
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel62
TreeView+ depends on / blocked
 
Reported: 2011-10-09 09:49 UTC by Lijun Li
Modified: 2013-01-10 10:56 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-06 17:25:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
RHSM CLI_unsubscribe module _unexpected 'ascii' code can't decode ...message (59.52 KB, image/png)
2011-10-09 09:49 UTC, Lijun Li
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1695 0 normal SHIPPED_LIVE subscription-manager bug fix and enhancement update 2011-12-06 01:23:29 UTC

Description Lijun Li 2011-10-09 09:49:48 UTC
Created attachment 527083 [details]
RHSM CLI_unsubscribe module _unexpected 'ascii' code can't decode ...message

Description of problem:
RHSM CLI_unsubscribe module _unexpected 'ascii' code can't decode ...message.

Version-Release number of selected component (if applicable):
subscription-manager-0.96.12-1.el6


How reproducible:
100%

Steps to Reproduce:
1.Subscribe a subscription on the registered system.
2.Run subscription-manager list --installed to get the SerialNumber

[root@localhost testqa]# subscription-manager list --consumed
+-------------------------------------------+
消耗的产品订阅
+-------------------------------------------+


ProductName: Red Hat Enterprise Linux Server
ContractNumber: 2394344
AccountNumber: 1465502
SerialNumber: 3737521615858811162
Active: True
QuantityUsed: 1
Begins: 2011年06月09日
Expires: 2012年06月09日 

3.Run $ sudo subscription-manager unsubscribe --serial=SerialNumber

4.Run $ sudo subscription-manager unsubscribe --serial=SerialNumber
(Input an incorrect SerialNumber, such as test 
$ sudo subscription-manager unsubscribe --serial=test
)


  
Actual results:
Unexpected 'ascii' code can't decode ...message.

Expected results:
It's better to have a warning message to tell user that the serial number is incorrect than that unfriendly 'ascii' code... message.


Additional info:

Comment 4 Adrian Likins 2011-10-13 13:45:59 UTC
commit b7d1881e0b8b4c33b2cea79b4d762eebc6ef816e
Author: Adrian Likins <alikins>
Date:   Tue Oct 11 18:49:47 2011 -0400

    744536: handle unicode and plain str types passed to systemExit
    
    Error coming from rhsm.connection are unicode type strings, and
    error elsewhere are just strings, and systemExit couldn't handle
    both. This converts them all to unicode before we encode out
    to UTF-8
    
    Fix an issue with handle_exception passing an exception
    directly to systemExit

Comment 6 John Sefler 2011-10-21 21:47:07 UTC
I can recreate this bug as follows...
[root@jsefler-onprem-62server tmp]# rpm -q subscription-manager
subscription-manager-0.96.12-1.el6.x86_64
[root@jsefler-onprem-62server tmp]# subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' is not a valid serial number
[root@jsefler-onprem-62server tmp]# LANG=zh_CN.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'ascii' codec can't decode byte 0xe4 in position 15: ordinal not in range(128)


With Adrian's fix in place....
[root@dell-pe830-01 ~]# rpm -q subscription-manager
subscription-manager-0.96.16-1.el6.x86_64
[root@dell-pe830-01 ~]# subscription-manager unsubscribe --serial=SerialNumber'SerialNumber' is not a valid serial number
[root@dell-pe830-01 ~]# LANG=zh_CN.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' 不是一个有效的序列号


bug is VERIFIED

Comment 7 John Sefler 2011-10-24 15:21:35 UTC
I am NOT moving this bug to VERIFIED yet.  Instead I am moving this bug back to ASSIGNED because I suspect that the fix in comment 4 has caused regression bug 746264 and bug 747024.

Comment 8 John Sefler 2011-10-30 03:23:43 UTC
The following branch commits by alikins are in response to comment 7...

RHEL6.2 branch commit ed5f1172f33db33e97cbc5a6d3fe10ee97039557 by Adrian Likins
master branch commit bc4d620ae1a475a15cd89dcbc20742e2d45a9d79 by Adrian Likins

747024: restore previous behaviour for unhandled exceptions

As part of the change to handle unicode strings in error
messages, handle exception was changed to just pass
in handle_exceptions passed in msg. This changed behaviour
for some error cases, so return that, but ignore msgs
passed to systemExit that do not have string reprs.

Comment 9 John Sefler 2011-10-30 03:37:10 UTC
Re-verifying with additional fix from alikins in comment 8 applied...

[root@jsefler-onprem-62server ~]# rpm -q subscription-manager
subscription-manager-0.96.17-1.el6.x86_64


[root@jsefler-onprem-62server ~]# for l in en_US de_DE es_ES fr_FR it_IT ja_JP ko_KR pt_BR ru_RU zh_CN zh_TW as_IN bn_IN hi_IN mr_IN gu_IN kn_IN ml_IN or_IN pa_IN ta_IN te_IN; do echo ""; echo ""; echo "# LANG=$l.UTF8 subscription-manager unsubscribe --serial=SerialNumber"; LANG=$l.UTF8 subscription-manager unsubscribe --serial=SerialNumber; done;


# LANG=en_US.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' is not a valid serial number


# LANG=de_DE.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' ist keine gültige Seriennummer


# LANG=es_ES.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' no es un número de serie válido


# LANG=fr_FR.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' n'est pas un numéro de série valide


# LANG=it_IT.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' non è un numero seriale valido


# LANG=ja_JP.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' は有効なシリアル番号ではありません


# LANG=ko_KR.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber'은(는) 유효한 일련 번호가 아닙니다 


# LANG=pt_BR.UTF8 subscription-manager unsubscribe --serial=SerialNumber
O 'SerialNumber' não é um número serial válido


# LANG=ru_RU.UTF8 subscription-manager unsubscribe --serial=SerialNumber
Недопустимый серийный номер: «SerialNumber»


# LANG=zh_CN.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' 不是一个有效的序列号


# LANG=zh_TW.UTF8 subscription-manager unsubscribe --serial=SerialNumber
「SerialNumber」不是正確的序號


# LANG=as_IN.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' এটা বৈধ ক্ৰমিক নম্বৰ নহয়


# LANG=bn_IN.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' ক্রমিক সংখ্যাটি বৈধ নয়


# LANG=hi_IN.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' एक वैध क्रम संख्या नहीं है


# LANG=mr_IN.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' वैध सिरिअल क्रमांक नाही


# LANG=gu_IN.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' એ માન્ય શ્રેણી નંબર નથી


# LANG=kn_IN.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' ಎನ್ನುವುದು ಒಂದು ಮಾನ್ಯವಾದ ಅನುಕ್ರಮ ಸಂಖ್ಯೆಯಾಗಿಲ್ಲ


# LANG=ml_IN.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' ശരിയായൊരു സീരിയല്‍ നംബര്‍ അല്ല


# LANG=or_IN.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' ଟି ଗୋଟିଏ ବୈଧ କ୍ରମ ସଂଖ୍ୟା ନୁହଁ


# LANG=pa_IN.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' ਇੱਕ ਯੋਗ ਸੀਰੀਅਲ ਨੰਬਰ ਨਹੀਂ ਹੈ


# LANG=ta_IN.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' ஒரு சரியான வரிசை எண் இல்லை


# LANG=te_IN.UTF8 subscription-manager unsubscribe --serial=SerialNumber
'SerialNumber' చెల్లునటువంటి వరుస సంఖ్య కాదు


Moving to VERIFIED

Comment 11 errata-xmlrpc 2011-12-06 17:25:49 UTC
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.

http://rhn.redhat.com/errata/RHBA-2011-1695.html


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