<div dir="ltr">Hi Alvaro,<div>Did you manage to resolve your issue.</div><div>At first I was thinking of a missing upgrade, but it does not really make full sense.</div><div><br></div><div><span style="color:rgb(33,33,33)">             q = sa.select([</span><a href="http://sch_tbl.c.id/" rel="noreferrer" target="_blank">sch_tbl.c.id</a><span style="color:rgb(33,33,33)">,<span class="inbox-inbox-Apple-converted-space"> </span></span><a href="http://sch_tbl.c.name/" rel="noreferrer" target="_blank">sch_tbl.c.name</a><span style="color:rgb(33,33,33)">, sch_tbl.c.enabled,</span><br style="color:rgb(33,33,33)"></div><div><span style="color:rgb(33,33,33)">"/usr/home/nightstalker/host/b</span><span style="color:rgb(33,33,33)">b-master-v2/local/lib/python2.</span><span style="color:rgb(33,33,33)">7/site-packages/sqlalchemy/</span><span style="color:rgb(33,33,33)">util/_collections.py",</span><br style="color:rgb(33,33,33)"><span style="color:rgb(33,33,33)">line 212, in __getattr__</span><br style="color:rgb(33,33,33)"><span style="color:rgb(33,33,33)">             raise AttributeError(key)</span><br style="color:rgb(33,33,33)"><span style="color:rgb(33,33,33)">         exceptions.AttributeError: enabled</span><span style="color:rgb(33,33,33)"><br></span></div><div><span style="color:rgb(33,33,33)"><br></span></div><div><span style="color:rgb(33,33,33)">I I understand correctly sqlalchemy, the 'enabled' attribute is described in model.py, not in the actual database, as we don't use autoload mechanism except in tests.</span></div><div>The only reason I could see is a mixed version of buildbot installation. model.py would come from a pre-0.9.5 install, while scheduler.py would come from 0.9.6</div><div><br></div><div>Pierre</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Apr 27, 2017 at 1:56 AM Alvaro Erickson <<a href="mailto:aerickson@xkl.com">aerickson@xkl.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Greetings all,<br>
<br>
So, I copied my master.cfg and buildbot.tac (originally created as a<br>
movable buildbot.tac file) from an old Buildbot master directory to a<br>
new one. Now, I have stopped the old master and its worker. But, when I<br>
attempt to start the Buildbot master I receive the following error:<br>
<br>
2017-04-26 13:57:20-0700 [-] Setting up database with URL<br>
'postgresql://<a href="http://mydb:xxxx@my.site.org/mydb" rel="noreferrer" target="_blank">mydb:xxxx@my.site.org/mydb</a>'<br>
2017-04-26 13:57:20-0700 [-] doing housekeeping for master 1<br>
myserver:/usr/home/nightstalker/host/bb-master/master<br>
2017-04-26 13:57:20-0700 [-] Got fatal Exception on DB<br>
         Traceback (most recent call last):<br>
         Failure: exceptions.AttributeError: enabled<br>
<br>
2017-04-26 13:57:20-0700 [-] while starting BuildMaster<br>
         Traceback (most recent call last):<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/internet/defer.py",<br>
line 653, in _runCallbacks<br>
             current.result = callback(current.result, *args, **kw)<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/internet/defer.py",<br>
line 1357, in gotResult<br>
             _inlineCallbacks(r, g, deferred)<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/internet/defer.py",<br>
line 1299, in _inlineCallbacks<br>
             result = result.throwExceptionIntoGenerator(g)<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/python/failure.py",<br>
line 393, in throwExceptionIntoGenerator<br>
             return g.throw(self.type, self.value, self.tb)<br>
         --- <exception caught here> ---<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/buildbot/master.py",<br>
line 304, in startService<br>
             yield self.data.updates.expireMasters(forceHouseKeeping=True)<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/internet/defer.py",<br>
line 1299, in _inlineCallbacks<br>
             result = result.throwExceptionIntoGenerator(g)<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/python/failure.py",<br>
line 393, in throwExceptionIntoGenerator<br>
             return g.throw(self.type, self.value, self.tb)<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/buildbot/data/masters.py",<br>
line 127, in expireMasters<br>
             yield self._masterDeactivatedHousekeeping(m['id'], m['name'])<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/internet/defer.py",<br>
line 1299, in _inlineCallbacks<br>
             result = result.throwExceptionIntoGenerator(g)<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/python/failure.py",<br>
line 393, in throwExceptionIntoGenerator<br>
             return g.throw(self.type, self.value, self.tb)<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/buildbot/data/masters.py",<br>
line 147, in _masterDeactivatedHousekeeping<br>
             masterid=masterid)<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/internet/defer.py",<br>
line 1299, in _inlineCallbacks<br>
             result = result.throwExceptionIntoGenerator(g)<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/python/failure.py",<br>
line 393, in throwExceptionIntoGenerator<br>
             return g.throw(self.type, self.value, self.tb)<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/buildbot/data/schedulers.py",<br>
line 145, in _masterDeactivated<br>
             masterid=masterid)<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/python/threadpool.py",<br>
line 250, in inContext<br>
             result = inContext.theWork()<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/python/threadpool.py",<br>
