Bug 1262082 - 'ascii' codec can't decode byte 0xc3 in position 40: ordinal not in range(128)
Summary: 'ascii' codec can't decode byte 0xc3 in position 40: ordinal not in range(128)
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Honza Silhan
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1264587 1265788 1266159 1266313 1274986 1278233 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-10 18:58 UTC by William Moreno
Modified: 2015-11-16 13:40 UTC (History)
18 users (show)

Fixed In Version: dnf-1.1.2-4.fc23 dnf-1.1.2-4.fc22
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-04 19:13:20 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description William Moreno 2015-09-10 18:58:02 UTC
Hello

I am getting this error trying to run dnf:

[root@sesshomaru wmoreno]# rpm -q dnf
dnf-1.1.1-1.fc22.noarch
[root@sesshomaru wmoreno]# dnf
Traceback (most recent call last):
  File "/usr/bin/dnf", line 36, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 195, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 84, in main
    return _main(base, args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 122, in _main
    cli.configure(map(ucd, args))
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1007, in configure
    self.optparser.usage = self.optparser.get_usage()
  File "/usr/lib/python2.7/site-packages/dnf/cli/option_parser.py", line 273, in get_usage
    usage += "%-25s %s\n" % (name, summary)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 40: ordinal not in range(128)

Comment 1 Honza Silhan 2015-09-16 09:58:24 UTC
Thanks for the report.

Comment 2 Pablo Iranzo Gómez 2015-09-18 13:51:40 UTC
Hi,
Three systems that got upgraded with latest updates recently:

Instalando:
 dnf-plugin-system-upgrade                                                   noarch                                           0.4.1-1.fc22                                            updates                                            44 k
     reemplazando  fedup.noarch 0.9.2-1.fc22
 python2-dnf-plugin-system-upgrade                                           noarch                                           0.4.1-1.fc22                                            updates                                            25 k
Actualizando:
 icoutils                                                                    x86_64                                           0.31.0-8.fc22                                           updates                                            85 k
 python-ipython-console                                                      noarch                                           2.4.1-8.fc22                                            updates                                           1.5 M

Started to show this behaviour:

[root@Deneb ~]# dnf -y clean expire-cache; dnf -y upgrade
Repository kzak-mutt-kz is listed more than once in the configuration
Traceback (most recent call last):
  File "/usr/bin/dnf", line 36, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 198, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 84, in main
    return _main(base, args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 117, in _main
    cli.configure(map(ucd, args))
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1007, in configure
    self.optparser.usage = self.optparser.get_usage()
  File "/usr/lib/python2.7/site-packages/dnf/cli/option_parser.py", line 273, in get_usage
    usage += "%-25s %s\n" % (name, summary)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 40: ordinal not in range(128)



Which breaks DNF

Comment 3 Pablo Iranzo Gómez 2015-09-18 13:52:27 UTC
Is there any test package for this to validate the fix and apply it?

Comment 4 Pablo Iranzo Gómez 2015-09-18 13:59:15 UTC
In my case, setting LANG=C allows the command to run, so apparently dnf is launching some code and the output it gets comes in local lang (es_ES.utf8) which breaks it.

Comment 5 Luis Valentin 2015-09-19 00:08:24 UTC
Same case as Pablo, setting LANG=C allows run. Happens after this update:

cat /var/log/dnf.log 
_Extract_:

Sep 18 18:37:20 DEBUG ---> Paquete dnf-plugin-system-upgrade.noarch 0.4.1-1.fc22 será instalado
Sep 18 18:37:20 DEBUG ---> Paquete fedup.noarch 0.9.2-1.fc22 será obsoleto
Sep 18 18:37:20 DEBUG ---> Paquete python2-dnf-plugin-system-upgrade.noarch 0.4.1-1.fc22 será instalado
Sep 18 18:37:20 INFO Dependencias resueltas.
Sep 18 18:37:20 DEBUG langpacks: enabled languages are ['es_ES']
Sep 18 18:37:20 INFO =======================================================================================================================================
 Paquete                                           Arquitectura           Versión                        Repositorio             Tamaño
=======================================================================================================================================
Instalando:
 dnf-plugin-system-upgrade                         noarch                 0.4.1-1.fc22                   updates                  44 k
     reemplazando  fedup.noarch 0.9.2-1.fc22
 python2-dnf-plugin-system-upgrade                 noarch                 0.4.1-1.fc22                   updates                  25 k

Sep 18 18:38:09 INFO 
Instalado:
  dnf-plugin-system-upgrade.noarch 0.4.1-1.fc22                  python2-dnf-plugin-system-upgrade.noarch 0.4.1-1.fc22                 

Sep 18 18:38:09 DEBUG Completion plugin: Generating completion cache...
Sep 18 18:38:09 INFO ¡Listo!
Sep 18 18:38:09 DEBUG_2 Cleaning up.
Sep 18 18:38:09 DEBUG_2 /var/cache/dnf/updates-d28e3be95240972f/packages/python2-dnf-plugin-system-upgrade-0.4.1-1.fc22.noarch.rpm eliminado
Sep 18 18:38:09 DEBUG_2 /var/cache/dnf/updates-d28e3be95240972f/packages/dnf-plugin-system-upgrade-0.4.1-1.fc22.noarch.rpm eliminado

Comment 6 Radek Holy 2015-09-21 08:50:57 UTC
*** Bug 1264587 has been marked as a duplicate of this bug. ***

Comment 8 Honza Silhan 2015-09-22 11:51:21 UTC
Pablo Iranzo Gómez: dnf-1.1.2

Comment 9 Fedora Update System 2015-09-22 15:01:33 UTC
hawkey-0.6.1-1.fc23 dnf-plugins-core-0.1.12-2.fc23 dnf-1.1.2-2.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-16428

Comment 10 Fedora Update System 2015-09-22 15:03:24 UTC
dnf-plugins-core-0.1.12-2.fc22 hawkey-0.6.1-1.fc22 dnf-1.1.2-2.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-16429

Comment 11 Juan Orti 2015-09-22 18:27:43 UTC
Another user experienced a similar problem:

dnf upgrade

reporter:       libreport-2.6.2
cmdline:        /usr/bin/python -OO /bin/dnf upgrade -y
dso_list:       python-dnf-1.1.1-2.fc22.noarch
event_log:      2015-09-22-20:27:06> ('report_uReport' completado con éxito)
executable:     /bin/dnf
kernel:         4.1.6-201.fc22.x86_64
package:        dnf-1.1.1-2.fc22
reason:         option_parser.py:273:get_usage:UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 40: ordinal not in range(128)
runlevel:       N 5
type:           Python
uid:            0

Comment 12 Fedora Update System 2015-09-23 03:54:54 UTC
dnf-1.1.2-2.fc23, dnf-plugins-core-0.1.12-2.fc23, hawkey-0.6.1-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update dnf-plugins-core dnf hawkey'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-16428

Comment 13 Fedora Update System 2015-09-23 21:22:46 UTC
dnf-1.1.2-2.fc22, dnf-plugins-core-0.1.12-2.fc22, hawkey-0.6.1-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update dnf-plugins-core dnf hawkey'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-16429

Comment 14 Luis Valentin 2015-09-24 13:41:26 UTC
Fix can't be applied:
[...]$ su -c 'dnf --enablerepo=updates-testing update dnf-plugins-core dnf hawkey'
Contraseña: 
Traceback (most recent call last):
  File "/usr/bin/dnf", line 36, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 198, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 84, in main
    return _main(base, args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/main.py", line 117, in _main
    cli.configure(map(ucd, args))
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1007, in configure
    self.optparser.usage = self.optparser.get_usage()
  File "/usr/lib/python2.7/site-packages/dnf/cli/option_parser.py", line 273, in get_usage
    usage += "%-25s %s\n" % (name, summary)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 40: ordinal not in range(128)
.............

And if I run: 

sudo  LANG=C  /usr/bin/dnf -v --enablerepo=updates-testing update dnf-plugins-core dnf hawkey
Getting:
...
--> Starting dependency resolution
---> Package hawkey.x86_64 0.6.0-1.fc22 will be upgraded
---> Package hawkey.x86_64 0.6.1-1.fc22 will be an upgrade
---> Package python3-hawkey.x86_64 0.6.0-1.fc22 will be upgraded
---> Package python3-hawkey.x86_64 0.6.1-1.fc22 will be an upgrade
---> Package python-hawkey.x86_64 0.6.0-1.fc22 will be upgraded
---> Package python-hawkey.x86_64 0.6.1-1.fc22 will be an upgrade
--> Finished dependency resolution
Dependencies resolved.
langpacks: enabled languages are [u'en', 'es_ES']
=======================================================================================================================================
 Package                                 Arch                   Version                          Repository                       Size
=======================================================================================================================================
Upgrading:
 hawkey                                  x86_64                 0.6.1-1.fc22                     updates-testing                  91 k
 python-hawkey                           x86_64                 0.6.1-1.fc22                     updates-testing                  77 k
 python3-hawkey                          x86_64                 0.6.1-1.fc22                     updates-testing                  72 k
Skipping packages with conflicts:
(add '--best --allowerasing' to command line to force their upgrade):
 dnf                                     noarch                 1.1.2-2.fc22                     updates-testing                 260 k
 dnf-conf                                noarch                 1.1.2-2.fc22                     updates-testing                  87 k
 dnf-plugins-core                        noarch                 0.1.12-2.fc22                    updates-testing                  35 k
 dnf-yum                                 noarch                 1.1.2-2.fc22                     updates-testing                  80 k
 python-dnf-plugins-core                 noarch                 0.1.12-2.fc22                    updates-testing                  84 k
 python2-dnf                             noarch                 1.1.2-2.fc22                     updates-testing                 445 k
 python3-dnf                             noarch                 1.1.2-2.fc22                     updates-testing                 450 k

Transaction Summary
=======================================================================================================================================
Upgrade  3 Packages

I canceled this and tried:

[...]$ sudo  LANG=C  /usr/bin/dnf -v --best --allowerasing --enablerepo=updates-testing update dnf-plugins-core dnf hawkey
Getting:
--> Starting dependency resolution
---> Package python2-dnf.noarch 1.1.2-2.fc22 will be installed
---> Package dnf.noarch 1.1.1-2.fc22 will be upgraded
---> Package dnf.noarch 1.1.2-2.fc22 will be an upgrade
---> Package dnf-plugins-core.noarch 0.1.11-1.fc22 will be upgraded
---> Package dnf-plugins-core.noarch 0.1.12-2.fc22 will be an upgrade
---> Package hawkey.x86_64 0.6.0-1.fc22 will be upgraded
---> Package hawkey.x86_64 0.6.1-1.fc22 will be an upgrade
---> Package python-dnf-plugins-core.noarch 0.1.11-1.fc22 will be upgraded
---> Package python-dnf-plugins-core.noarch 0.1.12-2.fc22 will be an upgrade
---> Package dnf-conf.noarch 1.1.1-2.fc22 will be upgraded
---> Package dnf-conf.noarch 1.1.2-2.fc22 will be an upgrade
---> Package python-hawkey.x86_64 0.6.0-1.fc22 will be upgraded
---> Package python-hawkey.x86_64 0.6.1-1.fc22 will be an upgrade
---> Package dnf-yum.noarch 1.1.1-2.fc22 will be upgraded
---> Package dnf-yum.noarch 1.1.2-2.fc22 will be an upgrade
---> Package python3-hawkey.x86_64 0.6.0-1.fc22 will be upgraded
---> Package python3-hawkey.x86_64 0.6.1-1.fc22 will be an upgrade
---> Package python3-dnf.noarch 1.1.1-2.fc22 will be upgraded
---> Package python3-dnf.noarch 1.1.2-2.fc22 will be an upgrade
---> Package python-dnf.noarch 1.1.1-2.fc22 will be erased
--> Finished dependency resolution
Dependencies resolved.
langpacks: enabled languages are [u'en', 'es_ES']
=======================================================================================================================================
 Package                                 Arch                   Version                          Repository                       Size
=======================================================================================================================================
Installing:
 python2-dnf                             noarch                 1.1.2-2.fc22                     updates-testing                 445 k
Upgrading:
 dnf                                     noarch                 1.1.2-2.fc22                     updates-testing                 260 k
 dnf-conf                                noarch                 1.1.2-2.fc22                     updates-testing                  87 k
 dnf-plugins-core                        noarch                 0.1.12-2.fc22                    updates-testing                  35 k
 dnf-yum                                 noarch                 1.1.2-2.fc22                     updates-testing                  80 k
 hawkey                                  x86_64                 0.6.1-1.fc22                     updates-testing                  91 k
 python-dnf-plugins-core                 noarch                 0.1.12-2.fc22                    updates-testing                  84 k
 python-hawkey                           x86_64                 0.6.1-1.fc22                     updates-testing                  77 k
 python3-dnf                             noarch                 1.1.2-2.fc22                     updates-testing                 450 k
 python3-hawkey                          x86_64                 0.6.1-1.fc22                     updates-testing                  72 k
Removing:
 python-dnf                              noarch                 1.1.1-2.fc22                     @System                         1.9 M

Transaction Summary
=======================================================================================================================================
Install  1 Package
Upgrade  9 Packages
Remove   1 Package

Total download size: 1.6 M

And finally my system is working properly.
Thank you !.

Comment 15 Michal Luscon 2015-10-02 09:42:36 UTC
*** Bug 1265788 has been marked as a duplicate of this bug. ***

Comment 16 Michal Luscon 2015-10-02 09:53:57 UTC
*** Bug 1266159 has been marked as a duplicate of this bug. ***

Comment 17 Fedora Update System 2015-10-02 15:19:42 UTC
dnf-plugins-core-0.1.12-3.fc23 hawkey-0.6.1-2.fc23 dnf-1.1.2-4.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-38e69423f3

Comment 18 Fedora Update System 2015-10-02 15:24:07 UTC
dnf-plugins-core-0.1.12-3.fc22 hawkey-0.6.1-2.fc22 dnf-1.1.2-4.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2015-3528c659e4

Comment 19 Michal Luscon 2015-10-02 22:22:54 UTC
*** Bug 1266313 has been marked as a duplicate of this bug. ***

Comment 20 Fedora Update System 2015-10-04 01:35:46 UTC
dnf-1.1.2-4.fc22, dnf-plugins-core-0.1.12-3.fc22, hawkey-0.6.1-2.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update hawkey dnf-plugins-core dnf'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-3528c659e4

Comment 21 Fedora Update System 2015-10-04 01:51:41 UTC
dnf-1.1.2-4.fc23, dnf-plugins-core-0.1.12-3.fc23, hawkey-0.6.1-2.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
If you want to test the update, you can install it with
$ su -c 'dnf --enablerepo=updates-testing update hawkey dnf-plugins-core dnf'
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-38e69423f3

Comment 22 Fedora Update System 2015-10-04 19:12:32 UTC
dnf-1.1.2-4.fc23, dnf-plugins-core-0.1.12-3.fc23, hawkey-0.6.1-2.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 23 Fedora Update System 2015-10-05 21:52:02 UTC
dnf-1.1.2-4.fc22, dnf-plugins-core-0.1.12-3.fc22, hawkey-0.6.1-2.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 24 Honza Silhan 2015-10-26 13:02:03 UTC
*** Bug 1274986 has been marked as a duplicate of this bug. ***

Comment 25 Honza Silhan 2015-11-09 13:11:50 UTC
*** Bug 1278233 has been marked as a duplicate of this bug. ***

Comment 26 xenoson 2015-11-16 13:40:13 UTC
This bug is currently preventing a clean upgrade from fc21 to fc22.
# LANG=C dnf system-upgrade download --releasever=22
# LANG=C dnf system-upgrade reboot
works but will cause a reboot loop because the system upgrade will crash with this bug.

A quick fix to get out of the reboot loop is to boot with the kernel parameter:
systemd.unit=multi-user.target
see also:
https://github.com/rpm-software-management/dnf-plugin-system-upgrade#in-case-of-boot-problems 


the workarount to make the upgrade work is
# echo $LANG
remember this!

and set it temporarily to:
# localectl set-locale LANG=C

change it back afterwards
# localectl set-locale LANG=remembered.UTF-8


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