← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1068181] Re: Valid column creation in token table fails with postgres

 

** Changed in: keystone
       Status: Fix Committed => Fix Released

** Changed in: keystone
    Milestone: None => grizzly-3

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1068181

Title:
  Valid column creation in token table fails with postgres

Status in OpenStack Identity (Keystone):
  Fix Released

Bug description:
  When migrating from the Essex to the Folsom  version of Ubuntu 12.04
  with postgres I get the following error when keystone tries to update
  the database schema.

  For it to work, I needed to truncate the token table in the keystone
  database. If this is better posted with the Ubuntu package maintainer,
  please let me know.

  0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  1 not fully installed or removed.
  After this operation, 0 B of additional disk space will be used.
  Do you want to continue [Y/n]? y
  Setting up keystone (2012.2-0ubuntu1~cloud0) ...
  Traceback (most recent call last):
    File "/usr/bin/keystone-manage", line 28, in <module>
      cli.main(argv=sys.argv, config_files=config_files)
    File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 164, in main
      return run(cmd, (args[:1] + args[2:]))
    File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 147, in run
      return CMDS[cmd](argv=args).run()
    File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 35, in run
      return self.main()
    File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 56, in main
      driver.db_sync()
    File "/usr/lib/python2.7/dist-packages/keystone/identity/backends/sql.py", line 136, in db_sync
      migration.db_sync()
    File "/usr/lib/python2.7/dist-packages/keystone/common/sql/migration.py", line 52, in db_sync
      return versioning_api.upgrade(CONF.sql.connection, repo_path, version)
    File "/usr/lib/python2.7/dist-packages/migrate/versioning/api.py", line 186, in upgrade
      return _migrate(url, repository, version, upgrade=True, err=err, **opts)
    File "<string>", line 2, in _migrate
    File "/usr/lib/python2.7/dist-packages/migrate/versioning/util/__init__.py", line 159, in with_engine
      return f(*a, **kw)
    File "/usr/lib/python2.7/dist-packages/migrate/versioning/api.py", line 366, in _migrate
      schema.runchange(ver, change, changeset.step)
    File "/usr/lib/python2.7/dist-packages/migrate/versioning/schema.py", line 91, in runchange
      change.run(self.engine, step)
    File "/usr/lib/python2.7/dist-packages/migrate/versioning/script/py.py", line 145, in run
      script_func(engine)
    File "/usr/lib/python2.7/dist-packages/keystone/common/sql/migrate_repo/versions/003_token_valid.py", line 33, in upgrade
      token.create_column(valid)
    File "/usr/lib/python2.7/dist-packages/migrate/changeset/schema.py", line 426, in create_column
      column.create(table=self, *p, **kw)
    File "/usr/lib/python2.7/dist-packages/migrate/changeset/schema.py", line 528, in create
      engine._run_visitor(visitorcallable, self, connection, **kwargs)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2303, in _run_visitor
      conn._run_visitor(visitorcallable, element, **kwargs)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1973, in _run_visitor
      **kwargs).traverse_single(element)
    File "/usr/lib/python2.7/dist-packages/migrate/changeset/ansisql.py", line 53, in traverse_single
      ret = super(AlterTableVisitor, self).traverse_single(elem)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/visitors.py", line 106, in traverse_single
      return meth(obj, **kw)
    File "/usr/lib/python2.7/dist-packages/migrate/changeset/ansisql.py", line 101, in visit_column
      self.execute()
    File "/usr/lib/python2.7/dist-packages/migrate/changeset/ansisql.py", line 42, in execute
      return self.connection.execute(self.buffer.getvalue())
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1449, in execute
      params)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1628, in _execute_text
      statement, parameters
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1698, in _execute_context
      context)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1691, in _execute_context
      context)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 331, in do_execute
      cursor.execute(statement, parameters)
  sqlalchemy.exc.IntegrityError: (IntegrityError) column "valid" contains null values
   '\nALTER TABLE token ADD valid BOOLEAN NOT NULL' {}
  dpkg: error processing keystone (--configure):
   subprocess installed post-installation script returned error exit status 1
  Errors were encountered while processing:
   keystone
  E: Sub-process /usr/bin/dpkg returned an error code (1)
  root@ha3:/etc/apt/sources.list.d# apt-get dist-upgrade
  Reading package lists... Done
  Building dependency tree       
  Reading state information... Done
  Calculating upgrade... Done
  0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  1 not fully installed or removed.
  After this operation, 0 B of additional disk space will be used.
  Do you want to continue [Y/n]? y
  Setting up keystone (2012.2-0ubuntu1~cloud0) ...
  Traceback (most recent call last):
    File "/usr/bin/keystone-manage", line 28, in <module>
      cli.main(argv=sys.argv, config_files=config_files)
    File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 164, in main
      return run(cmd, (args[:1] + args[2:]))
    File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 147, in run
      return CMDS[cmd](argv=args).run()
    File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 35, in run
      return self.main()
    File "/usr/lib/python2.7/dist-packages/keystone/cli.py", line 56, in main
      driver.db_sync()
    File "/usr/lib/python2.7/dist-packages/keystone/identity/backends/sql.py", line 136, in db_sync
      migration.db_sync()
    File "/usr/lib/python2.7/dist-packages/keystone/common/sql/migration.py", line 52, in db_sync
      return versioning_api.upgrade(CONF.sql.connection, repo_path, version)
    File "/usr/lib/python2.7/dist-packages/migrate/versioning/api.py", line 186, in upgrade
      return _migrate(url, repository, version, upgrade=True, err=err, **opts)
    File "<string>", line 2, in _migrate
    File "/usr/lib/python2.7/dist-packages/migrate/versioning/util/__init__.py", line 159, in with_engine
      return f(*a, **kw)
    File "/usr/lib/python2.7/dist-packages/migrate/versioning/api.py", line 366, in _migrate
      schema.runchange(ver, change, changeset.step)
    File "/usr/lib/python2.7/dist-packages/migrate/versioning/schema.py", line 91, in runchange
      change.run(self.engine, step)
    File "/usr/lib/python2.7/dist-packages/migrate/versioning/script/py.py", line 145, in run
      script_func(engine)
    File "/usr/lib/python2.7/dist-packages/keystone/common/sql/migrate_repo/versions/003_token_valid.py", line 33, in upgrade
      token.create_column(valid)
    File "/usr/lib/python2.7/dist-packages/migrate/changeset/schema.py", line 426, in create_column
      column.create(table=self, *p, **kw)
    File "/usr/lib/python2.7/dist-packages/migrate/changeset/schema.py", line 528, in create
      engine._run_visitor(visitorcallable, self, connection, **kwargs)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 2303, in _run_visitor
      conn._run_visitor(visitorcallable, element, **kwargs)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1973, in _run_visitor
      **kwargs).traverse_single(element)
    File "/usr/lib/python2.7/dist-packages/migrate/changeset/ansisql.py", line 53, in traverse_single
      ret = super(AlterTableVisitor, self).traverse_single(elem)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/sql/visitors.py", line 106, in traverse_single
      return meth(obj, **kw)
    File "/usr/lib/python2.7/dist-packages/migrate/changeset/ansisql.py", line 101, in visit_column
      self.execute()
    File "/usr/lib/python2.7/dist-packages/migrate/changeset/ansisql.py", line 42, in execute
      return self.connection.execute(self.buffer.getvalue())
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1449, in execute
      params)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1628, in _execute_text
      statement, parameters
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1698, in _execute_context
      context)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1691, in _execute_context
      context)
    File "/usr/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 331, in do_execute
      cursor.execute(statement, parameters)
  sqlalchemy.exc.IntegrityError: (IntegrityError) column "valid" contains null values
   '\nALTER TABLE token ADD valid BOOLEAN NOT NULL' {}
  dpkg: error processing keystone (--configure):
   subprocess installed post-installation script returned error exit status 1
  Errors were encountered while processing:

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1068181/+subscriptions