undercloud upgrade failed with DBError: (pymysql.err.InternalError) (1050, u"Table 'conductors' already exists")

Solution In Progress - Updated -

Issue

  • openstack undercloud upgrade fails with an error similar to this one:
2020-10-14 06:58:12 - Notice: /Stage[main]/Mistral::Db::Sync/Exec[mistral-db-sync]/returns: executed successfully
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns: Option "rpc_backend" from group "DEFAULT" is deprecated for removal.  Its value may be silently ignored in the future.
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns: INFO  [alembic.runtime.migration] Context impl MySQLImpl.
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns: INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns: INFO  [alembic.runtime.migration] Running upgrade  -> 2581ebaf0cb2, initial migration
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns: CRITI [ironic] DBError: (pymysql.err.InternalError) (1050, u"Table 'conductors' already exists") [SQL: u'\nCREATE TABLE conductors (\n\tcreated_at DATETIME, \n\tupdated_at DATETIME, \n\tid INTEGER NOT NULL AUTO_INCREMENT, \n\thostname VARCHAR(255) NOT NULL, \n\tdrivers TEXT, \n\tPRIMARY KEY (id), \n\tCONSTRAINT uniq_conductors0hostname UNIQUE (hostname)\n)ENGINE=InnoDB DEFAULT CHARSET=UTF8\n\n']
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns: Traceback (most recent call last):
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/bin/ironic-dbsync", line 10, in <module>
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     sys.exit(main())
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/ironic/cmd/dbsync.py", line 103, in main
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     CONF.command.func()
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/ironic/cmd/dbsync.py", line 35, in upgrade
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     migration.upgrade(CONF.command.revision)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/ironic/db/migration.py", line 36, in upgrade
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     return get_backend().upgrade(version)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/ironic/db/sqlalchemy/migration.py", line 56, in upgrade
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     alembic.command.upgrade(config, revision or 'head')
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/alembic/command.py", line 174, in upgrade
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     script.run_env()
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/alembic/script/base.py", line 407, in run_env
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     util.load_python_file(self.dir, 'env.py')
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/alembic/util/pyfiles.py", line 93, in load_python_file
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     module = load_module_py(module_id, path)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/alembic/util/compat.py", line 79, in load_module_py
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     mod = imp.load_source(module_id, path, fp)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/ironic/db/sqlalchemy/alembic/env.py", line 61, in <module>
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     run_migrations_online()
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/ironic/db/sqlalchemy/alembic/env.py", line 58, in run_migrations_online
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     context.run_migrations()
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "<string>", line 8, in run_migrations
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/alembic/runtime/environment.py", line 797, in run_migrations
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     self.get_context().run_migrations(**kw)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/alembic/runtime/migration.py", line 312, in run_migrations
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     step.migration_fn(**kw)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/ironic/db/sqlalchemy/alembic/versions/2581ebaf0cb2_initial_migration.py", line 42, in upgrade
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     mysql_DEFAULT_CHARSET='UTF8'
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "<string>", line 8, in create_table
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "<string>", line 3, in create_table
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/alembic/operations/ops.py", line 1098, in create_table
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     return operations.invoke(op)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/alembic/operations/base.py", line 318, in invoke
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     return fn(self, operation)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/alembic/operations/toimpl.py", line 101, in create_table
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     operations.impl.create_table(table)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/alembic/ddl/impl.py", line 194, in create_table
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     self._exec(schema.CreateTable(table))
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/alembic/ddl/impl.py", line 118, in _exec
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     return conn.execute(construct, *multiparams, **params)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 914, in execute
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     return meth(self, multiparams, params)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib64/python2.7/site-packages/sqlalchemy/sql/ddl.py", line 68, in _execute_on_connection
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     return connection._execute_ddl(self, multiparams, params)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 968, in _execute_ddl
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     compiled
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1146, in _execute_context
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     context)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1337, in _handle_dbapi_exception
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     util.raise_from_cause(newraise, exc_info)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib64/python2.7/site-packages/sqlalchemy/util/compat.py", line 200, in raise_from_cause
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     reraise(type(exception), exception, tb=exc_tb)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     context)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     cursor.execute(statement, parameters)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/pymysql/cursors.py", line 166, in execute
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     result = self._query(query)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/pymysql/cursors.py", line 322, in _query
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     conn.query(q)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 841, in query
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     self._affected_rows = self._read_query_result(unbuffered=unbuffered)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 1029, in _read_query_result
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     result.read()
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 1312, in read
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     first_packet = self.connection._read_packet()
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 991, in _read_packet
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     packet.check_error()
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 393, in check_error
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     err.raise_mysql_exception(self._data)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:   File "/usr/lib/python2.7/site-packages/pymysql/err.py", line 107, in raise_mysql_exception
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns:     raise errorclass(errno, errval)
2020-10-14 06:59:12 - Notice: /Stage[main]/Ironic::Db::Sync/Exec[ironic-dbsync]/returns: DBError: (pymysql.err.InternalError) (1050, u"Table 'conductors' already exists") [SQL: u'\nCREATE TABLE conductors (\n\tcreated_at DATETIME, \n\tupdated_at DATETIME, \n\tid INTEGER NOT NULL AUTO_INCREMENT, \n\thostname VARCHAR(255) NOT NULL, \n\tdrivers TEXT, \n\tPRIMARY KEY (id), \n\tCONSTRAINT uniq_conductors0hostname UNIQUE (hostname)\n)ENGINE=InnoDB DEFAULT CHARSET=UTF8\n\n']
2020-10-14 06:59:12 - Error: ironic-dbsync --config-file /etc/ironic/ironic.conf  returned 1 instead of one of [0]

Environment

  • Red Hat OpenStack Platform 10.0 (RHOSP)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content