Bug 744536 - [ALL LANG] [RHSM CLI] unsubscribe module _unexpected 'ascii' code can't decode ...message.
[ALL LANG] [RHSM CLI] unsubscribe module _unexpected 'ascii' code can't decod...
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: subscription-manager (Show other bugs)
Unspecified Linux
medium Severity medium
: rc
: ---
Assigned To: Adrian Likins
: i18n
Depends On:
Blocks: rhsm-rhel62
  Show dependency treegraph
Reported: 2011-10-09 05:49 EDT by Lijun Li
Modified: 2013-01-10 05:56 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2011-12-06 12:25:49 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:

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

  None (edit)
Description Lijun Li 2011-10-09 05:49:48 EDT
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):

How reproducible:

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 09:45:59 EDT
commit b7d1881e0b8b4c33b2cea79b4d762eebc6ef816e
Author: Adrian Likins <alikins@redhat.com>
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 17:47:07 EDT
I can recreate this bug as follows...
[root@jsefler-onprem-62server tmp]# rpm -q subscription-manager
[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
[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' 不是一个有效的序列号

Comment 7 John Sefler 2011-10-24 11:21:35 EDT
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-29 23:23:43 EDT
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-29 23:37:10 EDT
Re-verifying with additional fix from alikins in comment 8 applied...

[root@jsefler-onprem-62server ~]# rpm -q subscription-manager

[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

# 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 12:25:49 EST
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.


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