Bug 661278 - pirut traceback when updating package from RHN repo
pirut traceback when updating package from RHN repo
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: pirut (Show other bugs)
5.6
Unspecified Unspecified
high Severity high
: rc
: ---
Assigned To: James Antill
Red Hat Satellite QA List
:
Depends On:
Blocks: 640580
  Show dependency treegraph
 
Reported: 2010-12-08 06:58 EST by Miroslav Vadkerti
Modified: 2013-01-10 05:47 EST (History)
10 users (show)

See Also:
Fixed In Version: pirut-1.3.28-19.el5
Doc Type: Bug Fix
Doc Text:
Due to an error in the Slovak translation, working with a package that was signed with an unknown GPG key caused pirut to terminate unexpectedly with a traceback. This update corrects the Slovak translation, and pirut no longer crashes.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-01-13 18:51:44 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
pup traceback with slovak localization (207.09 KB, image/png)
2010-12-10 07:29 EST, Miroslav Vadkerti
no flags Details

  None (edit)
Description Miroslav Vadkerti 2010-12-08 06:58:19 EST
Description of problem:
Component: pirut
Summary: TB4a729d8f __init__.py:646:keyImportCallback:TypeError: not all arguments converted during string formatting

Traceback (most recent call last):
  File "/usr/sbin/pup", line 407, in _apply
    output = self.applyChanges(self.mainwin)
  File "/usr/lib/python2.4/site-packages/pirut/__init__.py", line 818, in applyChanges
    self.checkSignatures(dlpkgs, mainwin)
  File "/usr/lib/python2.4/site-packages/pirut/__init__.py", line 677, in checkSignatures
    self.getKeyForPackage(po, fullaskcb = keyImportCallback)
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 3537, in getKeyForPackage
    rc = fullaskcb({"po": po, "userid": info['userid'],
  File "/usr/lib/python2.4/site-packages/pirut/__init__.py", line 646, in keyImportCallback
    sec = _("The package %s is signed with a key "
TypeError: not all arguments converted during string formatting

Local variables in innermost frame:
d: <gtk.MessageDialog object (GtkMessageDialog) at 0x61161e0>
mainwin: <gtk.Window object (GtkWindow) at 0x5efc870>
userid: Red Hat, Inc. (release key) <security@redhat.com>
keyurl: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
keydict: {'timestamp': 1165366052, 'userid': 'Red Hat, Inc. (release key) <security@redhat.com>', 'keyurl': 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release', 'fingerprint': <bound method public_key.fingerprint of <yum.pgpmsg.public_key instance at 0xbbdf6c8>>, 'hexkeyid': '37017186', 'po': <YumAvailablePackageSqlite : apr-util-1.2.7-11.el5_5.2.x86_64 (0x82524d0)>}
hexkeyid: 37017186
po: apr-util-1.2.7-11.el5_5.2.x86_64


Version-Release number of selected component (if applicable):
pirut-1.3.28-17.el5

How reproducible:
100% (on current tree)

Steps to Reproduce:
1. Install tree RHEL5.6-Server-20101202.2/
2. rhn_register
3. 2 updates should be available
4. Run pup
  
Actual results:
Traceback

Expected results:
No traceback 

Additional info:
Comment 1 James Antill 2010-12-08 10:03:26 EST
 The code is:

            sec = _("The package %s is signed with a key "
                  "%s (0x%s) from %s.  Would you like to "
                  "import this key?") %(po, userid, hexkeyid, keyurl)

...which is asking the user about installing a GPG key, as the package does not verify with the known keys. The error from pyhton implies that there aren't four %s's (which there are in the above) ... looking through the translations I see a few problems:


% fgrep 'The package' pirut-1.3.28/po/* -A 2
[...]
--
pirut-1.3.28/po/mai.po:"The package %s is signed with a key %s (0x%s) from %s.  Would you like to "
pirut-1.3.28/po/mai.po-"import this key?"
pirut-1.3.28/po/mai.po-msgstr "सँकुल %s हस्ताक्षरित अछि %s (0x%s) की कुंजी सँ.  की अहाँ ई कुंजी आयात करना चाहब?"
--
[...]
pirut-1.3.28/po/ru.po:"The package %s is signed with a key %s (0x%s) from %s.  Would you like to "
pirut-1.3.28/po/ru.po-"import this key?"
pirut-1.3.28/po/ru.po-msgstr "Пакет %s подписан ключом %s (0x%s).  Нужно ли импортировать этот ключ?"
--
[...]
pirut-1.3.28/po/sl.po:"The package %s is signed with a key %s (0x%s) from %s.  Would you like to "
pirut-1.3.28/po/sl.po-"import this key?"
pirut-1.3.28/po/sl.po-msgstr "Paket %s je podpisan s ključem iz %s (0x%s).  Ali naj ga uvozim?"
--
[...]
pirut-1.3.28/po/zh_CN.po:"The package %s is signed with a key %s (0x%s) from %s.  Would you like to "
pirut-1.3.28/po/zh_CN.po-"import this key?"
pirut-1.3.28/po/zh_CN.po-msgstr "软件包 %s 被来自 %s的 (0x%s) 密钥%s标注.您需要导入这个密钥吗?"
--
pirut-1.3.28/po/zh_TW.po:"The package %s is signed with a key %s (0x%s) from %s.  Would you like to "
pirut-1.3.28/po/zh_TW.po-"import this key?"
pirut-1.3.28/po/zh_TW.po-msgstr "套件 %s 是以來自 %s(0x%s)的金鑰所簽署。您要匯入這個金鑰嗎?"
Comment 2 Ankit Patel 2010-12-09 23:59:20 EST
Adding "Translation" keyword and "eng-l10n-bugs@redhat.com" in the watch list.
Comment 3 Ankit Patel 2010-12-10 06:37:44 EST
Hi,

I have reviewed the problem described in the comment #0 and also checked the po files reported in comment #1 and found that there is no issue with translation or i18n here.

Translation files (po files basically) are clean and error free.

Please check the problem again and try to provide exact steps to reproduce it.

Thanks!
Ankit
Comment 4 Miroslav Vadkerti 2010-12-10 07:02:51 EST
Ankit, are you saying the translation conatains 4 %s as it should, not 3 %s as reported in comment #1?
Comment 5 Miroslav Vadkerti 2010-12-10 07:07:41 EST
The repro steps are provided in the description with 1 IMPORTANT addition:
use localization, e.g. system->localization->language
Comment 6 Ankit Patel 2010-12-10 07:20:55 EST
(In reply to comment #4)
> Ankit, are you saying the translation conatains 4 %s as it should, not 3 %s as
> reported in comment #1?

Yes and No both.

Below is the actual translation content I have grabbed from /cvs/dist/pirut/RHEL-5.

If you check all the reported problematic files, zh_CN.po has already 4 %s where it should be, while rest of the languages has 3 %s. However, these language PO files (mai.po, sl.po, ru.po and zh_CN.po) has marked mentioned message as "Fuzzy", i.e. those message translations will not be used for generating an MO file and hence the message will appear in English itself.

So, basically I do not see a problem, when
- zh_CN already has correct number of %s (4 here)
- rest of the languages where the problematic message is marked as fuzzy.

hence this shouldn't be a translation problem.

Thanks!
Ankit

*** pirut-1.3.28/po/mai.po ***

#: ../pirut/__init__.py:563
#, fuzzy, python-format
msgid ""
"The package %s is signed with a key %s (0x%s) from %s.  Would you like to "
"import this key?"
msgstr "सँकुल %s हस्ताक्षरित अछि %s (0x%s) की कुंजी सँ.  की अहाँ ई कुंजी आयात करना चाहब?"

*** pirut-1.3.28/po/ru.po ***

#: ../pirut/__init__.py:563
#, fuzzy, python-format
msgid ""
"The package %s is signed with a key %s (0x%s) from %s.  Would you like to "
"import this key?"
msgstr "Пакет %s подписан ключом %s (0x%s).  Нужно ли импортировать этот ключ?"


*** pirut-1.3.28/po/sl.po ***

#: ../pirut/__init__.py:563
#, fuzzy, python-format
msgid ""
"The package %s is signed with a key %s (0x%s) from %s.  Would you like to "
"import this key?"
msgstr "Paket %s je podpisan s ključem iz %s (0x%s).  Ali naj ga uvozim?"

*** pirut-1.3.28/po/zh_CN.po ***

#: ../pirut/__init__.py:563
#, python-format
msgid ""
"The package %s is signed with a key %s (0x%s) from %s.  Would you like to "
"import this key?"
msgstr "软件包 %s 被来自 %s的 (0x%s) 密钥%s标注.您需要导入这个密钥吗?"

*** pirut-1.3.28/po/zh_TW.po ***

#: ../pirut/__init__.py:563
#, fuzzy, python-format
msgid ""
"The package %s is signed with a key %s (0x%s) from %s.  Would you like to "
"import this key?"
msgstr "套件 %s 是以來自 %s(0x%s)的金鑰所簽署。您要匯入這個金鑰嗎?"
Comment 7 Miroslav Vadkerti 2010-12-10 07:25:12 EST
I just reproduced the problem without any issues with Slovak langauge.

Exact repro steps:
1. Install RHEL5.6 via http (not the latest tree, e.g. 20101014)
2. rhn_register - successfuly register to RHN
3. system->localization->language and choose a language 
4. logout and login to have localization enabled
5. ALT+F2 -> pup
6. Update packages

With Slovak language I get a traceback. I will attach a screenshot.

Important NOTE:
Not all localizations are affected. For example Slovak is affected, but
Hungarian is not.
Comment 8 Miroslav Vadkerti 2010-12-10 07:29:19 EST
Created attachment 467964 [details]
pup traceback with slovak localization
Comment 9 Miroslav Vadkerti 2010-12-10 07:30:40 EST
Ankit, is Slovak localization marked as Fuzzy, if not it should be.
Comment 10 Ankit Patel 2010-12-10 07:34:59 EST
(In reply to comment #9)
> Ankit, is Slovak localization marked as Fuzzy, if not it should be.

Sloval (sl.po) also has that particular message marked as Fuzzy.
Comment 11 James Antill 2010-12-10 10:18:18 EST
Ankit seems to be right, testing here (LANG=zh_CN):


In [1]: from rhpl.translate import _, textdomain

In [2]: textdomain('pirut')

In [3]: _("The package %s is signed with a key %s (0x%s) from %s.  Would you like to import this key?")
Out[3]: '\xe8\xbd\xaf\xe4\xbb\xb6\xe5\x8c\x85 %s \xe8\xa2\xab\xe6\x9d\xa5\xe8\x87\xaa %s\xe7\x9a\x84 (0x%s) \xe5\xaf\x86\xe9\x92\xa5%s\xe6\xa0\x87\xe6\xb3\xa8.\xe6\x82\xa8\xe9\x9c\x80\xe8\xa6\x81\xe5\xaf\xbc\xe5\x85\xa5\xe8\xbf\x99\xe4\xb8\xaa\xe5\xaf\x86\xe9\x92\xa5\xe5\x90\x97?'

...but with LANG=sl I get:

In [3]: _("The package %s is signed with a key %s (0x%s) from %s.  Would you like to import this key?")
Out[3]: 'The package %s is signed with a key %s (0x%s) from %s.  Would you like to import this key?'

...Miroslav ... what version of pirut/python do you have?
 Also is it possible for you to edit around line 646 to find out what the message coming back from gettext is? (just print it and run from the console).
Comment 12 James Antill 2010-12-13 12:11:18 EST
Miroslav, can you do the test?
Comment 13 James Antill 2010-12-13 16:22:12 EST
If I try doing this here:

1. remove all installed gpg keys.

2. install old version of w3m.

3. run: LANG=sl.utf8 sudo pup

...then I get half translated text, and the "bad" text is in english (and doesn't cause a traceback). Dito. zh_TW.utf8 ... and zh_CN.utf8 shows "translated" text.

 This is on "normal" RHN RHEL-5
Comment 14 Miroslav Vadkerti 2010-12-14 03:10:05 EST
James, I apologize for the late answer. Slovak is actually sk locale not Slovenian sl. The latter works for me too.

$ rpm -q pirut python
pirut-1.3.28-17.el5
python-2.4.3-41.el5

Here is the output of my test, when pirut tracebacks:
# LANG=sk.utf8 pup
Loaded plugins: rhnplugin
varovanie: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 37017186
Importing GPG key 0x37017186 "Red Hat, Inc. (release key) <security@redhat.com>" from /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Balík %s je podpísaný kľúčom od %s (0x%s).  Ste si istý ze chcete importovať tento kľúč?

In my case the bad text is localized and causes a traceback. Sorry for the confusion. I should have corrected Ankit's post.
Comment 15 James Antill 2010-12-14 09:53:37 EST
Yeh, weird, not sure how I missed this earlier:


#: ../pirut/__init__.py:563
#, python-format
msgid ""
"The package %s is signed with a key %s (0x%s) from %s.  Would you like to "
"import this key?"
msgstr ""
"Balík %s je podpísaný kľúčom od %s (0x%s).  Ste si istý ze chcete importovať "
"tento kľúč?"

...so it isn't marked fuzzy and only has 3 %s.
Comment 16 Denise Dumas 2010-12-14 09:57:50 EST
So this is a problem in the sk localization file?
Comment 17 James Antill 2010-12-14 10:08:45 EST
yes (at least sk, but maybe only sk).
Comment 20 Rolf Kyburz 2010-12-15 12:18:08 EST
I get a pup installation failure even with LANG="en_US.UTF-8" - here's my traceback:

Component: pirut
Summary: TB7d428655 rhnplugin.py:319:_getFile:RepoError: failed to retrieve repodata/c55860d7e201ad141a1b173a01723c8ec168b6c3-updateinfo.xml.gz from rhel-x86_64-client-5
error was [Errno -1] Metadata file does not match checksum

Traceback (most recent call last):
  File "/usr/sbin/pup", line 617, in ?
    main()
  File "/usr/sbin/pup", line 613, in main
    pup.run()
  File "/usr/sbin/pup", line 451, in run
    self.doRefresh()
  File "/usr/sbin/pup", line 291, in doRefresh
    self.populateUpdates()
  File "/usr/sbin/pup", line 347, in populateUpdates
    self.updateMetadata.add(repo)
  File "/usr/lib/python2.4/site-packages/yum/update_md.py", line 367, in add
    md = obj.retrieveMD(mdtype)
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 1494, in retrieveMD
    return self._retrieveMD(mdtype)
  File "/usr/lib/python2.4/site-packages/yum/yumRepo.py", line 1534, in _retrieveMD
    cache=self.http_caching == 'all')
  File "/usr/lib/yum-plugins/rhnplugin.py", line 319, in _getFile
    raise yum.Errors.RepoError, \
RepoError: failed to retrieve repodata/c55860d7e201ad141a1b173a01723c8ec168b6c3-updateinfo.xml.gz from rhel-x86_64-client-5
error was [Errno -1] Metadata file does not match checksum

Local variables in innermost frame:
e: [Errno -1] Metadata file does not match checksum
url: None
text: rhel-x86_64-client-5/updateinfo
self: rhel-x86_64-client-5
cache: False
reget: None
relative: repodata/c55860d7e201ad141a1b173a01723c8ec168b6c3-updateinfo.xml.gz
start: None
checkfunc: (<bound method RhnRepo.checkMD of <rhnplugin.RhnRepo object at 0x1aa997d0>>, ('updateinfo',), {})
copy_local: 1
end: None
local: /var/cache/yum/rhel-x86_64-client-5/c55860d7e201ad141a1b173a01723c8ec168b6c3-updateinfo.xml.gz
Comment 21 James Antill 2010-12-15 13:49:49 EST
 This is a different bug (in RHN and the CDN). It goes away eventually, I've created a number of BZs against RHN but they keep getting closed as soon as the current problem is over.
 638922 is one. 452538 is another.
Comment 22 Jaromir Hradilek 2010-12-16 15:26:25 EST
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Due to an error in the Slovak translation, working with a package that was signed with an unknown GPG key caused pirut to terminate unexpectedly with a traceback. This update corrects the Slovak translation, and pirut no longer crashes.
Comment 25 errata-xmlrpc 2011-01-13 18:51:44 EST
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/RHBA-2011-0132.html

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