Bug 441455

Summary: yum traceback with UnicodeEncodeError
Product: [Fedora] Fedora Reporter: Karsten Hopp <karsten>
Component: yumAssignee: Seth Vidal <skvidal>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: rawhideCC: fedora, ffesti, james.antill, katzj, pmatilai, tim.lauridsen
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-04-17 12:25:51 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:
Attachments:
Description Flags
example yum output
none
yum output with strace none

Description Karsten Hopp 2008-04-08 07:50:35 UTC
Description of problem:
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 236, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 192, in main
    return exFatal(e)
  File "/usr/share/yum-cli/yummain.py", line 63, in exFatal
    logger.critical('\n\n%s', str(e))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 14:
ordinal not in range(128)

Version-Release number of selected component (if applicable):
yum-3.2.13-2.fc9.noarch

How reproducible:
always

Steps to Reproduce:
1. LANG=de_DE.UTF-8
2. yum update
3.

Comment 1 Karsten Hopp 2008-04-08 09:42:11 UTC
reproducable with yum-3.2.14-2.fc9.noarch

Comment 2 Sebastian Vahl 2008-04-09 10:20:07 UTC
Created attachment 301773 [details]
example yum output

Same problem here with yum-3.2.14-2.fc9.noarch.

"LANG=en_US.UTF-8 yum <command>" works normal.

# cat /etc/sysconfig/i18n
LANG="de_DE.UTF-8"
SYSFONT="latarcyrheb-sun16"

Comment 3 James Antill 2008-04-09 13:58:39 UTC
 Sebastian, you get a backtrace that looks like the above?
 And it goes away completely if you change to use LANG=en_US.UTF-8?


