Bug 1417787 - dnf throws error after a successful upgrade
Summary: dnf throws error after a successful upgrade
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 25
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-31 01:49 UTC by M. Edward (Ed) Borasky
Modified: 2017-02-07 21:25 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-02-06 12:40:46 UTC
Type: Bug


Attachments (Terms of Use)

Description M. Edward (Ed) Borasky 2017-01-31 01:49:59 UTC
Description of problem: I did a dnf upgrade, which worked. Then I did a dnf check-update, which threw an error. Now all the dnf operations thrown errors!


Version-Release number of selected component (if applicable): can't tell - it throws errors!


How reproducible: happens every time.


Steps to Reproduce:
1. sudo dnf upgrade kernel-*
2. dnf check-update

Actual results:

$ sudo dnf upgrade kernel-*
Last metadata expiration check: 0:50:10 ago on Mon Jan 30 16:46:04 2017.
Dependencies resolved.
========================================================================================================================
 Package                             Arch                  Version                         Repository              Size
========================================================================================================================
Installing:
 kernel-core                         x86_64                4.9.6-200.fc25                  updates                 20 M
 kernel-debug-devel                  x86_64                4.9.6-200.fc25                  updates                 11 M
 kernel-devel                        x86_64                4.9.6-200.fc25                  updates                 11 M
 kernel-modules                      x86_64                4.9.6-200.fc25                  updates                 22 M
 kernel-modules-extra                x86_64                4.9.6-200.fc25                  updates                2.2 M
Upgrading:
 kernel-headers                      x86_64                4.9.6-200.fc25                  updates                1.1 M
 kernel-tools                        x86_64                4.9.6-200.fc25                  updates                203 k
 kernel-tools-libs                   x86_64                4.9.6-200.fc25                  updates                102 k

Transaction Summary
========================================================================================================================
Install  5 Packages
Upgrade  3 Packages

Total download size: 68 M
Is this ok [y/N]: y
Downloading Packages:
[MIRROR] kernel-debug-devel-4.9.5-200.fc25_4.9.6-200.fc25.x86_64.drpm: Status code: 404 for http://mirror.uoregon.edu/fedora/linux/updates/25/x86_64/drpms/kernel-debug-devel-4.9.5-200.fc25_4.9.6-200.fc25.x86_64.drpm
[MIRROR] kernel-devel-4.9.5-200.fc25_4.9.6-200.fc25.x86_64.drpm: Status code: 404 for http://mirror.uoregon.edu/fedora/linux/updates/25/x86_64/drpms/kernel-devel-4.9.5-200.fc25_4.9.6-200.fc25.x86_64.drpm
[MIRROR] kernel-headers-4.9.5-200.fc25_4.9.6-200.fc25.x86_64.drpm: Status code: 404 for http://mirror.uoregon.edu/fedora/linux/updates/25/x86_64/drpms/kernel-headers-4.9.5-200.fc25_4.9.6-200.fc25.x86_64.drpm
(1/8): kernel-headers-4.9.5-200.fc25_4.9.6-200.fc25.x86_64.drpm                         363 kB/s | 198 kB     00:00    
(2/8): kernel-devel-4.9.5-200.fc25_4.9.6-200.fc25.x86_64.drpm                           1.8 MB/s | 2.6 MB     00:01    
(3/8): kernel-debug-devel-4.9.5-200.fc25_4.9.6-200.fc25.x86_64.drpm                     1.5 MB/s | 2.6 MB     00:01    
(4/8): kernel-modules-extra-4.9.6-200.fc25.x86_64.rpm                                   2.1 MB/s | 2.2 MB     00:01    
(5/8): kernel-tools-4.9.6-200.fc25.x86_64.rpm                                           1.7 MB/s | 203 kB     00:00    
(6/8): kernel-tools-libs-4.9.6-200.fc25.x86_64.rpm                                      997 kB/s | 102 kB     00:00    
(7/8): kernel-core-4.9.6-200.fc25.x86_64.rpm                                            2.5 MB/s |  20 MB     00:07    
(8/8): kernel-modules-4.9.6-200.fc25.x86_64.rpm                                         2.9 MB/s |  22 MB     00:07    
[DRPM] kernel-headers-4.9.5-200.fc25_4.9.6-200.fc25.x86_64.drpm: done                                                  
[DRPM] kernel-debug-devel-4.9.5-200.fc25_4.9.6-200.fc25.x86_64.drpm: done                                              
[DRPM] kernel-devel-4.9.5-200.fc25_4.9.6-200.fc25.x86_64.drpm: done                                                    
------------------------------------------------------------------------------------------------------------------------
Total                                                                                   3.8 MB/s |  50 MB     00:13     
Delta RPMs reduced 67.7 MB of updates to 49.9 MB (26.1% saved)
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Installing  : kernel-core-4.9.6-200.fc25.x86_64                                                                  1/11 
  Installing  : kernel-modules-4.9.6-200.fc25.x86_64                                                               2/11 
  Upgrading   : kernel-tools-libs-4.9.6-200.fc25.x86_64                                                            3/11 
  Upgrading   : kernel-tools-4.9.6-200.fc25.x86_64                                                                 4/11 
  Installing  : kernel-modules-extra-4.9.6-200.fc25.x86_64                                                         5/11 
  Upgrading   : kernel-headers-4.9.6-200.fc25.x86_64                                                               6/11 
  Installing  : kernel-devel-4.9.6-200.fc25.x86_64                                                                 7/11 
  Installing  : kernel-debug-devel-4.9.6-200.fc25.x86_64                                                           8/11 
  Cleanup     : kernel-headers-4.9.5-200.fc25.x86_64                                                               9/11 
  Cleanup     : kernel-tools-4.9.5-200.fc25.x86_64                                                                10/11 
  Cleanup     : kernel-tools-libs-4.9.5-200.fc25.x86_64                                                           11/11 
  Verifying   : kernel-core-4.9.6-200.fc25.x86_64                                                                  1/11 
  Verifying   : kernel-debug-devel-4.9.6-200.fc25.x86_64                                                           2/11 
  Verifying   : kernel-devel-4.9.6-200.fc25.x86_64                                                                 3/11 
  Verifying   : kernel-modules-4.9.6-200.fc25.x86_64                                                               4/11 
  Verifying   : kernel-modules-extra-4.9.6-200.fc25.x86_64                                                         5/11 
  Verifying   : kernel-headers-4.9.6-200.fc25.x86_64                                                               6/11 
  Verifying   : kernel-tools-4.9.6-200.fc25.x86_64                                                                 7/11 
  Verifying   : kernel-tools-libs-4.9.6-200.fc25.x86_64                                                            8/11 
  Verifying   : kernel-tools-4.9.5-200.fc25.x86_64                                                                 9/11 
  Verifying   : kernel-tools-libs-4.9.5-200.fc25.x86_64                                                           10/11 
  Verifying   : kernel-headers-4.9.5-200.fc25.x86_64                                                              11/11 

