Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#2933 closed defect (fixed)

tests failing with postgres-9.3

Reported by: dustin Owned by: dustin
Priority: major Milestone: 0.9.0
Version: 0.8.9 Keywords: database
Cc:

Description

Traceback (most recent call last):
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/twisted/python/threadpool.py", line 207, in _worker
    result = context.call(ctx, function, *args, **kwargs)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/twisted/python/context.py", line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext
    return func(*args,**kw)
  File "/var/lib/buildslave/bbot/db-postgres/build/master/buildbot/db/pool.py", line 191, in __thd
    rv = callable(arg, *args, **kwargs)
  File "/var/lib/buildslave/bbot/db-postgres/build/master/buildbot/db/model.py", line 764, in thd
    version_control(engine)
  File "/var/lib/buildslave/bbot/db-postgres/build/master/buildbot/db/model.py", line 729, in version_control
    ControlledSchema.create(engine, self.repo_path, version)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/migrate/versioning/schema.py", line 142, in create
    return cls(engine, repository)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/migrate/versioning/schema.py", line 32, in __init__
    self.load()
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/migrate/versioning/schema.py", line 44, in load
    self.table = Table(tname, self.meta, autoload=True)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/sqlalchemy/schema.py", line 263, in __new__
    table._init(name, metadata, *args, **kw)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/sqlalchemy/schema.py", line 329, in _init
    reflecttable(self, include_columns=include_columns)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 2132, in reflecttable
    self.dialect.reflecttable(conn, table, include_columns)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 254, in reflecttable
    return insp.reflecttable(table, include_columns)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/sqlalchemy/engine/reflection.py", line 464, in reflecttable
    indexes = self.get_indexes(table_name, schema)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/sqlalchemy/engine/reflection.py", line 324, in get_indexes
    info_cache=self.info_cache, **kw)
  File "<string>", line 1, in <lambda>
    
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/sqlalchemy/engine/reflection.py", line 46, in cache
    ret = fn(self, con, *args, **kw)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/base.py", line 1334, in get_indexes
    c = connection.execute(t, table_oid=table_oid)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1294, in execute
    params)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1427, in _execute_clauseelement
    compiled_sql, distilled_params
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1535, in _execute_context
    context)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1528, in _execute_context
    context)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 325, in do_execute
    cursor.execute(statement, parameters)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/pg8000/dbapi.py", line 243, in _fn
    return fn(self, *args, **kwargs)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/pg8000/dbapi.py", line 314, in execute
    self._execute(operation, args)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/pg8000/dbapi.py", line 319, in _execute
    self.cursor.execute(new_query, *new_args)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/pg8000/interface.py", line 304, in execute
    self._stmt.execute(*args, **kwargs)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/pg8000/interface.py", line 139, in execute
    self._row_desc, cmd = self.c.bind(self._portal_name, self._statement_name, args, self._parse_row_desc, kwargs.get("stream"))
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/pg8000/protocol.py", line 913, in _fn
    return fn(self, *args, **kwargs)
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/pg8000/protocol.py", line 1082, in bind
    output_fc = [types.py_type_info(f) for f in row_desc.fields]
  File "/var/lib/buildslave/bbot/db-postgres/sandbox-python-twistedsamigr-0.7.1/lib/python2.7/site-packages/pg8000/types.py", line 162, in py_type_info
    raise NotSupportedError("type oid %r not mapped to py type" % type_oid)
migrate.exceptions.DatabaseNotControlledError: (NotSupportedError) type oid 194 not mapped to py type u"\n          SELECT\n              i.relname as relname,\n              ix.indisunique, ix.indexprs, ix.indpred,\n              a.attname\n          FROM\n              pg_class t \n                    join pg_index ix on t.oid = ix.indrelid\n                    join pg_class i on i.oid=ix.indexrelid\n                    left outer join \n                        pg_attribute a \n                        on t.oid=a.attrelid and a.attnum=ANY(ix.indkey)\n          WHERE\n              t.relkind = 'r'\n              and t.oid = %s\n              and ix.indisprimary = 'f'\n          ORDER BY\n              t.relname,\n              i.relname\n        " (18769,)

on knuth.r.igoro.us, which was just upgraded.

Change History (7)

comment:1 Changed 4 years ago by dustin

  • Owner set to dustin
  • Status changed from new to assigned

comment:2 Changed 4 years ago by dustin

The problem was something in the DB configuration. I had upgraded the database from postgres 8.4 to postgres 9.3, and something in that upgrade process didn't work quite right.

The mechanisms of the postgres catalog tables, pg8000, and sqlalchemy are all a little over my head, but as far as I can tell dropping and re-creating the 'metabuildslave' DB fixed this.

comment:3 Changed 4 years ago by dustin

  • Resolution set to fixed
  • Status changed from assigned to closed

comment:4 Changed 4 years ago by dustin

  • Resolution fixed deleted
  • Status changed from closed to reopened

Er, that didn't help after all..

comment:5 Changed 4 years ago by dustin

So it looks like pg8000-1.08 isn't compatible with Postgres-9.3. But SQLAlchemy-0.7.10 isn't compatible with the newest pg8000 (1.10.1). Happily 1.9.14 is a sweet spot. So I've set up the metabuildbot to install that version.

comment:6 Changed 4 years ago by dustin

  • Resolution set to fixed
  • Status changed from reopened to closed

..and that upgrade revealed a bug, fixed in https://github.com/buildbot/buildbot/pull/1255

But postgres is once again functioning correctly on knuth.

comment:7 Changed 4 years ago by Mikhail Sobolev <sa2ajj@…>

In a343b1fc5919d3943aeaaa021f59542ce19de70f:

Merge pull request #1255 from djmitche/025-masterid-type-fix

Fix the type of the 'masterid' case statement

See ticket:2933

Note: See TracTickets for help on using tickets.