[Buildbot-devel] AssertionError: Scheduler 'trunkscheduler' uses unknown builder 'factory'

Brian Warner warner-buildbot at lothar.com
Tue Sep 12 18:55:11 UTC 2006


brett <bneely at gmail.com> writes:

> Greetings:
> I'm having trouble with the syntax for my builder.  My current config
> involves one builder and a subversion repository.  When I run
> "buildbot start ." on the master, I hit an assertion (which will be
> pasted below this paragraph).  Note that the word 'factory' in the
> string 'Scheduler trunkscheduler...uses unknown builder factory' is a
> key within my b1 dictionary.  The name of the builder is
> 'fast-builder', not 'factory'.

Sorry for the delay.. I don't know if you've fixed the problem already or not.

> b1 = {'name': 'fast-builder', 'slavename': 'machine3', 'builddir':
> 'fast-builder', 'factory': f1}
> c['builders'] = [b1]
>
> trunk = Scheduler('trunkscheduler', None, 120, b1)
> c['schedulers'] = [trunk]

The problem is that the 4th argument of Scheduler (builderNames=) is intended
to take a list of strings, but instead it got a dictionary. The correct
syntax would be:

 trunk = Scheduler('trunkscheduler', None, 120, ["fast-builder"])

The reason this didn't get caught earlier was that the code that was making
sure it got a list of strings looked like this:

        for b in builderNames:
            assert isinstance(b, str)

But 'for x in y' also works when y is a dictionary, in which case it means to
iterate over all of the keys. And all of the keys of that builder-specifying
dictionary just so happened to be strings. Oops.

I'll add an extra assert() to make sure that builderNames itself is either a
list or a tuple. With that check in place, you'll get an exception as the
config file is being read that should make the error much more obvious than
happened here.

thanks for the catch :),
 -Brian




More information about the devel mailing list