Installed:
  kernel-core.x86_64 4.9.6-200.fc25     kernel-debug-devel.x86_64 4.9.6-200.fc25    kernel-devel.x86_64 4.9.6-200.fc25 
  kernel-modules.x86_64 4.9.6-200.fc25  kernel-modules-extra.x86_64 4.9.6-200.fc25 

Upgraded:
  kernel-headers.x86_64 4.9.6-200.fc25   kernel-tools.x86_64 4.9.6-200.fc25   kernel-tools-libs.x86_64 4.9.6-200.fc25  

Complete!
$ sudo dnf check-update 
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/lib64/python3.5/hashlib.py", line 240, in <module>
    func = __get_hash(__func_name)
  File "/usr/lib64/python3.5/hashlib.py", line 117, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "/usr/lib64/python3.5/hashlib.py", line 240, in <module>
    func = __get_hash(__func_name)
  File "/usr/lib64/python3.5/hashlib.py", line 117, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
  File "/usr/lib64/python3.5/hashlib.py", line 240, in <module>
    func = __get_hash(__func_name)
  File "/usr/lib64/python3.5/hashlib.py", line 117, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
  File "/usr/lib64/python3.5/hashlib.py", line 240, in <module>
    func = __get_hash(__func_name)
  File "/usr/lib64/python3.5/hashlib.py", line 117, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
  File "/usr/lib64/python3.5/hashlib.py", line 240, in <module>
    func = __get_hash(__func_name)
  File "/usr/lib64/python3.5/hashlib.py", line 117, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
  File "/usr/lib64/python3.5/hashlib.py", line 240, in <module>
    func = __get_hash(__func_name)
  File "/usr/lib64/python3.5/hashlib.py", line 117, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
