Bug 1504725

Summary: dnf update fails
Product: [Fedora] Fedora Reporter: Kenneth Robinette <support>
Component: nss-softoknAssignee: Kai Engert (:kaie) (inactive account) <kengert>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 26CC: dmach, dueno, elio.maldonado.batiz, ignatenko, jmracek, kdudka, kengert, mhatina, packaging-team-maint, pmatilai, rpm-software-management, rrelyea, vmukhame
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-29 12:19:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Kenneth Robinette 2017-10-20 13:30:41 UTC
Description of problem: dnf update fails with with error messages related to nss


Version-Release number of selected component (if applicable): This is the current Fedora 26 system that is updated often.


How reproducible: Every time


Steps to Reproduce:
1. Run dnf update
2.
3.

Actual results: command fails


Expected results: dnf updating

Additional info:
 dnf update
error: Failed to initialize NSS library
Traceback (most recent call last):
  File "/usr/bin/dnf", line 57, in <module>
    from dnf.cli import main
  File "/usr/lib/python3.6/site-packages/dnf/__init__.py", line 31, in <module>
    import dnf.base
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 29, in <module>
    from dnf.yum import history
  File "/usr/lib/python3.6/site-packages/dnf/yum/history.py", line 31, in <module>
    import dnf.rpm.miscutils
  File "/usr/lib/python3.6/site-packages/dnf/rpm/__init__.py", line 22, in <module>
    from . import transaction
  File "/usr/lib/python3.6/site-packages/dnf/rpm/transaction.py", line 14, in <module>
    import rpm
  File "/usr/lib/python3.6/site-packages/rpm/__init__.py", line 39, in <module>
    from rpm.transaction import *
  File "/usr/lib/python3.6/site-packages/rpm/transaction.py", line 5, in <module>
    from rpm._rpm import ts as TransactionSetCore
ImportError: cannot import name 'ts'


Note that I am running this Fedora 25 i686 system on a Hyper-V system so I can reproduce at will by restoring the system prior to the failure.

I have seen this error several times on www searches, so this is new.  Fedora should fix this!

Comment 1 Igor Gnatenko 2017-10-20 13:34:18 UTC
Well, your system is just broken...

Please use users.org to get end-user help.

Comment 2 Kenneth Robinette 2017-10-20 13:35:50 UTC
The comment "I have seen this error several times on www searches, so this is new" should be:

I have seen this error several times on www searches, so this is not new"

Comment 3 Kenneth Robinette 2017-10-20 13:39:20 UTC
No, This bug has been reported several times going back several years.  THIS BUG NEEDS TP BE FIXED. The above comment must be written by a new person and gives your organization a poor image.

Comment 4 Panu Matilainen 2017-10-23 05:02:20 UTC
> error: Failed to initialize NSS library

This means the NSS crypto library installation on your system has gotten corrupted somehow. 

Typical possibilities include (but not limited to) forced install/remove of a component by sysadmin, interrupted update transaction, packaging- and software bugs. So please realize there are any number of reasons one might end up with that error message, there's no "this bug" to fix.

This is the second time within a week I see this come up so it's quite possible something is up. Looking at recent updates, https://bodhi.fedoraproject.org/updates/FEDORA-2017-621c36fcb8 looks like a very probable smoking gun:

> There is a potential for significant breakage here, because if you try to apply > this update without the nspr update, dnf will skip most of the nss packages due > to dependency issues, but will happily update nss-softokn-freebl ; after this
> update, things that depend on nss (which is lots of important things!) fail to > work. So if this update got pushed stable without the nspr update, we could
> break many many systems. This is why interdependent packages should always go
> in the same update.

Reassigning to NSS: if the above is correct then there's a missing version dependency in there.

Note that recovery requires manually downloading the relevant nss packages and applying with rpm2cpio.

Comment 5 Daiki Ueno 2017-10-23 08:00:49 UTC
Yes, it should be fixed with:
https://bodhi.fedoraproject.org/updates/FEDORA-2017-74d9232ac6

