Modify

Ticket #1055 (closed defect: invalid)

Opened 11 years ago

Last modified 7 years ago

Remove configuration elements (-r) generates a python traceback

Reported by: https://www.google.com/accounts/o8/id?id=AItOawlIm5EgGLqOqGEr7NnQwG0NBPWGKgiWMEo Owned by: solj
Priority: major Milestone: Bcfg2 1.3.5 Release (Bugfix)
Component: bcfg2-client Version: 1.0
Keywords: Cc: [email protected]

Description

When running the following command:

sudo bcfg2 -vq -r packages

bcfg2 generates the following error:

/usr/lib/pymodules/python2.6/Bcfg2/Client/Tools/APT.py:170: DeprecationWarning: Deprecated, please use 'mark_delete()' instead
  self.pkg_cache[pkg].markDelete(purge=True)
/usr/lib/pymodules/python2.6/Bcfg2/Client/Tools/APT.py:173: DeprecationWarning: Deprecated, please use 'mark_delete()' instead
  self.pkg_cache[pkg].markDelete()
APT.Remove() failed
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.6/Bcfg2/Client/Frame.py", line 356, in Remove
    tool.Remove(extras)
  File "/usr/lib/pymodules/python2.6/Bcfg2/Client/Tools/APT.py", line 173, in Remove
    self.pkg_cache[pkg].markDelete()
  File "/usr/lib/python2.6/dist-packages/apt/deprecation.py", line 78, in deprecated_function
    return func(*args, **kwds)
  File "/usr/lib/python2.6/dist-packages/apt/deprecation.py", line 98, in deprecated_function
    return func(*args, **kwds)
  File "/usr/lib/python2.6/dist-packages/apt/package.py", line 1190, in mark_delete
    fix.resolve()
SystemError: E:Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

The specific package that it seems to be choking on (line 171 APT.py) is defoma.

Setup:

  • Ubuntu-10.10
  • bcfg2 1.1.1-1~maverick1 (installed via PPA)

Attachments

Change History

comment:1 Changed 11 years ago by solj

  • Owner changed from desai to solj
  • Status changed from new to accepted

Can you try this and see if it prevents the traceback?

diff --git a/src/lib/Client/Tools/APT.py b/src/lib/Client/Tools/APT.py
index 34fb812..693ee1b 100644
--- a/src/lib/Client/Tools/APT.py
+++ b/src/lib/Client/Tools/APT.py
@@ -191,6 +191,10 @@ class APT(Bcfg2.Client.Tools.Tool):
                     self.pkg_cache[pkg].markDelete(purge=True)
                 except:
                     self.pkg_cache[pkg].markDelete()
+                except SystemError:
+                    e = sys.exc_info()[1]
+                    self.logger.error("Failed to remove %s: %s" % (pkg, e))
+                    pass
             try:
                 self.pkg_cache.commit()
             except SystemExit

comment:2 Changed 11 years ago by solj

comment:3 Changed 11 years ago by solj

  • Milestone changed from Bcfg2 1.2.1 Release (Bugfix) to Bcfg2 1.2.2 Release (Bugfix)

Moving to 1.2.2.

comment:4 Changed 11 years ago by solj

  • Milestone changed from Bcfg2 1.2.2 Release (Bugfix) to Bcfg2 1.2.3 Release (Bugfix)

Moving to 1.2.3

comment:5 Changed 10 years ago by solj

  • Milestone changed from Bcfg2 1.2.3 Release (Bugfix) to Bcfg2 1.3.0 Release

Moving to 1.3

comment:6 Changed 10 years ago by solj

  • Milestone changed from Bcfg2 1.3.0 Release to Bcfg2 1.3.2 Release (Bugfix)

comment:7 Changed 7 years ago by solj

  • Status changed from accepted to closed
  • Resolution set to invalid

WARNING! You need to establish a session before you can create or edit tickets. Otherwise the ticket will get treated as spam.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.