Bug 1205775 - dnf-automatic: UnicodeEncodeError: 'ascii' codec can't encode character u'\xbb' in position 42: ordinal not in range(128)
Summary: dnf-automatic: UnicodeEncodeError: 'ascii' codec can't encode character u'\xb...
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-25 15:14 UTC by Christian Stadelmann
Modified: 2015-07-21 11:47 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-07-21 11:47:06 UTC


Attachments (Terms of Use)
the requested file (1.32 KB, text/plain)
2015-04-07 21:48 UTC, Christian Stadelmann
no flags Details


Links
System ID Priority Status Summary Last Updated
Red Hat Bugzilla 1238958 None None None Never

Internal Links: 1238958

Description Christian Stadelmann 2015-03-25 15:14:27 UTC
Description of problem:
When running dnf-automatic I recently ran into this problem:

<Date> 13:21:53 <Hostname> dnf-automatic[11651]: Transaktionsüberprüfung wird ausgeführt
<Date> 13:21:54 <Hostname> dnf-automatic[11651]: Transaktionsprüfung war erfolgreich.
<Date> 13:21:54 <Hostname> dnf-automatic[11651]: Transaktion wird getestet
<Date> 13:21:55 <Hostname> dnf-automatic[11651]: Transaktionstest war erfolgreich.
<Date> 13:21:55 <Hostname> dnf-automatic[11651]: Transaktion wird ausgeführt
<Date> 13:22:22 <Hostname> dracut[17514]: dracut-038-33.git20141216.fc21
(dracut generating initramfs)
<Date> 13:22:46 <Hostname> python[11651]: detected unhandled Python exception in '/usr/bin/dnf-automatic'
<Date> 13:22:46 <Hostname> abrt-server[15902]: ABRT_IGNORE variable is 1 - not saving the crash
<Date> 13:22:46 <Hostname> abrt-server[15902]: 'post-create' on '/var/tmp/abrt/Python-2015-03-23-13:22:46-11651' exited with 1
<Date> 13:22:46 <Hostname> abrt-server[15902]: Deleting problem directory '/var/tmp/abrt/Python-2015-03-23-13:22:46-11651'
<Date> 13:22:46 <Hostname> dnf-automatic[11651]: Traceback (most recent call last):
<Date> 13:22:46 <Hostname> dnf-automatic[11651]: File "/usr/bin/dnf-automatic", line 32, in <module>
<Date> 13:22:46 <Hostname> dnf-automatic[11651]: sys.exit(dnf.automatic.main.main(sys.argv[1:]))
<Date> 13:22:46 <Hostname> dnf-automatic[11651]: File "/usr/lib/python2.7/site-packages/dnf/automatic/main.py", line 159, in main
<Date> 13:22:46 <Hostname> dnf-automatic[11651]: emitters.commit()
<Date> 13:22:46 <Hostname> dnf-automatic[11651]: File "/usr/lib/python2.7/site-packages/dnf/util.py", line 310, in fn
<Date> 13:22:46 <Hostname> dnf-automatic[11651]: return list(map(call_what, self))
<Date> 13:22:46 <Hostname> dnf-automatic[11651]: File "/usr/lib/python2.7/site-packages/dnf/util.py", line 309, in call_what
<Date> 13:22:46 <Hostname> dnf-automatic[11651]: return method(*args, **kwargs)
<Date> 13:22:46 <Hostname> dnf-automatic[11651]: File "/usr/lib/python2.7/site-packages/dnf/automatic/emitter.py", line 109, in commit
<Date> 13:22:46 <Hostname> dnf-automatic[11651]: print(msg)
<Date> 13:22:46 <Hostname> dnf-automatic[11651]: UnicodeEncodeError: 'ascii' codec can't encode character u'\xbb' in position 42: ordinal not in range(128)


The initramfs generated by dracut was working fine as is the whole system. ABRT refused to report this problem.

Comment 1 Stefan Midjich 2015-03-31 11:45:23 UTC
I get the same problem but the traceback goes a little further since I've set email as an emitter. 

