[Buildbot-devel] Log file assertion

Brian Warner warner-buildbot at lothar.com
Wed May 25 00:12:30 UTC 2005


> Hi, I keep getting the following when a build starts. This happens after
> I have killed the master and restarted it. It seems to happen when I
> just close the master shell, or when I use keyboard interrupt (Ctrl-c).
> Is the file still open, not there, ?

>   File "z:\tools\pythonlibs\buildbot\status\builder.py", line 218, in
> __init__
>     assert not os.path.exists(self.getFilename())

My hunch is that somehow the buildmaster got terminated after it had started
a build (let's call it build number 5), after it started writing out the
logfiles for that build, but before the fact that the build had been started
was recorded. (it isn't supposed to be possible to do this, but it's possible
that window's file buffering means you can lose data in different ways than
you can under unix).

The next time the buildmaster starts up, it consults the saved Builder pickle
to see what the next Build will be numbered. It doesn't remember that build 5
was already started, so it says "the next build will be number 5". When that
Build actually starts, it goes to write a logfile and discovers, whoa!, the
file already exists.

(the "LogFile.upgrade" process can also cause these files to exist, but in
those cases LogFile.__init__ is not called, because we're loading the
instance in from a pickle.. only __setstate__ is called, and that doesn't
care about whether the file already exists or not).

This could also happen if you have a new copy of the buildmaster running in a
directory used by an old copy, in which for some reason the Builder pickles
are not being read.

Take a look at the build number being started, and then delete all the saved
builds with numbers that are equal or higher. These will be in the
per-Builder subdirectory of the master's basedir, in a series of numbered
files.


If that doesn't do it, let me know.. maybe there's something weirder going
on. Worst case you should be able to comment out that assertion.. it's only
there as a sanity check, the file will get overwritten anyway.


 -Brian




More information about the devel mailing list