Opened 10 years ago

Closed 8 years ago

Last modified 8 years ago

#917 closed defect (fixed)

Upgrade from 0.7.12 fails: 'Failed to load application: No module named'

Reported by: tfogal Owned by:
Priority: major Milestone: 0.8.2
Version: 0.8.1 Keywords:
Cc: cdadhemar@…, tfogal


Had a 10.5 slave with 0.7.12 on it.

Upgraded 10.5 to 10.6. Buildbot won't start anymore; "pkg_resources.DistributionNotFound: buildbot==0.7.12". Looking at paths later, it looks like the default python is now 2.6, not 2.5, so this is not too surprising.

Updated the slave to 0.8.1. Install the master at first because I forgot they were separate and was not paying attention. Then installed the slave package. Both had a custom --prefix=somewhere/in/my/home

buildslave start failed with the 'No module named' error.

I re-ran the command to create the slave:

buildslave create-slave . mymaster:9990 slavename pass

and it had "updating existing installation" as the first line of its output, so it appeared to (successfully) upgrade something or other to 0.8.1.

Still buildslave start fails with the missing module reference.

Change History (9)

comment:1 Changed 10 years ago by tfogal

Here's a terminal session showing the full error plus some other environment info.

  tfogal@krueger-mac $ cat

  	env -i 
  		buildslave start
  tfogal@krueger-mac $ bash 
  /Users/tfogal/ DeprecationWarning: the md5 module is deprecated; use hashlib instead
  	import itertools, md5
  Following twistd.log until startup finished..
  /Users/tfogal/ PotentialZombieWarning: spawnProcess called, but the SIGCHLD handler is not installed. This probably means you have not yet called, or called You will probably never see this process finish, and it may become a zombie process.
  /Users/tfogal/ DeprecationWarning: the md5 module is deprecated; use hashlib instead
  	import os, md5, sys
  /Users/tfogal/ DeprecationWarning: the sha module is deprecated; use the hashlib module instead
  	import sha
  Traceback (most recent call last):
  	File "/Users/tfogal/sw/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-macosx-10.6-universal.egg/twisted/application/", line 694, in run
  	File "/Users/tfogal/sw/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-macosx-10.6-universal.egg/twisted/scripts/", line 23, in runApp
  	File "/Users/tfogal/sw/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-macosx-10.6-universal.egg/twisted/application/", line 411, in run
  		self.application = self.createOrGetApplication()
  	File "/Users/tfogal/sw/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-macosx-10.6-universal.egg/twisted/application/", line 494, in createOrGetApplication
  		application = getApplication(self.config, passphrase)
  --- <exception caught here> ---
  	File "/Users/tfogal/sw/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-macosx-10.6-universal.egg/twisted/application/", line 505, in getApplication
  		application = service.loadApplication(filename, style, passphrase)
  	File "/Users/tfogal/sw/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-macosx-10.6-universal.egg/twisted/application/", line 390, in loadApplication
  		application = sob.loadValueFromFile(filename, 'application', passphrase)
  	File "/Users/tfogal/sw/lib/python2.6/site-packages/Twisted-8.2.0-py2.6-macosx-10.6-universal.egg/twisted/persisted/", line 214, in loadValueFromFile
  		exec fileObj in d, d
  	File "buildbot.tac", line 3, in <module>
  		from import BuildSlave
  exceptions.ImportError: No module named

  Failed to load application: No module named

  The buildslave took more than 10 seconds to start, so we were unable to
  confirm that it started correctly. Please 'tail twistd.log' and look for a
  line that says 'configuration update complete' to verify correct startup.

  tfogal@krueger-mac $ echo $PYTHONPATH
  tfogal@krueger-mac $ echo $PATH

comment:2 Changed 10 years ago by cdadhemar

  • Cc cdadhemar@… added


I have the exact same issue trying to migrate from buildbot 0.8.0 to buildbot 0.8.1. However after running the "buildslave create-slave ..." command over the existing slave the slave did not succeeded to start. I add to re-create it (rm -rf and buildslave create-slave).

Thank you very much for your help. Cheers, CH

comment:3 Changed 10 years ago by Caemyr

The workaround is actually quite simple. Please notice:

File "buildbot.tac", line 3, in <module> from import BuildSlave

exceptions.ImportError?: No module named Failed to load application: No module named

Please see buildbot.tac file in your slave's directory. You can see that one of the imports is: import BuildSlave as listed in the error log. One quick glance at the 0.8.1 API reference ( reveals that there is no such import available. Instead, there is interestingly-looking that is exporting BuildSlave. Just correcting the import name will sort out this issue. I`m currently running full 0.8.1 upgraded from 0.8.0... Please also note that there is another command for launching slaves: buildslave start, instead of buildbot start.

from import BuildSlave

comment:4 Changed 10 years ago by tfogal

  • Cc tfogal added

cdadhemar's workaround worked for me as well.

Caemyr's analysis makes sense to me... I guess the appropriate fix, then, is to have an 'upgrade-slave' command which rewrites the .tac?

comment:5 Changed 10 years ago by dustin

  • Milestone changed from undecided to 0.8.2

I documented this in 1244ce82f697c65f56413ab3f722b1973e8a3f0b, but adding an upgrade-slave command is not a bad idea, and would help users upgrading *past* 0.8.1 without stopping there.

comment:6 Changed 10 years ago by Dustin J. Mitchell

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

Add upgrade-slave command and document

Fixes #917

Changeset: b8d69d30ad147d112766afeb47748234995208e7

comment:7 Changed 8 years ago by techtonik

  • Resolution fixed deleted
  • Status changed from closed to reopened

buildbot should track version of its environment and propose upgrade when necessary. I've just run into the same issue. It is not fixed.

comment:8 Changed 8 years ago by tom.prince

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

While having this would be nice, adding more code to detect this doesn't seem worth the effort, at this point.

comment:9 Changed 8 years ago by dustin

techtonik - actually, having Buildbot compare the runtime version to the version in the TAC file, and refuse to start up (or at least warn) if they disagree isn't a bad idea. It should be a new bug, though - re-opening bugs is generally pretty unfriendly.

Feel free to file such a new bug, and better, provide a patch to implement it :)

Note: See TracTickets for help on using tickets.