To work around, replace libnssutil3.so with the one from nss-util-3.33.0-1.0.fc26:
wget https://kojipkgs.fedoraproject.org//packages/nss-util/3.33.0/1.0.fc26/i686/nss-util-3.33.0-1.0.fc26.i686.rpm
rpmdev-extract nss-util-3.33.0-1.0.fc26.i686.rpm
sudo cp nss-util-3.33.0-1.0.fc26.i686/usr/lib/libnssutil3.so /usr/lib

Comment 6 Kenneth Robinette 2017-10-23 12:53:22 UTC
The fixed proposed by Daiki Ueno did not resolve the problem.  It produced the error messages:

error: Failed to initialize NSS library
Traceback (most recent call last):
  File "/usr/bin/dnf", line 57, in <module> from dnf.cli import main
  File "/usr/lib/python3.6/site-packages/dnf/__init__.py", line 31, in <module> import dnf.base
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 29, in <module> from dnf.yum import history
  File "/usr/lib/python3.6/site-packages/dnf/yum/history.py", line 31, in <module> import dnf.rpm.miscutils
  File "/usr/lib/python3.6/site-packages/dnf/rpm/__init__.py", line 22, in <module> from . import transaction file "/usr/lib/python3.6/site-packages/dnf/rpm/transaction.py", line 14, in <module> import rpm
  File "/usr/lib/python3.6/site-packages/rpm/__init__.py", line 39, in <module> from rpm.transaction import *  File "/usr/lib/python3.6/site-packages/rpm/transaction.py", line 5, in <module > from rpm._rpm import ts as TransactionSetCore
ImportError: cannot import name 'ts'

Comment 7 Daiki Ueno 2017-10-23 15:45:14 UTC
Could you be more precise?  I would like to clarify:

- Which suggestion did you try: updating to nss-softokn-3.33.0-1.1.fc26 or using the workaround?

- You initially said "This is the current Fedora 26 system", but later "I am running this Fedora 25 i686 system".  Which is correct?

- Are you sure that your system is running i686, not x86_64?

- If possible, could you tell us the exact versions of installed nspr and nss* packages?

Comment 8 Kenneth Robinette 2017-10-23 17:07:04 UTC
1.  I tried the nss-softokn-3.33.0-1.1.fc26 
2.  This is a Fedora 26 system
3.  It is a i686 system
4.  I update our system whenever updates are needed.  Since this system is run  on under Hyper-V, I can restore the system to a point prior to a failure. Therefore I have found the failure happens when I try to update the following:

nss                      i686       3.33.0-1.0.fc26
nss-softokn              i686       3.33.0-1.0.fc26
nss-softokn-freebl       i686       3.33.0-1.0.fc26
nss-sysinit              i686       3.33.0-1.0.fc26
nss-tools                i686       3.33.0-1.0.fc26
nss-util                 i686       3.33.0-1.0.fc26

This started happening the day I submitted the initial problem report.  The day prior I did a dnf update and all updates installed without a problem.  The next day when I did a dnf update I received the error messages I submitted in the problem report.  So whatever caused the problem was caused by the dnf update procedure itself, regardless of what anyone says.

Comment 9 Kenneth Robinette 2017-10-23 18:30:16 UTC
Note that I was able to update nss-util successfully.  Now if I try to update all or any combination of the following I will get the error messages ending with the ImportError: cannot import name 'ts' message:

nss                      i686       3.33.0-1.0.fc26
nss-softokn              i686       3.33.0-1.0.fc26
nss-softokn-freebl       i686       3.33.0-1.0.fc26
nss-sysinit              i686       3.33.0-1.0.fc26
nss-tools                i686       3.33.0-1.0.fc26

Comment 10 Jaroslav Mracek 2017-10-24 06:43:03 UTC
There is a similar report see: https://bugzilla.redhat.com/show_bug.cgi?id=1067443

The solution there was not to import rpm. I would say that application of the solution would be little bit difficult for DNF.

Comment 11 Daiki Ueno 2017-10-24 07:29:44 UTC
So it seems like a different issue.  Changing the status back.

Comment 12 Fedora End Of Life 2018-05-03 07:59:00 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 13 Fedora End Of Life 2018-05-29 12:19:14 UTC
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26
is no longer maintained, which means that it will not receive any
further security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.