Bug 1303149 - dnf history info failing
dnf history info failing
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
23
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: packaging-team-maint
Fedora Extras Quality Assurance
: Reopened
: 1302172 1302510 1303470 1303646 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-29 11:52 EST by Isaque Galdino
Modified: 2016-03-26 13:58 EDT (History)
13 users (show)

See Also:
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:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-03-26 13:58:02 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 Isaque Galdino 2016-01-29 11:52:51 EST
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 09:09:50 EST
This is a duplicate of 1302172.
Comment 2 Honza Silhan 2016-02-01 07:24:49 EST
*** Bug 1302172 has been marked as a duplicate of this bug. ***
Comment 3 Honza Silhan 2016-02-01 08:04:43 EST
*** Bug 1302510 has been marked as a duplicate of this bug. ***
Comment 4 Michal Domonkos 2016-02-01 08:42:33 EST
*** Bug 1303470 has been marked as a duplicate of this bug. ***
Comment 5 Parag Nemade 2016-02-01 10:27:24 EST
*** Bug 1303646 has been marked as a duplicate of this bug. ***
Comment 6 Honza Silhan 2016-02-03 08:00:37 EST
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 08:03:48 EST
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 08:05:44 EST
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 08:05:44 EST
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 17:59:40 EST
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 18:26:27 EST
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 06:23:52 EST
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 06:29:59 EST
You can copy your /var/lib/dnf/history/ from production machine and try the fix inside VM.
Comment 14 Martin Ueding 2016-02-04 08:33:37 EST
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 18:21:25 EST
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-16 23:21:45 EST
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 08:53:00 EST
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 08:56:03 EST
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 12:19:27 EST
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 12:21:16 EST
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 11:52:40 EST
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 11:54:16 EST
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 19:54:43 EDT
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 08:15:44 EDT
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-19 23:57:37 EDT
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 13:57:29 EDT
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.