Comment 5 Sebastian Vahl 2008-04-09 19:58:28 UTC
(In reply to comment #3)
>  Sebastian, you get a backtrace that looks like the above?

Yes.

>  And it goes away completely if you change to use LANG=en_US.UTF-8?

I've seen this error for the first time today. "yum update" was working normal.
And yes, with LANG=en_US.UTF-8 all is working normal.

(In reply to comment #4)
>  Can you try:
> 
>
http://koji.fedoraproject.org/packages/yum/3.2.14/3.fc9/noarch/yum-3.2.14-3.fc9.noarch.rpm

No luck:

Führe Verarbeitung durch
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 236, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 188, in main
    base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 430, in doTransaction
    self.runTransaction(cb=cb)
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 764, in
runTransaction
    errors = self.ts.run(cb.callback, '')
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 317, in callback
    self._instProgress( bytes, total, h )
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 398, in
_instProgress
    self.complete_actions, self.total_actions)
  File "/usr/share/yum-cli/output.py", line 750, in event
    sys.stdout.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 4:
ordinal not in range(128)


Comment 6 Seth Vidal 2008-04-10 15:44:55 UTC
You were redirecting to a file, weren't you?

Comment 8 Sebastian Vahl 2008-04-10 19:43:43 UTC
(In reply to comment #6)
> You were redirecting to a file, weren't you?

No. I've tried to redirect the output with tee to a file once, but then the 
error didn't happen.

(In reply to comment #7)
> Can you test this version:
> 
http://koji.fedoraproject.org/packages/yum/3.2.14/4.fc9/noarch/yum-3.2.14-4.fc9.noarch.rpm
> 

Still failing:
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 236, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 188, in main
    base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 430, in doTransaction
    self.runTransaction(cb=cb)
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 772, in 
runTransaction
    errors = self.ts.run(cb.callback, '')
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 317, in 
callback
    self._instProgress( bytes, total, h )
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 398, in 
_instProgress
    self.complete_actions, self.total_actions)
  File "/usr/share/yum-cli/output.py", line 750, in event
    sys.stdout.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 
4: ordinal not in range(128)


Is there a way how I can provide more informations? yum -d 9 ?





Comment 9 Seth Vidal 2008-04-10 19:56:27 UTC
can you edit line 750 of:
/usr/share/yum-cli/output.py

change it to read:
sys.stdout.write(to_unicode(msg))

and then re-run the case which makes the message.

I'm curious what is being outputted.



Comment 10 Sebastian Vahl 2008-04-10 20:08:00 UTC
Still no luck:

Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 236, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 188, in main
    base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 430, in doTransaction
    self.runTransaction(cb=cb)
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 772, in 
runTransaction
    errors = self.ts.run(cb.callback, '')
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 317, in 
callback
    self._instProgress( bytes, total, h )
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 398, in 
_instProgress
    self.complete_actions, self.total_actions)
  File "/usr/share/yum-cli/output.py", line 750, in event
    sys.stdout.write(to_unicode(msg))
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 
4: ordinal not in range(128)

Comment 11 Seth Vidal 2008-04-10 20:15:51 UTC
in the above traceback were you outputting to a file or to a stdout?


Comment 12 Sebastian Vahl 2008-04-10 20:26:53 UTC
(In reply to comment #11)
> in the above traceback were you outputting to a file or to a stdout?
> 

stout (through a ssh connection if that matters)

Comment 14 Sebastian Vahl 2008-04-11 07:32:31 UTC
(In reply to comment #13)
>  Ok, another try:
> 
> 
http://koji.fedoraproject.org/packages/yum/3.2.14/5.fc9/noarch/yum-3.2.14-5.fc9.noarch.rpm

Output in stdout:

Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 236, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 188, in main
    base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 430, in doTransaction
    self.runTransaction(cb=cb)
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 772, in 
runTransaction
    errors = self.ts.run(cb.callback, '')
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 317, in 
callback
    self._instProgress( bytes, total, h )
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 398, in 
_instProgress
    self.complete_actions, self.total_actions)
  File "/usr/share/yum-cli/output.py", line 750, in event
    sys.stdout.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 
4: ordinal not in range(128)

---

I've then also tried all other translations and all are working fine (but I 
don't know which ones are really using unicode chars):
LANG=fr_FR.UTF-8 yum -y reinstall gdm
LANG=da_DK.UTF-8 yum -y reinstall gdm
LANG=it_IT.UTF-8 yum -y reinstall gdm
LANG=ms_MY.UTF-8 yum -y reinstall gdm  
LANG=nb_NO.UTF-8 yum -y reinstall gdm
LANG=pl_PL.UTF-8 yum -y reinstall gdm
LANG=pt_PT.UTF-8 yum -y reinstall gdm
LANG=pt_BR.UTF-8 yum -y reinstall gdm
LANG=ru_RU.UTF-8 yum -y reinstall gdm

Only this one is also failing:
LANG=sr_RS.UTF-8 yum -y reinstall gdm

Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 236, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 188, in main
    base.doTransaction()
  File "/usr/share/yum-cli/cli.py", line 430, in doTransaction
    self.runTransaction(cb=cb)
  File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 772, in 
runTransaction
    errors = self.ts.run(cb.callback, '')
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 317, in 
callback
    self._instProgress( bytes, total, h )
  File "/usr/lib/python2.5/site-packages/yum/rpmtrans.py", line 398, in 
_instProgress
    self.complete_actions, self.total_actions)
  File "/usr/share/yum-cli/output.py", line 750, in event
    sys.stdout.write(msg)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 3-9: 
ordinal not in range(128)

---

So is maybe the german translation just broken?


Comment 15 Adrian "Adi1981" P. 2008-04-11 22:00:39 UTC
Do you have some other repos than default fedora's ? Have you got all gpg key's
imported if you've got some other repo? Got similar problem with pl_PL.UTF-8 (
bug #438580 ), but in my case problem exist when there's missing gpg key (for
livna repo) - importing key fixes the problem. You can do "strace yum update"
and see if you'll have some warnings before backtrace. For me it was:

