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 - 'dnf history info' is broken -> AttributeError: 'Package' object has no attribute 'to_nevra'
Summary: 'dnf history info' is broken -> AttributeError: 'Package' object has no attri...
Keywords:
Status: CLOSED DUPLICATE of bug 1303149
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-01 15:02 UTC by Adam Miller
Modified: 2016-02-01 15:43 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-01 15:27:24 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

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'


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