Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1303149 - dnf history info failing
Summary: dnf history info failing
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 23
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1302172 1302510 1303470 1303646 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-01-29 16:52 UTC by Isaque Galdino
Modified: 2016-03-26 17:58 UTC (History)
13 users (show)

Fixed In Version: dnf-1.1.6-2.fc23 dnf-1.1.6-2.fc22 dnf-1.1.7-2.fc23 dnf-1.1.7-2.fc24
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-26 17:58:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Isaque Galdino 2016-01-29 16:52:51 UTC
Description of problem:
sudo dnf history info is failing when I try to see any history information.

Version-Release number of selected component (if applicable):
$ dnf --version
1.1.6
  Instalados: dnf-0:1.1.6-1.fc23.noarch em 2016-01-28 21:01
  Construídos    : Fedora Project em 2016-01-26 09:15

  Instalados: rpm-0:4.13.0-0.rc1.7.fc23.x86_64 em 2015-12-21 01:01
  Construídos    : Fedora Project em 2015-11-20 13:08

How reproducible:
Everytime.

Steps to Reproduce:
1. Open a terminal window
2. Enter the following command: sudo dnf history info 1

Actual results:
Last metadata expiration check performed 2:36:42 ago on Fri Jan 29 12:13:12 2016.
Transaction ID : 1
Begin time     : Sun Dec 20 23:00:07 2015
Begin rpmdb    : 1450:038679f4ecb3a27c81539c68f428de6a1e197488
End time       :            23:12:43 2015 (12 minutes)
End rpmdb      : 1461:fc317025642fedf4b6dfc792c5a9042be7b1ad16
User           : xxx
Return-Code    : Success
Transaction performed with:
Traceback (most recent call last):
  File "/bin/dnf", line 57, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 174, in user_main
    errcode = main(args)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 60, in main
    return _main(base, args)
  File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 112, in _main
    cli.run()
  File "/usr/lib/python3.4/site-packages/dnf/cli/cli.py", line 1095, in run
    return self.command.run(self.base.extcmds)
  File "/usr/lib/python3.4/site-packages/dnf/cli/commands/__init__.py", line 1218, in run
    ret = self.output.historyInfoCmd(extcmds)
  File "/usr/lib/python3.4/site-packages/dnf/cli/output.py", line 1536, in historyInfoCmd
    self._historyInfoCmd(tid, pats)
  File "/usr/lib/python3.4/site-packages/dnf/cli/output.py", line 1672, in _historyInfoCmd
    _simple_pkg(hpkg, 4, was_installed=True, pkg_max_len=pkg_max_len)
  File "/usr/lib/python3.4/site-packages/dnf/cli/output.py", line 1575, in _simple_pkg
    elif ipkgs[-1] > hpkg:
  File "/usr/lib64/python3.4/functools.py", line 125, in _lt_from_le
    op_result = self.__le__(other)
  File "/usr/lib/python3.4/site-packages/dnf/yum/history.py", line 166, in __le__
    o = other.to_nevra()
AttributeError: 'Package' object has no attribute 'to_nevra'

Expected results:
Show detailed history information.

Additional info:

Comment 1 Martin Ueding 2016-01-30 14:09:50 UTC
This is a duplicate of 1302172.

Comment 2 Honza Silhan 2016-02-01 12:24:49 UTC
*** Bug 1302172 has been marked as a duplicate of this bug. ***

Comment 3 Honza Silhan 2016-02-01 13:04:43 UTC
*** Bug 1302510 has been marked as a duplicate of this bug. ***

Comment 4 Michal Domonkos 2016-02-01 13:42:33 UTC
*** Bug 1303470 has been marked as a duplicate of this bug. ***

Comment 5 Parag Nemade 2016-02-01 15:27:24 UTC
*** Bug 1303646 has been marked as a duplicate of this bug. ***

Comment 6 Honza Silhan 2016-02-03 13:00:37 UTC
Fixed in the upstream [1], new release should be soon.

[1] https://github.com/rpm-software-management/dnf/commit/c9217ab14cc5bee85d5a93d8a8b740651cc99aee

Comment 7 Fedora Update System 2016-02-03 13:03:48 UTC
dnf-1.1.6-2.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-10da20f298

Comment 8 Fedora Update System 2016-02-03 13:05:44 UTC
dnf-1.1.6-2.fc22 dnf-plugins-core-0.1.16-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-573eba7b37

Comment 9 Fedora Update System 2016-02-03 13:05:44 UTC
dnf-1.1.6-2.fc22 dnf-plugins-core-0.1.16-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-573eba7b37

Comment 10 Fedora Update System 2016-02-03 22:59:40 UTC
dnf-1.1.6-2.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-10da20f298

Comment 11 Fedora Update System 2016-02-03 23:26:27 UTC
dnf-1.1.6-2.fc22, dnf-plugins-core-0.1.16-1.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-573eba7b37

Comment 12 Martin Ueding 2016-02-04 11:23:52 UTC
I just set up a Fedora 23 VM using netinstall to see whether the update fixes the issue. For some reason `dnf history info 2` worked with dnf 1.1.6-1 (the old version) just fine. Perhaps the history is not that large and that corner case did not happen there?

The machine that the error occurred for me is my production machine, I am a bit reluctant to test an update to the package manager there :-/.

Comment 13 Michal Luscon 2016-02-04 11:29:59 UTC
You can copy your /var/lib/dnf/history/ from production machine and try the fix inside VM.