Traceback (most recent call last):
  File "/bin/dnf", line 57, in <module>
    from dnf.cli import main
  File "/usr/lib/python3.5/site-packages/dnf/__init__.py", line 23, in <module>
    import dnf.exceptions
  File "/usr/lib/python3.5/site-packages/dnf/exceptions.py", line 21, in <module>
    from dnf.i18n import ucd
  File "/usr/lib/python3.5/site-packages/dnf/i18n.py", line 22, in <module>
    from dnf.pycomp import unicode
  File "/usr/lib/python3.5/site-packages/dnf/pycomp.py", line 24, in <module>
    import email.mime.text
  File "/usr/lib64/python3.5/email/mime/text.py", line 10, in <module>
    from email.mime.nonmultipart import MIMENonMultipart
  File "/usr/lib64/python3.5/email/mime/nonmultipart.py", line 10, in <module>
    from email.mime.base import MIMEBase
  File "/usr/lib64/python3.5/email/mime/base.py", line 9, in <module>
    from email import message
  File "/usr/lib64/python3.5/email/message.py", line 16, in <module>
    from email import utils
  File "/usr/lib64/python3.5/email/utils.py", line 28, in <module>
    import random
  File "/usr/lib64/python3.5/random.py", line 45, in <module>
    from hashlib import sha512 as _sha512
ImportError: cannot import name 'sha512'

Expected results: dnf working


Additional info:

Comment 1 Michael Mráka 2017-01-31 10:20:43 UTC
It seems like an issue with your python installation.

What's the version of dnf?
Can you run following test?

# python3 <<EOF
from hashlib import md5
from hashlib import sha512
from hashlib import sha1
from hashlib import sha224
from hashlib import sha256
from hashlib import sha384

c = md5()
c.update(b"xzy")
print(c.hexdigest())
EOF

Comment 2 M. Edward (Ed) Borasky 2017-01-31 21:06:43 UTC
I can't seem to reproduce this. I think it's fallout from me trying to work around Bug 1417431. Essentially I was doing repeated "dnf check-update", upgrading packages in chunks to upgrade everything *except* the messed-up mesa packages. At some point in this process, dnf broke as shown above.

I've built a virtual machine to test this on, since the other bug essentially forces a reinstall or other shenanigans to get a desktop again. So you can close this as "unable to reproduce". It may be fallout from the attempts to clean up the repositories. If it comes back (in the virtual machine) I'll re-open.

Comment 3 m4xl3s 2017-02-07 21:25:21 UTC
I just had the same issue in fedora 25 after a system updating with "sudo dnf update", so by searching the bug I've found the solution (http://forums.fedoraforum.org/showthread.php?t=277702) that seem to be related with the lib64.so.5 file.

This is the output that I got by running "sudo dnf update" 
Traceback (most recent call last):
  File "/bin/dnf", line 57, in <module>
    from dnf.cli import main
  File "/usr/lib/python3.5/site-packages/dnf/__init__.py", line 31, in <module>
    import dnf.base
  File "/usr/lib/python3.5/site-packages/dnf/base.py", line 26, in <module>
    from dnf.comps import CompsQuery
  File "/usr/lib/python3.5/site-packages/dnf/comps.py", line 29, in <module>
    import dnf.util
  File "/usr/lib/python3.5/site-packages/dnf/util.py", line 31, in <module>
    import librepo
  File "/usr/lib64/python3.5/site-packages/librepo/__init__.py", line 1070, in <module>
    import librepo._librepo
ImportError: /lib64/libpsl.so.5: file too short

SOLUTION: (which work for me)
1. search the "libpsl.so" file
bash-4.3$ /lib64/libpsl*
lrwxrwxrwx. 1 root root    15 ene 17 01:42 /lib64/libpsl.so.5 -> libpsl.so.5.1.1
-rwxr-xr-x. 1 root root 51984 nov  4 01:30 /lib64/libpsl.so.5.0.1
-rwxr-xr-x. 1 root root     0 ene 17 01:42 /lib64/libpsl.so.5.1.1
2. remove the actual "libpsl.so.5" and link it with the lower version like so:
bash-4.3$ sudo rm /lib64/libpsl.so.5
bash-4.3$ sudo ln /lib64/libpsl.so.5.0.1 /lib64/libpsl.so.5
3. Verify that the file is linked
bash-4.3$ ls -l /lib64/libpsl*
-rwxr-xr-x. 2 root root 51984 nov 4 01:30 /lib64/libpsl.so.5 ->  libpsl.so.5.0.1
-rwxr-xr-x. 2 root root 51984 nov  4 01:30 /lib64/libpsl.so.5.0.1
-rwxr-xr-x. 1 root root     0 ene 17 01:42 /lib64/libpsl.so.5.1.1
4. and run your dnf line
bash-4.3$ sudo dnf update

PD:sorry about my english :/


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