Python Tales and Plone Stories

4teamwork

download.zope.org Is Down - How to Fix Buildout

Currently download.zope.org seems to be down. When running a buildout installing Plone this is a problem since the Plone version configs extend from download.zope.org.

Buildout throws an exception because it cannot download the version pinnings:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
While:
  Initializing.

An internal error occured due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
  File "/Users/jone/projects/python/cache/eggs/zc.buildout-1.4.4-py2.7.egg/zc/buildout/buildout.py", line 1682, in main
    user_defaults, windows_restart, command)
...
File "/Users/jone/projects/python/buildout.python/parts/opt/lib/python2.7/httplib.py", line 776, in send
    self.connect()
  File "/Users/jone/projects/python/buildout.python/parts/opt/lib/python2.7/httplib.py", line 757, in connect
    self.timeout, self.source_address)
  File "/Users/jone/projects/python/buildout.python/parts/opt/lib/python2.7/socket.py", line 571, in create_connection
    raise err
IOError: [Errno socket error] timed out

Buildout Extends Cache

Configuring an extends cache can help in such situations, although it is wise to do that before something goes down. The cache will normally try to update the extends. If the update fails it will then take the cached version of the config file. This also allows to run buildout in offline mode (bin/buildout -o) which will not update the cached extends.

You can easily set this up for your machine by creating a ~/.buildout/default.cfg file which will be loaded for every buildout configuration run by this user:

1
2
[buildout]
extends-cache       = /home/john/buildout-cache/extends

You also need to create the specified directory:

1
$ mkdir -p /home/john/buildout-cache/extends

When running buildout it will automatically store the downloaded extends in the configuration with a hashed name.

The hash can easily be generated using python:

1
2
3
>>> from md5 import md5
>>> md5('http://download.zope.org/zopetoolkit/index/1.0.7/ztk-versions.cfg').hexdigest()
'fee93940599fd79bdf7e714f3a706d44'

I’ve uploaded the caches for download.zope.org used when using buildout for Plone 4.2:

https://gist.github.com/jone/5720499

Offline bootstrapping

Since buildout.org, which is required for bootstrapping, is on the same host as download.zope.org it is down too.

You can work around bootstrapping issues by doing an offline bootstrap. For this you need to have another buildout already installed which has the same python and zc.buildout versions. You can use the other buildout for bootstrapping like this:

1
2
$ cd new/buildout
$ ../path/to/old/buildout/bin/buildout -o bootstrap

This bootstraps the buildout in your working directory with the python / buildout versions of the other buildout. Using the -o flag runs the bootstrap in offline mode.

Contact me if you have questions or need other caches for download.zope.org.

Comments