[Bug 1899104] Re: [SRU] barbican-manage db upgrade fails with MySQL8

David Ames 1899104 at bugs.launchpad.net
Tue Mar 30 16:22:44 UTC 2021


Verification on bionic-ussuri is successful:

# sudo -u barbican barbican-manage db upgrade
2021-03-30 16:20:55.622 28161 WARNING oslo_db.sqlalchemy.engines [-] MySQL SQL mode is 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION', consider enabling TRADITIONAL or STRICT_ALL_TABLES
2021-03-30 16:20:55.640 28161 INFO alembic.runtime.migration [-] Context impl MySQLImpl.
2021-03-30 16:20:55.641 28161 INFO alembic.runtime.migration [-] Will assume non-transactional DDL.

# dpkg -l |grep barbican
ii  barbican-api                     1:10.0.0-0ubuntu0.20.04.3~cloud0            all          OpenStack Key Management Service - API Server
ii  barbican-common                  1:10.0.0-0ubuntu0.20.04.3~cloud0            all          OpenStack Key Management Service - common files
ii  barbican-worker                  1:10.0.0-0ubuntu0.20.04.3~cloud0            all          OpenStack Key Management Service - Worker Node
ii  python3-barbican                 1:10.0.0-0ubuntu0.20.04.3~cloud0            all          OpenStack Key Management Service - Python 3 files
ii  python3-barbicanclient           4.10.0-0ubuntu1~cloud0                      all          OpenStack Key Management API client - Python 3.x

# apt-cache policy python3-barbican
python3-barbican:
  Installed: 1:10.0.0-0ubuntu0.20.04.3~cloud0
  Candidate: 1:10.0.0-0ubuntu0.20.04.3~cloud0
  Version table:
 *** 1:10.0.0-0ubuntu0.20.04.3~cloud0 500
        500 http://ubuntu-cloud.archive.canonical.com/ubuntu bionic-proposed/ussuri/main amd64 Packages
        100 /var/lib/dpkg/status


** Tags removed: verification-ussuri-needed
** Tags added: verification-done-ussuri

-- 
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to barbican in Ubuntu.
https://bugs.launchpad.net/bugs/1899104

Title:
  [SRU] barbican-manage db upgrade fails with MySQL8

Status in barbican package in Ubuntu:
  Fix Released
Status in barbican source package in Focal:
  Fix Released
Status in barbican source package in Groovy:
  Fix Released

Bug description:
  [Impact]

  New installations of OpenStack Barbican with Mysql8 fail with a
  traceback when trying to initialize the database

  [Test Case]

  Use the OpenStack charms to deploy Barbican on Ubuntu Focal. Using
  Focal is expected to have a traceback and with this change is expected
  to setup successfully.

  [Regression Potential]

  The regression potential for this is minimal as the package currently
  does not work at all with mysql8 which ships with Ubuntu Focal.

  The proposed change is a cherry-pick from upstream that resolves this issue by rebasing the old migrations into a single larger migration. This
  only affects new deploys that would normally step through all of the old
  migrations so shouldn't affect running deploys.

  -----------------------------------------------------

  Running

  barbican-manage db upgrade fails with the following traceback when the
  DB is mysql8:

  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters Traceback (most recent call last):
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python3/dist-packages/sqlalchemy/engine/base.py", line 1245, in _execute_context
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters     self.dialect.do_execute(
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python3/dist-packages/sqlalchemy/engine/default.py", line 581, in do_execute
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters     cursor.execute(statement, parameters)
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python3/dist-packages/pymysql/cursors.py", line 170, in execute
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters     result = self._query(query)
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python3/dist-packages/pymysql/cursors.py", line 328, in _query
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters     conn.query(q)
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python3/dist-packages/pymysql/connections.py", line 517, in query
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters     self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python3/dist-packages/pymysql/connections.py", line 732, in _read_query_result
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters     result.read()
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python3/dist-packages/pymysql/connections.py", line 1075, in read
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters     first_packet = self.connection._read_packet()
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python3/dist-packages/pymysql/connections.py", line 684, in _read_packet
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters     packet.check_error()
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python3/dist-packages/pymysql/protocol.py", line 220, in check_error
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters     err.raise_mysql_exception(self._data)
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters   File "/usr/lib/python3/dist-packages/pymysql/err.py", line 109, in raise_mysql_exception
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters     raise errorclass(errno, errval)
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters pymysql.err.InternalError: (3959, "Check constraint 'secret_acls_chk_2' uses column 'creator_only', hence column cannot be dropped or renamed.")
  2020-10-08 22:31:32.028 28131 ERROR oslo_db.sqlalchemy.exc_filters
  ERROR: (pymysql.err.InternalError) (3959, "Check constraint 'secret_acls_chk_2' uses column 'creator_only', hence column cannot be dropped or renamed.")
  [SQL: ALTER TABLE secret_acls CHANGE creator_only project_access BOOL NULL]

  Seems this is a known issue with alembic [0]

  [1] https://github.com/sqlalchemy/alembic/issues/699

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/barbican/+bug/1899104/+subscriptions



More information about the Ubuntu-openstack-bugs mailing list