Bug 867553

Summary: traceback with "dnf erase <package-nvra>"
Product: [Fedora] Fedora Reporter: Joachim Backes <joachim.backes>
Component: dnfAssignee: Ales Kozumplik <akozumpl>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: akozumpl, jzeleny
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-0.2.15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-25 09:45:16 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 Joachim Backes 2012-10-17 17:26:58 UTC
Description of problem:
Situation

rpm -q kernel
kernel-3.6.1-2.fc18.x86_64
kernel-3.6.2-2.fc18.x86_64


Now I try to erase kernel-3.6.1-2.fc18.x86_64 and kernel-devel-3.6.1-2.fc18.x86_64 (which is installed too) with dnf (curiosity):

sudo dnf erase  kernel-3.6.1-2.fc18.x86_64 kernel-devel-3.6.1-2.fc18.x86_64
Setting up Remove Process
Traceback (most recent call last):
  File "/bin/dnf", line 35, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/yummain.py", line 316, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/yummain.py", line 140, in main
    result, resultmsgs = base.doCommands()
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 483, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  File "/usr/lib/python2.7/site-packages/dnf/cli/yumcommands.py", line 717, in doCommand
    return base.erasePkgs(extcmds)
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1020, in erasePkgs
    self._checkMaybeYouMeant(arg, always_output=False, rpmdb_only=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 715, in _checkMaybeYouMeant
    self.returnInstalledPackagesByDep(arg))):
  File "/usr/lib/python2.7/site-packages/dnf/yum/__init__.py", line 3140, in returnInstalledPackagesByDep
    return self.rpmdb.getProvides(depname, depflags, depver).keys()
AttributeError: 'YumBaseCli' object has no attribute 'rpmdb'

Version-Release number of selected component (if applicable):
dnf-0.2.13-1.gitda60a96.fc18.noarch

How reproducible:


Steps to Reproduce:
1.sudo dnf erase kernel-3.6.1-2.fc18.x86_64 kernel-devel-3.6.1-2.fc18.x86_64
2.
3.
  
Actual results:
See description

Expected results:
packeges deleted

Additional info:

Tried a second time:

sudo dnf erase  kernel-3.6.1-2.fc18.x86_64 kernel-devel-3.6.1-2.fc18.x86_64
BDB2053 Freeing read locks for locker 0xef5: 16506/140569054693312
BDB2053 Freeing read locks for locker 0xef6: 16506/140569054693312
BDB2053 Freeing read locks for locker 0xef7: 16506/140569054693312
BDB2053 Freeing read locks for locker 0xef8: 16506/140569054693312
Setting up Remove Process
Traceback (most recent call last):
  File "/bin/dnf", line 35, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/yummain.py", line 316, in user_main
    errcode = main(args)
  File "/usr/lib/python2.7/site-packages/dnf/cli/yummain.py", line 140, in main
    result, resultmsgs = base.doCommands()
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 483, in doCommands
    return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)
  File "/usr/lib/python2.7/site-packages/dnf/cli/yumcommands.py", line 717, in doCommand
    return base.erasePkgs(extcmds)
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 1020, in erasePkgs
    self._checkMaybeYouMeant(arg, always_output=False, rpmdb_only=True)
  File "/usr/lib/python2.7/site-packages/dnf/cli/cli.py", line 715, in _checkMaybeYouMeant
    self.returnInstalledPackagesByDep(arg))):
  File "/usr/lib/python2.7/site-packages/dnf/yum/__init__.py", line 3140, in returnInstalledPackagesByDep
    return self.rpmdb.getProvides(depname, depflags, depver).keys()
AttributeError: 'YumBaseCli' object has no attribute 'rpmdb'

Comment 1 Ales Kozumplik 2012-10-18 09:19:41 UTC
*** Bug 867552 has been marked as a duplicate of this bug. ***

Comment 2 Ales Kozumplik 2012-10-18 09:50:54 UTC
Thank you for the report.

This is a valid problem, reproducible whenever a full N(E)VRA of a package for deletion is specified, not just kernel:

dnf erase xguest-1.0.10-4.fc17.noarch

Looking for a fix now.

Comment 3 Ales Kozumplik 2012-10-22 09:25:42 UTC
Master commit b2bb94c deals with this issue for the erase command. I'm also working on a support for full NEVRA specification for update and install.