pythonpython-2.7pipsetuptoolsbuildout

zc.buildout randomly broke during routine patch today


Deploying a security patch to a production machine today and zc.buildout just randomly breaks. I already tried to upgrade pip and this still doesn't resolve the issue.

$ ./bin/buildout 
mr.developer: Queued 'django-appregister' for checkout.
mr.developer: Queued 'django-countries' for checkout.
mr.developer: Queued 'django-mailer' for checkout.
mr.developer: Queued 'django-ostinato' for checkout.
mr.developer: Skipped checkout of existing package 'django-appregister'.
mr.developer: Skipped checkout of existing package 'django-countries'.
mr.developer: Skipped checkout of existing package 'django-mailer'.
mr.developer: Skipped checkout of existing package 'django-ostinato'.
Develop: '/home/evopoints/webapp/src/django-ostinato'
/usr/lib/python2.7/dist-packages/setuptools/dist.py:364: UserWarning: Normalizing '1.1.beta' to '1.1b0'
normalized_version,
warning: no previously-included files matching '*.pyc' found anywhere in distribution
Develop: '/home/evopoints/webapp/src/django-mailer'
Develop: '/home/evopoints/webapp/src/django-countries'
Develop: '/home/evopoints/webapp/src/django-appregister'
/usr/lib/python2.7/dist-packages/setuptools/dist.py:364: UserWarning: Normalizing '0.4.dev' to '0.4.dev0'
normalized_version,
Unused options for buildout: 'include-site-packages' 'unzip'.
Updating _mr.developer.
Installing python.
While:
Installing python.

An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/home/evopoints/webapp/eggs/zc.buildout-2.9.4-py2.7.egg/zc/buildout/buildout.py", line 2123, in main
    getattr(buildout, command)(args)
File "/home/evopoints/webapp/eggs/zc.buildout-2.9.4-py2.7.egg/zc/buildout/buildout.py", line 796, in install
    installed_files = self[part]._call(recipe.install)
File "/home/evopoints/webapp/eggs/zc.buildout-2.9.4-py2.7.egg/zc/buildout/buildout.py", line 1553, in _call
    return f()
File "/home/evopoints/webapp/eggs/zc.recipe.egg-2.0.3-py2.7.egg/zc/recipe/egg/egg.py", line 126, in install
    reqs, ws = self.working_set()
File "/home/evopoints/webapp/eggs/zc.recipe.egg-2.0.3-py2.7.egg/zc/recipe/egg/egg.py", line 84, in working_set
    allow_hosts=self.allow_hosts)
File "/home/evopoints/webapp/eggs/zc.buildout-2.9.4-py2.7.egg/zc/buildout/easy_install.py", line 913, in install
    return installer.install(specs, working_set)
File "/home/evopoints/webapp/eggs/zc.buildout-2.9.4-py2.7.egg/zc/buildout/easy_install.py", line 657, in install
    for spec in specs]
File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2879, in parse
    req, = parse_requirements(s)
ValueError: need more than 0 values to unpack

Why does this happen at random times? (It's not the first time) This is now at the point that I'm going to have to move away from buildout entirely, because it's too unreliable, for a client production site to randomly fail during a small patch in he's site code.


Solution

  • If you run buildout with -vvvv, you might see the actual error. The "need more than 0 values to unpack" error, in my experience, sometimes occurs when there's an error downloading something.

    What could also help is to upgrade your versions of setuptools and zc.buildout (2.12.0 is out, you're using 2.9.4). There have been quite a number of fixes to buildout to compensate for changes in the environment (most often changes in setuptools).

    Note that pypi also moved. From http to https, and from pypi.python.org to pypi.org. So adjusting your index= line (if you have it) might save a bunch of redirects, which could also work.

    I haven't seen any serious breakage in buildout in the last few months, at least the github issue tracker has been quiet :-)