Bug 1262082 - 'ascii' codec can't decode byte 0xc3 in position 40: ordinal not in range(128)
'ascii' codec can't decode byte 0xc3 in position 40: ordinal not in range(128)
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
22
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Honza Silhan
Fedora Extras Quality Assurance
:
: 1264587 1265788 1266159 1266313 1274986 1278233 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-10 14:58 EDT by William Moreno
Modified: 2015-11-16 08:40 EST (History)
18 users (show)

See Also:
Fixed In Version: dnf-1.1.2-4.fc23 dnf-1.1.2-4.fc22
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-10-04 15:13:20 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description William Moreno 2015-09-10 14:58:02 EDT
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 05:58:24 EDT
Thanks for the report.
Comment 2 Pablo Iranzo Gómez 2015-09-18 09:51:40 EDT
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 09:52:27 EDT
Is there any test package for this to validate the fix and apply it?
Comment 4 Pablo Iranzo Gómez 2015-09-18 09:59:15 EDT
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-18 20:08:24 EDT
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 04:50:57 EDT
*** Bug 1264587 has been marked as a duplicate of this bug. ***
Comment 8 Honza Silhan 2015-09-22 07:51:21 EDT
Pablo Iranzo Gómez: dnf-1.1.2
Comment 9 Fedora Update System 2015-09-22 11:01:33 EDT
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 11:03:24 EDT
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 14:27:43 EDT
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-22 23:54:54 EDT
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 17:22:46 EDT
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 09:41:26 EDT
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 05:42:36 EDT
*** Bug 1265788 has been marked as a duplicate of this bug. ***
Comment 16 Michal Luscon 2015-10-02 05:53:57 EDT
*** Bug 1266159 has been marked as a duplicate of this bug. ***
Comment 17 Fedora Update System 2015-10-02 11:19:42 EDT
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 11:24:07 EDT
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 18:22:54 EDT
*** Bug 1266313 has been marked as a duplicate of this bug. ***
Comment 20 Fedora Update System 2015-10-03 21:35:46 EDT
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-03 21:51:41 EDT
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 15:12:32 EDT
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 17:52:02 EDT
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 09:02:03 EDT
*** Bug 1274986 has been marked as a duplicate of this bug. ***
Comment 25 Honza Silhan 2015-11-09 08:11:50 EST
*** Bug 1278233 has been marked as a duplicate of this bug. ***
Comment 26 xenoson 2015-11-16 08:40:13 EST
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.