[Buildbot-devel] build cannot be saved: saveYourself fails in attribute lookup?

Brian Warner warner-buildbot at lothar.com
Wed Sep 17 00:31:02 UTC 2008


>            File "/Library/Python/2.5/site-packages/buildbot/status/ 
> builder.py", line 1252, in saveYourself
>              dump(self, open(tmpfilename, "wb"), -1)
>          cPickle.PicklingError: Can't pickle __builtin__.blahTest:  
> attribute lookup __builtin__.blahTest failed

That suggests two things:

 1: there is a class being defined in your master.cfg (instead of being
    defined in some other .py file and then imported by your master.cfg)
 2: an instance of this class is being referenced by something in the build
    status.

The build status gets pickled (i.e. serialized to a bytestream) out to disk
when the build finishes, to make it persistent. This process also serializes
anything it can reach: the transitive closure of the object graph. Most of
the build status consists of simple values like strings and integers.

#1 is a problem because, to deserialize an instance, you need a
package/module/classname (so the unpickler knows what to import, to find the
class definition). But the package/module name comes from the import
statement, so classes defined in master.cfg won't have one (or, rather,
they'll be named __builtin__, which isn't importable).

#2 is a problem because build status isn't really supposed to contain class
instances.

My guess would be that this instance is getting attached to the build status
as a build property. Unfortunately the pickle error handler doesn't give a
lot of information to track this sort of thing down: you know *which* object
is incapable of being serialized, but you don't know how it got attached to
the build status. You'd really like the path of references that would take
you from the BuildStatus instance to this thing that pickle is complaining
about, but pickle doesn't give that to you.


hope that helps,
 -Brian




More information about the devel mailing list