mar 30 20:19:46 my.hostname.tld python[31488]: detected unhandled Python exception in '/usr/bin/dnf-automatic'
mar 30 20:19:46 my.hostname.tld dnf-automatic[31488]: Traceback (most recent call last):
mar 30 20:19:46 my.hostname.tld dnf-automatic[31488]: File "/usr/bin/dnf-automatic", line 32, in <module>
mar 30 20:19:46 my.hostname.tld dnf-automatic[31488]: sys.exit(dnf.automatic.main.main(sys.argv[1:]))
mar 30 20:19:46 my.hostname.tld dnf-automatic[31488]: File "/usr/lib/python2.7/site-packages/dnf/automatic/main.py", line 159, in main
mar 30 20:19:46 my.hostname.tld dnf-automatic[31488]: emitters.commit()
mar 30 20:19:46 my.hostname.tld dnf-automatic[31488]: File "/usr/lib/python2.7/site-packages/dnf/util.py", line 310, in fn
mar 30 20:19:46 my.hostname.tld dnf-automatic[31488]: return list(map(call_what, self))
mar 30 20:19:46 my.hostname.tld dnf-automatic[31488]: File "/usr/lib/python2.7/site-packages/dnf/util.py", line 309, in call_what
mar 30 20:19:46 my.hostname.tld dnf-automatic[31488]: return method(*args, **kwargs)
mar 30 20:19:46 my.hostname.tld dnf-automatic[31488]: File "/usr/lib/python2.7/site-packages/dnf/automatic/emitter.py", line 89, in commit
mar 30 20:19:46 my.hostname.tld dnf-automatic[31488]: message = email.mime.text.MIMEText(body)
mar 30 20:19:46 my.hostname.tld dnf-automatic[31488]: File "/usr/lib64/python2.7/email/mime/text.py", line 30, in __init__
mar 30 20:19:46 my.hostname.tld dnf-automatic[31488]: self.set_payload(_text, _charset)
mar 30 20:19:46 my.hostname.tld dnf-automatic[31488]: File "/usr/lib64/python2.7/email/message.py", line 226, in set_payload
mar 30 20:19:46 my.hostname.tld dnf-automatic[31488]: self.set_charset(charset)
mar 30 20:19:46 my.hostname.tld dnf-automatic[31488]: File "/usr/lib64/python2.7/email/message.py", line 262, in set_charset
mar 30 20:19:46 my.hostname.tld dnf-automatic[31488]: self._payload = self._payload.encode(charset.output_charset)
mar 30 20:19:46 my.hostname.tld dnf-automatic[31488]: UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 1: ordinal not in range(128)

Comment 2 Honza Silhan 2015-04-02 17:48:08 UTC
Stephan, can you post the exact reproducer (automatic.conf, cmdline, LANG env var), please? It works for me with `LANG=cs_CZ.UTF-8 ./bin/dnf-automatic-2 etc/dnf/automatic.conf` and `emit_via = stdio` in automatic.conf:

Spouštím kontrolu transakce
Kontrola transakce byla úspěšná
Probíhá test transakce
Test transakce byl úspěšný.
Transakce běží
The following updates have been applied on 'a903d59ada3b':
=============================================
 Balíček
       Arch    Verze          Repozitář
                                        Vel.
=============================================
Aktualizace:
 less  x86_64  471-1.fc21     updates  127 k

Shrnutí transakce
=============================================
Aktualizace  1 Package

Comment 3 Stefan Midjich 2015-04-03 17:47:26 UTC
I'm afraid I can no longer re-create the issue, possibly due to a yum update I did shortly after posting in this thread. 

Here is the automatic.conf. 

http://fpaste.org/207013/81983142/

I tried setting emit_via = stdio and running it as sudo dnf-automatic /etc/dnf/automatic.conf. 

But nothing happens, no output, return code 0 and journalctl -lau dnf-automatic shows nothing new either. /var/log/dnf.log shows what I assume is a normal run. 

Apr 03 19:41:49 INFO --- logging initialized ---
Apr 03 19:41:49 DDEBUG timer: config: 8 ms
Apr 03 19:41:49 DEBUG cachedir: /var/cache/dnf/x86_64/21/x86_64/21
Apr 03 19:41:49 DEBUG DNF version: 0.6.4
Apr 03 19:41:49 DDEBUG Command: dnf -v makecache timer 
Apr 03 19:41:49 DDEBUG Installroot: /
Apr 03 19:41:49 DDEBUG Releasever: 21
Apr 03 19:41:49 DDEBUG Base command: makecache
Apr 03 19:41:49 DDEBUG Extra commands: [u'timer']
Apr 03 19:41:49 DEBUG Skapar cache-filer för alla metadatafiler.
Apr 03 19:41:49 INFO Cachen med metadata uppdaterades nyligen.
Apr 03 19:41:49 DDEBUG Cleaning up.

The last error is the one I posted above from journalctl. 

(In reply to Jan Silhan from comment #2)
> Stephan, can you post the exact reproducer (automatic.conf, cmdline, LANG
> env var), please? It works for me with `LANG=cs_CZ.UTF-8
> ./bin/dnf-automatic-2 etc/dnf/automatic.conf` and `emit_via = stdio` in
> automatic.conf:
> 
> Spouštím kontrolu transakce
> Kontrola transakce byla úspěšná
> Probíhá test transakce
> Test transakce byl úspěšný.
> Transakce běží
> The following updates have been applied on 'a903d59ada3b':
> =============================================
>  Balíček
>        Arch    Verze          Repozitář
>                                         Vel.
> =============================================
> Aktualizace:
>  less  x86_64  471-1.fc21     updates  127 k
> 
> Shrnutí transakce
> =============================================
> Aktualizace  1 Package

Comment 4 Christian Stadelmann 2015-04-07 21:48:59 UTC
Created attachment 1011943 [details]
the requested file

I can no longer reproduce this crash either. I even tried downgrading some python packages I updated inbetween but that does not make the problem reproducible.

Comment 5 Honza Silhan 2015-07-21 11:47:06 UTC
If you encounter the error again, please reopen. It could be fixed by bug 1238958 in dnf-1.0.2


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