After trying an upgrade from mitaka to newton using Juju actions, /var/log/keystone/keystone.log is full of "Unknown column" DB error. After executing `keystone-manage db_sync` on one unit, the keystone service becomes working again. db_sync is missing on action managed upgrade?
ERROR DBAPIError exception wrapped from (pymysql.err.InternalError) (1054, u"Unknown column 'user.created_at' in 'field list'") [SQL: u'SELECT user.enabled AS user_enabled, user.id AS user_id, user.extra AS user_extra, user.default_project_id AS user_default_project_id, user.created_at AS user_created_at, user.last_active_at AS user_last_active_at \nFROM user INNER JOIN local_user ON user.id = local_user.user_id \nWHERE local_user.name = %(name_1)s AND local_user.domain_id = %(domain_id_1)s'] [parameters: {u'domain_id_1': 'default', u'name_1': u'admin'}]
ERROR DBAPIError exception wrapped from (pymysql.err.InternalError) (1054, u"Unknown column 'user.created_at' in 'field list'") [SQL: u'SELECT user.enabled AS user_enabled, user.id AS user_id, user.extra AS user_extra, user.default_project_id AS user_default_project_id, user.created_at AS user_created_at, user.last_active_at AS user_last_active_at \nFROM user INNER JOIN local_user ON user.id = local_user.user_id \nWHERE local_user.name = %(name_1)s AND local_user.domain_id = %(domain_id_1)s'] [parameters: {u'domain_id_1': u'default', u'name_1': u'ceilometer'}]
ERROR DBAPIError exception wrapped from (pymysql.err.InternalError) (1054, u"Unknown column 'user.created_at' in 'field list'") [SQL: u'SELECT user.enabled AS user_enabled, user.id AS user_id, user.extra AS user_extra, user.default_project_id AS user_default_project_id, user.created_at AS user_created_at, user.last_active_at AS user_last_active_at \nFROM user INNER JOIN local_user ON user.id = local_user.user_id \nWHERE local_user.name = %(name_1)s AND local_user.domain_id = %(domain_id_1)s'] [parameters: {u'domain_id_1': u'default', u'name_1': u'neutron'}]
ERROR DBAPIError exception wrapped from (pymysql.err.InternalError) (1054, u"Unknown column 'user.created_at' in 'field list'") [SQL: u'SELECT user.enabled AS user_enabled, user.id AS user_id, user.extra AS user_extra, user.default_project_id AS user_default_project_id, user.created_at AS user_created_at, user.last_active_at AS user_last_active_at \nFROM user INNER JOIN local_user ON user.id = local_user.user_id \nWHERE local_user.name = %(name_1)s AND local_user.domain_id = %(domain_id_1)s'] [parameters: {u'domain_id_1': u'default', u'name_1': u'nova'}]
u"Unknown column 'user.created_at' in 'field list'") [SQL: u'SELECT user.enabled AS user_enabled, user.id AS user_id, user.extra AS user_extra, user.default_project_id AS user_default_project_id, user.created_at AS user_created_at, user.last_active_at AS user_last_active_at \nFROM user INNER JOIN local_user ON user.id = local_user.user_id \nWHERE local_user.name = %(name_1)s AND local_user.domain_id = %(domain_id_1)s'] [parameters: {u'domain_id_1': 'default', u'name_1': u'admin'}]
u"Unknown column 'user.created_at' in 'field list'") [SQL: u'SELECT user.enabled AS user_enabled, user.id AS user_id, user.extra AS user_extra, user.default_project_id AS user_default_project_id, user.created_at AS user_created_at, user.last_active_at AS user_last_active_at \nFROM user INNER JOIN local_user ON user.id = local_user.user_id \nWHERE local_user.name = %(name_1)s AND local_user.domain_id = %(domain_id_1)s'] [parameters: {u'domain_id_1': u'default', u'name_1': u'ceilometer'}]
u"Unknown column 'user.created_at' in 'field list'") [SQL: u'SELECT user.enabled AS user_enabled, user.id AS user_id, user.extra AS user_extra, user.default_project_id AS user_default_project_id, user.created_at AS user_created_at, user.last_active_at AS user_last_active_at \nFROM user INNER JOIN local_user ON user.id = local_user.user_id \nWHERE local_user.name = %(name_1)s AND local_user.domain_id = %(domain_id_1)s'] [parameters: {u'domain_id_1': u'default', u'name_1': u'neutron'}]
u"Unknown column 'user.created_at' in 'field list'") [SQL: u'SELECT user.enabled AS user_enabled, user.id AS user_id, user.extra AS user_extra, user.default_project_id AS user_default_project_id, user.created_at AS user_created_at, user.last_active_at AS user_last_active_at \nFROM user INNER JOIN local_user ON user.id = local_user.user_id \nWHERE local_user.name = %(name_1)s AND local_user.domain_id = %(domain_id_1)s'] [parameters: {u'domain_id_1': u'default', u'name_1': u'nova'}]
I could not reproduce this issue with my laptop environment. I can see "Migrating the keystone database" during the upgrade.
$ juju run-action keystone/0 openstack-upgrade eac8-4819- 8b9e-f2fa12116c 45
$ juju show-action-output 309d18e8-
results:
outcome: success, upgrade completed.
status: completed
timing:
completed: 2016-12-02 21:11:44 +0000 UTC
enqueued: 2016-12-02 21:10:08 +0000 UTC
started: 2016-12-02 21:10:09 +0000 UTC
$ juju debug-log --replay | grep -i database 0.juju- log Migrating the keystone database. 0.juju- log Database is initialised
...
unit-keystone-0: 22:11:03 INFO unit.keystone/
unit-keystone-0: 22:11:35 DEBUG unit.keystone/