line 266, in <lambda><br>
             inContext.theWork = lambda: context.call(ctx, func, *args,<br>
**kw)<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/python/context.py",<br>
line 122, in callWithContext<br>
             return self.currentContext().callWithContext(ctx, func,<br>
*args, **kw)<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/twisted/python/context.py",<br>
line 85, in callWithContext<br>
             return func(*args,**kw)<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/buildbot/db/pool.py",<br>
line 183, in __thd<br>
             rv = callable(arg, *args, **kwargs)<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/buildbot/db/schedulers.py",<br>
line 194, in thd<br>
             q = sa.select([<a href="http://sch_tbl.c.id" rel="noreferrer" target="_blank">sch_tbl.c.id</a>, <a href="http://sch_tbl.c.name" rel="noreferrer" target="_blank">sch_tbl.c.name</a>, sch_tbl.c.enabled,<br>
           File<br>
"/usr/home/nightstalker/host/bb-master-v2/local/lib/python2.7/site-packages/sqlalchemy/util/_collections.py",<br>
line 212, in __getattr__<br>
             raise AttributeError(key)<br>
         exceptions.AttributeError: enabled<br>
<br>
<br>
Now, the error appears to be when the Buildbot attempts to access<br>
"enabled" column of the schedulers table. I tried to see if I could<br>
access it using a Python interactive session. Here is my code:<br>
<br>
 >>> import sqlalchemy as sa<br>
 >>> import sqlalchemy.exc<br>
 >>> from buildbot.util import sautils<br>
 >>> db =<br>
sqlalchemy.create_engine('postgresql://<a href="http://username:password@my.site.org/db" rel="noreferrer" target="_blank">username:password@my.site.org/db</a>')<br>
 >>> metadata2 = sa.MetaData()<br>
 >>> metadata2.bind = db<br>
 >>> sch_tbl = sautils.Table('schedulers', metadata2, autoload=True)<br>
<br>
<br>
 >>> sch_tbl.c<br>
<sqlalchemy.sql.base.ImmutableColumnCollection object at 0x7fa052622500><br>
 >>> print str(sch_tbl.c)<br>
<br>
<br>
['<a href="http://schedulers.id" rel="noreferrer" target="_blank">schedulers.id</a>', '<a href="http://schedulers.name" rel="noreferrer" target="_blank">schedulers.name</a>', 'schedulers.name_hash',<br>
'schedulers.enabled']<br>
 >>> <a href="http://sch_tbl.c.id" rel="noreferrer" target="_blank">sch_tbl.c.id</a><br>
Column('id', INTEGER(), table=<schedulers>, primary_key=True,<br>
nullable=False,<br>
server_default=DefaultClause(<sqlalchemy.sql.elements.TextClause object<br>
at 0x7fa05173ea10>, for_update=False))<br>
 >>> sch_tbl.c.enabled<br>
Column('enabled', SMALLINT(), table=<schedulers>, nullable=False,<br>
server_default=DefaultClause(<sqlalchemy.sql.elements.TextClause object<br>
at 0x7fa05173e6d0>, for_update=False))<br>
 >>> from sqlalchemy.orm import sessionmaker<br>
 >>> bb_session = sessionmaker()<br>
 >>> bb_session.configure(bind=db)<br>
<br>
<br>
 >>> my_session = bb_session()<br>
 >>> q = my_session.query(sch_tbl)<br>
 >>> q.column_descriptions<br>
[{'aliased': False, 'expr': Column('id', INTEGER(), table=<schedulers>,<br>
primary_key=True, nullable=False,<br>
server_default=DefaultClause(<sqlalchemy.sql.elements.TextClause object<br>
at 0x7fa0517<br>
3ea10>, for_update=False)), 'type': INTEGER(), 'name': 'id', 'entity':<br>
None}, {'aliased': False, 'expr': Column('name', TEXT(),<br>
table=<schedulers>, nullable=False), 'type': TEXT(), 'name': '<br>
name', 'entity': None}, {'aliased': False, 'expr': Column('name_hash',<br>
VARCHAR(length=40), table=<schedulers>, nullable=False), 'type':<br>
VARCHAR(length=40), 'name': 'name_hash', 'entity': Non<br>
e}, {'aliased': False, 'expr': Column('enabled', SMALLINT(),<br>
table=<schedulers>, nullable=False,<br>
server_default=DefaultClause(<sqlalchemy.sql.elements.TextClause object<br>
at 0x7fa05173e6d0>, f<br>
or_update=False)), 'type': SMALLINT(), 'name': 'enabled', 'entity': None}]<br>
 >>> q = my_session.query(sch_tbl).filter_by(enabled=1)<br>
 >>> q<br>
<sqlalchemy.orm.query.Query object at 0x7fa0512efcd0><br>
<br>
So, I was able to access the schedulers table and query the "enabled"<br>
column. Now, does anyone know why I am seeing the above error?<br>
<br>
Regards,<br>
<br>
Alvaro<br>
<br>
<br>
<br>
The information contained in this e-mail message may be privileged, confidential and protected from disclosure.<br>
 If you are not the intended recipient, any dissemination, distribution or copying is strictly prohibited.<br>
 If you think that you have received this e-mail message in error, please e-mail the sender at the above e-mail address.<br>
<br>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@buildbot.net" target="_blank">users@buildbot.net</a><br>
<a href="https://lists.buildbot.net/mailman/listinfo/users" rel="noreferrer" target="_blank">https://lists.buildbot.net/mailman/listinfo/users</a><br>
</blockquote></div>