[Buildbot-devel] exceptions.AttributeError: 'str' object has no attribute 'has_key'

brett bneely at gmail.com
Tue Jul 11 00:03:20 UTC 2006

Hi folks:
When I run "buildbot start ." on my buildmaster, I receive this error
in twistd.log:

2006/07/10 15:43 PDT [-] error during loadConfig
2006/07/10 15:43 PDT [-] Traceback (most recent call last):
          File "/usr/lib/python2.3/site-packages/twisted/scripts/twistd.py",
line 182, in startApplication
            app.startApplication(application, not config['no_save'])
          File "/usr/lib/python2.3/site-packages/twisted/application/app.py",
line 298, in startApplication
          File "/usr/lib/python2.3/site-packages/twisted/application/service.py",
line 196, in startService
          File "/usr/lib/python2.3/site-packages/buildbot/master.py",
line 630, in startService
        --- <exception caught here> ---
          File "/usr/lib/python2.3/site-packages/buildbot/master.py",
line 685, in loadTheConfigFile
          File "/usr/lib/python2.3/site-packages/buildbot/master.py",
line 768, in loadConfig
            if b.has_key('slavename') and b['slavename'] not in slavenames:
        exceptions.AttributeError: 'str' object has no attribute 'has_key'

It looks like master.py is querying a builder dictionary 'b' for the
slavename.  I'm not sure why the exception claims that builder is a
'str' object.

Does anyone see what the problem could be in my master.cfg?

My buildmaster configuration:

Mac OS X 10.4.7
Python 2.3.5

My obfuscated master.cfg:

strongbad:~/Desktop local$ cat master.cfg
# -*- python -*-
# ex: set syntax=python:

# documented in docs/config.xhtml .

import os.path
from buildbot import scheduler
from buildbot.scheduler import Scheduler
from buildbot.process import step, factory
from buildbot.status import html
from buildbot.changes.pb import PBChangeSource

s = factory.s

c = BuildmasterConfig = {}

c['sources'] = []

c['bots'] = [('changed3', 'changedpw')]

source = s(step.SVN, mode='update',
f1 = factory.BuildFactory([source,
                          s(step.Compile, command="build -option1 -option2"),
                          s(step.Test, command="build -option3 'Parameter'")])

b1 = {'name': 'builder1', 'slavename': 'changed3', 'builddir':
'builder1', 'factory': f1}
c['builders'] = ['b1']

c['schedulers'] = []
#trunk = Scheduler('trunkscheduler', None, 120, ['b1'])
#c['schedulers'] = ['trunk']
#c['schedulers'] = [Scheduler('trunkscheduler', None, 120, ['b1'])]

c['slavePortnum'] = 2222

c['status'] = []
c['status'].append( html.Waterfall( http_port=8080, css=os.path.join(
basedir, "buildbot.css" ) ) )

c['debugPassword'] = "changed"

c['projectName'] = "myproj"
c['projectURL'] = "http://myserver/"

c['buildbotURL'] = "http://myotherserver/"


More information about the devel mailing list