[users at bb.net] Copying and reusing a masters directory in

Alvaro Erickson aerickson at xkl.com
Wed Apr 26 23:56:20 UTC 2017


Greetings all,

So, I copied my master.cfg and buildbot.tac (originally created as a
movable buildbot.tac file) from an old Buildbot master directory to a
new one. Now, I have stopped the old master and its worker. But, when I
attempt to start the Buildbot master I receive the following error:

2017-04-26 13:57:20-0700 [-] Setting up database with URL
'postgresql://mydb:xxxx@my.site.org/mydb'
2017-04-26 13:57:20-0700 [-] doing housekeeping for master 1
myserver:/usr/home/nightstalker/host/bb-master/master
2017-04-26 13:57:20-0700 [-] Got fatal Exception on DB
         Traceback (most recent call last):
         Failure: exceptions.AttributeError: enabled

2017-04-26 13:57:20-0700 [-] while starting BuildMaster
         Traceback (most recent call last):
           File
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/internet/defer.py",
line 653, in _runCallbacks
             current.result = callback(current.result, *args, **kw)
           File
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/internet/defer.py",
line 1357, in gotResult
             _inlineCallbacks(r, g, deferred)
           File
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/internet/defer.py",
line 1299, in _inlineCallbacks
             result = result.throwExceptionIntoGenerator(g)
           File
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/python/failure.py",
line 393, in throwExceptionIntoGenerator
             return g.throw(self.type, self.value, self.tb)
         --- <exception caught here> ---
           File
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/buildbot/master.py",
line 304, in startService
             yield self.data.updates.expireMasters(forceHouseKeeping=True)
           File
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/internet/defer.py",
line 1299, in _inlineCallbacks
             result = result.throwExceptionIntoGenerator(g)
           File
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/python/failure.py",
line 393, in throwExceptionIntoGenerator
             return g.throw(self.type, self.value, self.tb)
           File
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/buildbot/data/masters.py",
line 127, in expireMasters
             yield self._masterDeactivatedHousekeeping(m['id'], m['name'])
           File
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/internet/defer.py",
line 1299, in _inlineCallbacks
             result = result.throwExceptionIntoGenerator(g)
           File
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/python/failure.py",
line 393, in throwExceptionIntoGenerator
             return g.throw(self.type, self.value, self.tb)
           File
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/buildbot/data/masters.py",
line 147, in _masterDeactivatedHousekeeping
             masterid=masterid)
           File
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/internet/defer.py",
line 1299, in _inlineCallbacks
             result = result.throwExceptionIntoGenerator(g)
           File
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/python/failure.py",
line 393, in throwExceptionIntoGenerator
             return g.throw(self.type, self.value, self.tb)
           File
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/buildbot/data/schedulers.py",
line 145, in _masterDeactivated
             masterid=masterid)
           File
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/python/threadpool.py",
line 250, in inContext
             result = inContext.theWork()
           File 
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/python/threadpool.py", 
line 266, in <lambda>
             inContext.theWork = lambda: context.call(ctx, func, *args, 
**kw)
           File 
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/python/context.py", 
line 122, in callWithContext
             return self.currentContext().callWithContext(ctx, func, 
*args, **kw)
           File 
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/python/context.py", 
line 85, in callWithContext
             return func(*args,**kw)
           File 
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/buildbot/db/pool.py", 
line 183, in __thd
             rv = callable(arg, *args, **kwargs)
           File 
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/buildbot/db/schedulers.py", 
line 194, in thd
             q = sa.select([sch_tbl.c.id, sch_tbl.c.name, sch_tbl.c.enabled,
           File 
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/sqlalchemy/util/_collections.py", 
line 212, in __getattr__
             raise AttributeError(key)
         exceptions.AttributeError: enabled


Now, the error appears to be when the Buildbot attempts to access 
"enabled" column of the schedulers table. I tried to see if I could 
access it using a Python interactive session. Here is my code:

 >>> import sqlalchemy as sa
 >>> import sqlalchemy.exc
 >>> from buildbot.util import sautils
 >>> db = 
sqlalchemy.create_engine('postgresql://username:password@my.site.org/db')
 >>> metadata2 = sa.MetaData()
 >>> metadata2.bind = db
 >>> sch_tbl = sautils.Table('schedulers', metadata2, autoload=True) 
 

 >>> sch_tbl.c
<sqlalchemy.sql.base.ImmutableColumnCollection object at 0x7fa052622500>
 >>> print str(sch_tbl.c) 
 

['schedulers.id', 'schedulers.name', 'schedulers.name_hash', 
'schedulers.enabled']
 >>> sch_tbl.c.id
Column('id', INTEGER(), table=<schedulers>, primary_key=True, 
nullable=False, 
server_default=DefaultClause(<sqlalchemy.sql.elements.TextClause object 
at 0x7fa05173ea10>, for_update=False))
 >>> sch_tbl.c.enabled
Column('enabled', SMALLINT(), table=<schedulers>, nullable=False, 
server_default=DefaultClause(<sqlalchemy.sql.elements.TextClause object 
at 0x7fa05173e6d0>, for_update=False))
 >>> from sqlalchemy.orm import sessionmaker
 >>> bb_session = sessionmaker()
 >>> bb_session.configure(bind=db) 
 

 >>> my_session = bb_session()
 >>> q = my_session.query(sch_tbl)
 >>> q.column_descriptions
[{'aliased': False, 'expr': Column('id', INTEGER(), table=<schedulers>, 
primary_key=True, nullable=False, 
server_default=DefaultClause(<sqlalchemy.sql.elements.TextClause object 
at 0x7fa0517
3ea10>, for_update=False)), 'type': INTEGER(), 'name': 'id', 'entity': 
None}, {'aliased': False, 'expr': Column('name', TEXT(), 
table=<schedulers>, nullable=False), 'type': TEXT(), 'name': '
name', 'entity': None}, {'aliased': False, 'expr': Column('name_hash', 
VARCHAR(length=40), table=<schedulers>, nullable=False), 'type': 
VARCHAR(length=40), 'name': 'name_hash', 'entity': Non
e}, {'aliased': False, 'expr': Column('enabled', SMALLINT(), 
table=<schedulers>, nullable=False, 
server_default=DefaultClause(<sqlalchemy.sql.elements.TextClause object 
at 0x7fa05173e6d0>, f
or_update=False)), 'type': SMALLINT(), 'name': 'enabled', 'entity': None}]
 >>> q = my_session.query(sch_tbl).filter_by(enabled=1)
 >>> q
<sqlalchemy.orm.query.Query object at 0x7fa0512efcd0>

So, I was able to access the schedulers table and query the "enabled" 
column. Now, does anyone know why I am seeing the above error?

Regards,

Alvaro



The information contained in this e-mail message may be privileged, confidential and protected from disclosure.
 If you are not the intended recipient, any dissemination, distribution or copying is strictly prohibited.
 If you think that you have received this e-mail message in error, please e-mail the sender at the above e-mail address.



More information about the users mailing list