Ticket #796 (closed defect: fixed)

Opened 13 years ago

Last modified 13 years ago

Packages APTSource 404 urllib2 traceback

Reported by: [email protected] Owned by: desai
Priority: minor Milestone: Bcfg2 1.0.1 Release
Component: bcfg2-server Version: 1.0
Keywords: packages urllib2 Cc:


With an entry like this in Packages/config.xml


<Group>debian-lenny</Group> <URL></URL> <Version>lenny/updates</Version> <Component>main</Component> <Component>contrib</Component> <Component>non-free</Component> <Arch>i386</Arch> <Arch>amd64</Arch>


Causes a traceback in the logs on start

bcfg2-server[19315]: Packages: Updating bcfg2-server[19315]: Packages: Failed to fetch url code=404 bcfg2-server[19315]: Unexpected instantiation failure for plugin Packages Traceback (most recent call last): File "/var/lib/python-support/python2.5/Bcfg2/Server/", line 131, in init_plugins self.plugins[plugin] = plug(self, self.datastore) File "/var/lib/python-support/python2.5/Bcfg2/Server/Plugins/", line 515, in init source.setup_data() File "/var/lib/python-support/python2.5/Bcfg2/Server/Plugins/", line 82, in setup_data self.read_files() File "/var/lib/python-support/python2.5/Bcfg2/Server/Plugins/", line 414, in read_files reader = gzip.GzipFile?(fname) File "/usr/lib/python2.5/", line 95, in init fileobj = self.myfileobj =, mode or 'rb') IOError: [Errno 2] No such file or directory: '/var/lib/bcfg2/Packages/cache/http:@@[email protected]@[email protected]@[email protected]@[email protected]'

Removing the extra '/' addition at line 391 of is a workaround:

--- 2009-11-11 22:53:28.000000000 +0000 +++ 2009-11-11 22:53:37.000000000 +0000 @@ -391,7 +391,7 @@

self.pkgnames, self.deps, self.provides = cPickle.load(data)

def get_urls(self):

  • return ["%s/dists/%s/%s/binary-%s/Packages.gz" % \

+ return ["%sdists/%s/%s/binary-%s/Packages.gz" % \

(self.url, self.version, part, arch) for part in self.components \ for arch in self.arches]

urls = property(get_urls)

$ python -V Python 2.5.2


Change History

comment:1 Changed 13 years ago by desai

  • Status changed from new to closed
  • Resolution set to fixed

Committed in [fbe20241d187ac38f2bde7e00b6d71a21b558e99] (SVN r5572). Thanks for the patch. This was a combination of our bug and python 2.6's urllib2 improvements. (it worked fine in 2.6, but not in 2.5)

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


Add a comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.