Comment 14 Martin Ueding 2016-02-04 13:33:37 UTC
I deleted everything under `/var/lib/dnf/history/` in the virtual machine and
copied the files from the production machine into that directly. Running `dnf
history` then gave me the whole list of transactions. Drilling down to the
interesting transaction with `dnf history info awesome` got me a different
error this time:

    Die letzte Prüfung auf abgelaufene Metadaten wurde vor 2:26:23 am Thu Feb  4 11:58:59 2016 ausgeführt.
    Transaktions-ID : 208
    Anfangszeit : Tue Feb  2 18:49:02 2016
    Anfang rpmdb    : 4505:34e2a6f6c0fc4e4d27680558756611f14f9ce9da
    Endzeit :            18:49:04 2016 (2 Sekunden)
    Ende rpmdb      : 4505:0ed8145a64bab51edc89131dcfe27d2899c84cb8
    Benutzer : Martin Ueding <mu>
    Rückgabe-Code    : Erfolg
    Befehlszeile   : update awesome --enablerepo=updates-testing
    Transaktion ausgeführt mit:
        Aktualisiert      dnf-1.1.6-1.fc23.noarch         @updates
        Installiert       rpm-4.13.0-0.rc1.10.fc23.x86_64 @updates
    Veränderte Pakete:
    Traceback (most recent call last):
      File "/usr/bin/dnf", line 57, in <module>
        main.user_main(sys.argv[1:], exit_code=True)
      File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 174, in user_main
        errcode = main(args)
      File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 60, in main
        return _main(base, args)
      File "/usr/lib/python3.4/site-packages/dnf/cli/main.py", line 112, in _main
        cli.run()
      File "/usr/lib/python3.4/site-packages/dnf/cli/cli.py", line 1095, in run
        return self.command.run(self.base.extcmds)
      File "/usr/lib/python3.4/site-packages/dnf/cli/commands/__init__.py", line 1218, in run
        ret = self.output.historyInfoCmd(extcmds)
      File "/usr/lib/python3.4/site-packages/dnf/cli/output.py", line 1536, in historyInfoCmd
        self._historyInfoCmd(tid, pats)
      File "/usr/lib/python3.4/site-packages/dnf/cli/output.py", line 1674, in _historyInfoCmd
        self.historyInfoCmdPkgsAltered(old, pats)
      File "/usr/lib/python3.4/site-packages/dnf/cli/output.py", line 1749, in historyInfoCmdPkgsAltered
        x, m, u = dnf.yum.packages.parsePackages([hpkg], pats)
      File "/usr/lib/python3.4/site-packages/dnf/yum/packages.py", line 76, in parsePackages
        exactmatch.update(pkgdict[command])
    TypeError: unhashable type: 'YumHistoryPackageState'

That bug has already been reported as #1245121.

Then I tried this same thing on my production machine with the old dnf
(1.1.6-1) and get the same error, nothing about `to_nevra`. So this `to_nevra`
bug only occurs for certain transactions. Presumably the update of awesome
using `--enablerepo=updates-testing` has created some different transaction and
therefore there is some other error.

A thing which does make a difference is the history for git. When I do `dnf
history info git` on the old dnf version, I get the `to_nevra`-error on both
the VM (I downgraded dnf for testing) and the production machine. After
upgrading dnf to 1.1.6-2 again the error changed from `to_nevra` to this
`YumHistoryPackageState` error.

So presumably the `to_nevra` bug is fixed now and the `YumHistoryPackageState`
is just independet of that. Shall I give a +1 on Bodhi for this update, then?

Comment 15 Fedora Update System 2016-02-04 23:21:25 UTC
dnf-1.1.6-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 16 Fedora Update System 2016-02-17 04:21:45 UTC
dnf-1.1.6-2.fc22, dnf-plugins-core-0.1.16-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 17 Fedora Update System 2016-02-25 13:53:00 UTC
dnf-plugins-core-0.1.17-1.fc23 dnf-1.1.7-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-0123ce82c1

Comment 18 Fedora Update System 2016-02-25 13:56:03 UTC
dnf-plugins-core-0.1.17-1.fc22 dnf-1.1.7-1.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-f673381075

Comment 19 Fedora Update System 2016-03-09 17:19:27 UTC
dnf-1.1.7-2.fc23 dnf-plugins-core-0.1.17-1.fc23 libsolv-0.6.19-2.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-0123ce82c1

Comment 20 Fedora Update System 2016-03-09 17:21:16 UTC
dnf-1.1.7-2.fc22 dnf-plugins-core-0.1.17-1.fc22 libsolv-0.6.19-2.fc22 has been submitted as an update to Fedora 22. https://bodhi.fedoraproject.org/updates/FEDORA-2016-f673381075

Comment 21 Fedora Update System 2016-03-10 16:52:40 UTC
dnf-1.1.7-2.fc22, dnf-plugins-core-0.1.17-1.fc22, libsolv-0.6.19-2.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-f673381075

Comment 22 Fedora Update System 2016-03-10 16:54:16 UTC
dnf-1.1.7-2.fc23, dnf-plugins-core-0.1.17-1.fc23, libsolv-0.6.19-2.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-0123ce82c1

Comment 23 Fedora Update System 2016-03-13 23:54:43 UTC
dnf-1.1.7-2.fc23, dnf-plugins-core-0.1.17-1.fc23, libsolv-0.6.19-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 24 Fedora Update System 2016-03-19 12:15:44 UTC
dnf-1.1.7-2.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-c030d24231

Comment 25 Fedora Update System 2016-03-20 03:57:37 UTC
dnf-1.1.7-2.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-c030d24231

Comment 26 Fedora Update System 2016-03-26 17:57:29 UTC
dnf-1.1.7-2.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.


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