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 1303646

Summary: 'dnf history info' is broken -> AttributeError: 'Package' object has no attribute 'to_nevra'
Product: [Fedora] Fedora Reporter: Adam Miller <admiller>
Component: dnfAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: jsilhan, mluscon, packaging-team-maint, pnemade, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-01 15:27:24 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 Adam Miller 2016-02-01 15:02:30 UTC
Description of problem:

+$ dnf history info 52
Last metadata expiration check performed 1:20:52 ago on Mon Feb  1 07:39:09 2016.
Transaction ID : 52
Begin time     : Mon Feb  1 08:37:50 2016
Begin rpmdb    : 3025:57770e402e162c9945ce164dfeb258cb2aa5be10
End time       :            08:39:50 2016 (120 seconds)
End rpmdb      : 3025:6002789ad248c4f8b00467fbe65adc5a3dad7d38
User           : Adam Miller <admiller>
Return-Code    : Success
Command Line   : update
Transaction performed with:
    Installed     dnf-1.1.6-1.fc23.noarch        @updates
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 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'


Version-Release number of selected component (if applicable):

dnf-1.1.6-1.fc23.noarch

Comment 1 Adam Miller 2016-02-01 15:10:06 UTC
This might actually be SELinux related.


Feb 01 09:00:05 pseudogen setroubleshoot[9307]: failed to retrieve rpm info for /var/cache/dnf/updates-e042e478e0621ea6/repodata
Feb 01 09:00:05 pseudogen setroubleshoot[9307]: SELinux is preventing find from read access on the directory /var/cache/dnf/updates-e042e478e0621ea6/repodata. For complete SELinux messages. run sealert -l 3753f9f4-15b8-47ab-843f-f605185c77
Feb 01 09:00:05 pseudogen python3[9307]: SELinux is preventing find from read access on the directory /var/cache/dnf/updates-e042e478e0621ea6/repodata.
                                         
                                         *****  Plugin restorecon (99.5 confidence) suggests   ************************
                                         
                                         If you want to fix the label. 
                                         /var/cache/dnf/updates-e042e478e0621ea6/repodata default label should be rpm_var_cache_t.
                                         Then you can run restorecon.
                                         Do
                                         # /sbin/restorecon -v /var/cache/dnf/updates-e042e478e0621ea6/repodata
                                         
                                         *****  Plugin catchall (1.49 confidence) suggests   **************************
                                         
                                         If you believe that find should be allowed read access on the repodata directory by default.
                                         Then you should report this as a bug.
                                         You can generate a local policy module to allow this access.
                                         Do
                                         allow this access for now by executing:
                                         # grep find /var/log/audit/audit.log | audit2allow -M mypol
                                         # semodule -i mypol.pp

Comment 2 Parag Nemade 2016-02-01 15:27:24 UTC
This is duplicate of bug 1303149. Good to discuss on that bug.

*** This bug has been marked as a duplicate of bug 1303149 ***

Comment 3 Adam Miller 2016-02-01 15:43:31 UTC
I did a restorecon, the SELinux error is gone but the issue with dnf is still present:

+$ dnf history info 52
Last metadata expiration check performed 1:59:06 ago on Mon Feb  1 07:39:09 2016.
Transaction ID : 52
Begin time     : Mon Feb  1 08:37:50 2016
Begin rpmdb    : 3025:57770e402e162c9945ce164dfeb258cb2aa5be10
End time       :            08:39:50 2016 (120 seconds)
End rpmdb      : 3025:6002789ad248c4f8b00467fbe65adc5a3dad7d38
User           : Adam Miller <admiller>
Return-Code    : Success
Command Line   : update
Transaction performed with:
    Installed     dnf-1.1.6-1.fc23.noarch        @updates
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 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'