gettimeofday({1207867139, 691711}, NULL) = 0
stat64("/etc/pki/rpm-gpg/RPM-GPG-KEY-livna", 0xbfd87c28) = -1 ENOENT (No such
file or directory)
write(2, "Traceback (most recent call last"..., 35Traceback (most recent call
last):

Maybe it's still the same problem?

Comment 16 Adrian "Adi1981" P. 2008-04-11 22:04:06 UTC
uhhh.. now i realized that gdm is in fedora's repo, so probably it wont be the
same problem...

Comment 17 Sebastian Vahl 2008-04-11 22:21:47 UTC
Created attachment 302175 [details]
yum output with strace

(In reply to comment #16)
> uhhh.. now i realized that gdm is in fedora's repo, so probably it wont be
the
> same problem...

However, I've removed all additional repos from /etc/yum.repos.d an hit this
command if this would help in a way:

strace yum -d 9 --noplugins -y reinstall gdm 2>&1 | tee yum-strace.log

Comment 18 James Antill 2008-04-11 23:37:20 UTC
 Ok, we're pretty sure this one will fix it and if not there's a config. option
to turn the i18n stuff off now:

http://koji.fedoraproject.org/packages/yum/3.2.14/6.fc9/noarch/yum-3.2.14-6.fc9.noarch.rpm

Comment 19 Sebastian Vahl 2008-04-12 07:07:02 UTC
(In reply to comment #18)
>  Ok, we're pretty sure this one will fix it and if not there's a config. 
option
> to turn the i18n stuff off now:
> 
> 
http://koji.fedoraproject.org/packages/yum/3.2.14/6.fc9/noarch/yum-3.2.14-6.fc9.noarch.rpm

Sorry, still not working:

yum -y --noplugins reinstall gdm
Einrichten des Neuinstallationsprozess
Schliesse Pakete aus von Livna for Fedora Core 8.92 - i386 - Development Tree
Finished
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 236, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 111, in main
    result, resultmsgs = base.doCommands()
  File "/usr/share/yum-cli/cli.py", line 309, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, 
self.extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 781, in doCommand
    return 1, [str(e)]
UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 
35: ordinal not in range(128)


But it even makes things worse:
# yum --help
Geladene Plugins: changelog, downloadonly, fastestmirror, fedorakmod,
                : protectbase, refresh-packagekit, security
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 236, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 91, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 194, in getOptionsConfig
    (opts, self.cmds) = self.optparser.setupYumConfig()
  File "/usr/share/yum-cli/cli.py", line 999, in setupYumConfig
    (opts, cmds) = self.parse_args()
  File "/usr/lib/python2.5/optparse.py", line 1378, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python2.5/optparse.py", line 1418, in _process_args
    self._process_long_opt(rargs, values)
  File "/usr/lib/python2.5/optparse.py", line 1493, in _process_long_opt
    option.process(opt, value, values, self)
  File "/usr/lib/python2.5/optparse.py", line 782, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib/python2.5/optparse.py", line 804, in take_action
    parser.print_help()
  File "/usr/lib/python2.5/optparse.py", line 1648, in print_help
    file.write(self.format_help().encode(encoding, "replace"))
  File "/usr/lib/python2.5/codecs.py", line 303, in write
    data, consumed = self.encode(object, self.errors)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 150: 
ordinal not in range(128)

(tested with LANG=de_DE.UTF-8)




Comment 20 Sebastian Vahl 2008-04-14 11:12:37 UTC
Not sure what has happened, but today a "yum -y reinstall gdm" with 
yum-3.2.14-6.fc9.noarch isn't failing anymore. But "yum --help" with this 
version still does.
With the current version in rawhide, yum-3.2.14-2.fc9.noarch, the help is 
working, but the reinstall is also failing.

(In reply to comment #18)
>  Ok, we're pretty sure this one will fix it and if not there's a config. 
option
> to turn the i18n stuff off now:

How do I use this option?



Comment 21 Sebastian Vahl 2008-04-17 09:41:06 UTC
Seems to be working with yum-3.2.14-9.fc9.noarch in my local language 
(de_DE.UTF-8) and with LANG=sr_RS.UTF-8 for my problematic actions ("yum -y 
reinstall gdm" and "yum --help").