failure of tacker-db-manage for unsupported features in SQLAlchemy2.0

Bug #2066046 reported by Yasufumi Ogawa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
New
Critical
Unassigned

Bug Description

Since the recent update of versions of sqlalchemy[1], some functions and attributes in alembic migration scripts are not supported and cause errors while running tacker-db-manage script. Some related scripts under `tacker/tacker/db/migration/alembic_migrations/versions/` should be updated for following the changes.

[1] https://review.opendev.org/c/openstack/requirements/+/879743

2024-05-15 12:19:13.895 | ++ /opt/stack/tacker/devstack/lib/tacker:init_tacker:165 : /opt/stack/data/venv/bin/tacker-db-manage --config-file /etc/tacker/tacker.conf upgrade head
2024-05-15 12:19:14.316 | /opt/stack/data/venv/lib/python3.10/site-packages/oslo_db/sqlalchemy/enginefacade.py:334: NotSupportedWarning: Configuration option(s) ['__autocommit'] not supported
2024-05-15 12:19:14.316 | warnings.warn(
2024-05-15 12:19:14.773 | INFO [alembic.runtime.migration] Context impl MySQLImpl.
2024-05-15 12:19:14.773 | INFO [alembic.runtime.migration] Will assume non-transactional DDL.
2024-05-15 12:19:14.814 | INFO [alembic.runtime.migration] Running upgrade -> 1c6b0d82afcd, add tables for tacker framework
2024-05-15 12:19:14.908 | INFO [alembic.runtime.migration] Running upgrade 1c6b0d82afcd -> 81ffa86020d, rpc_proxy
2024-05-15 12:19:14.962 | INFO [alembic.runtime.migration] Running upgrade 81ffa86020d -> 4c31092895b8, empty message
2024-05-15 12:19:14.966 | INFO [alembic.runtime.migration] Running upgrade 4c31092895b8 -> 13c0e0661015, add description to vnf
2024-05-15 12:19:14.986 | INFO [alembic.runtime.migration] Running upgrade 13c0e0661015 -> 5958429bcb3c, modify datatype of value
2024-05-15 12:19:15.037 | INFO [alembic.runtime.migration] Running upgrade 5958429bcb3c -> 12a57080b277, Add Service related dbs
2024-05-15 12:19:15.187 | INFO [alembic.runtime.migration] Running upgrade 12a57080b277 -> 12a57080b278, Alter devices
2024-05-15 12:19:15.382 | INFO [alembic.runtime.migration] Running upgrade 12a57080b278 -> 2774a42c7163, remove service related
2024-05-15 12:19:15.490 | INFO [alembic.runtime.migration] Running upgrade 2774a42c7163 -> 24bec5f211c7, Alter value in deviceattributes
2024-05-15 12:19:15.580 | INFO [alembic.runtime.migration] Running upgrade 24bec5f211c7 -> 5246a6bd410f, multisite_vim
2024-05-15 12:19:15.743 | INFO [alembic.runtime.migration] Running upgrade 5246a6bd410f -> acf941e54075, Add error_reason to device
2024-05-15 12:19:15.769 | INFO [alembic.runtime.migration] Running upgrade acf941e54075 -> f958f58e5daa, uuid consistency
2024-05-15 12:19:18.465 | INFO [alembic.runtime.migration] Running upgrade f958f58e5daa -> 6e56d4474b2a, blob-to-json-text
2024-05-15 12:19:18.468 | Traceback (most recent call last):
2024-05-15 12:19:18.468 | File "/opt/stack/data/venv/bin/tacker-db-manage", line 10, in <module>
2024-05-15 12:19:18.468 | sys.exit(main())
2024-05-15 12:19:18.468 | File "/opt/stack/tacker/tacker/db/migration/cli.py", line 222, in main
2024-05-15 12:19:18.468 | CONF.command.func(config, CONF.command.name)
2024-05-15 12:19:18.468 | File "/opt/stack/tacker/tacker/db/migration/cli.py", line 70, in do_upgrade
2024-05-15 12:19:18.469 | do_alembic_command(config, cmd, revision, sql=CONF.command.sql)
2024-05-15 12:19:18.469 | File "/opt/stack/tacker/tacker/db/migration/cli.py", line 49, in do_alembic_command
2024-05-15 12:19:18.469 | getattr(alembic_command, cmd)(config, *args, **kwargs)
2024-05-15 12:19:18.469 | File "/opt/stack/data/venv/lib/python3.10/site-packages/alembic/command.py", line 403, in upgrade
2024-05-15 12:19:18.469 | script.run_env()
2024-05-15 12:19:18.469 | File "/opt/stack/data/venv/lib/python3.10/site-packages/alembic/script/base.py", line 583, in run_env
2024-05-15 12:19:18.469 | util.load_python_file(self.dir, "env.py")
2024-05-15 12:19:18.469 | File "/opt/stack/data/venv/lib/python3.10/site-packages/alembic/util/pyfiles.py", line 95, in load_python_file
2024-05-15 12:19:18.469 | module = load_module_py(module_id, path)
2024-05-15 12:19:18.469 | File "/opt/stack/data/venv/lib/python3.10/site-packages/alembic/util/pyfiles.py", line 113, in load_module_py
2024-05-15 12:19:18.469 | spec.loader.exec_module(module) # type: ignore
2024-05-15 12:19:18.469 | File "<frozen importlib._bootstrap_external>", line 883, in exec_module
2024-05-15 12:19:18.469 | File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
2024-05-15 12:19:18.470 | File "/opt/stack/tacker/tacker/db/migration/alembic_migrations/env.py", line 84, in <module>
2024-05-15 12:19:18.470 | run_migrations_online()
2024-05-15 12:19:18.470 | File "/opt/stack/tacker/tacker/db/migration/alembic_migrations/env.py", line 76, in run_migrations_online
2024-05-15 12:19:18.470 | context.run_migrations()
2024-05-15 12:19:18.470 | File "<string>", line 8, in run_migrations
2024-05-15 12:19:18.470 | File "/opt/stack/data/venv/lib/python3.10/site-packages/alembic/runtime/environment.py", line 948, in run_migrations
2024-05-15 12:19:18.470 | self.get_context().run_migrations(**kw)
2024-05-15 12:19:18.470 | File "/opt/stack/data/venv/lib/python3.10/site-packages/alembic/runtime/migration.py", line 627, in run_migrations
2024-05-15 12:19:18.470 | step.migration_fn(**kw)
2024-05-15 12:19:18.470 | File "/opt/stack/tacker/tacker/db/migration/alembic_migrations/versions/6e56d4474b2a_blob_to_json_text.py", line 57, in upgrade
2024-05-15 12:19:18.470 | _migrate_data('vims', 'placement_attr')
2024-05-15 12:19:18.470 | File "/opt/stack/tacker/tacker/db/migration/alembic_migrations/versions/6e56d4474b2a_blob_to_json_text.py", line 45, in _migrate_data
2024-05-15 12:19:18.471 | for r in t.select().execute():
2024-05-15 12:19:18.471 | AttributeError: 'Select' object has no attribute 'execute'
2024-05-15 12:19:18.632 | + /opt/stack/tacker/devstack/lib/tacker:init_tacker:1 : exit_trap
2024-05-15 12:19:18.633 | + ./stack.sh:exit_trap:549 : local r=1
2024-05-15 12:19:18.634 | ++ ./stack.sh:exit_trap:550 : jobs -p
2024-05-15 12:19:18.635 | + ./stack.sh:exit_trap:550 : jobs=
2024-05-15 12:19:18.636 | + ./stack.sh:exit_trap:553 : [[ -n '' ]]
2024-05-15 12:19:18.637 | + ./stack.sh:exit_trap:559 : '[' -f /tmp/tmp.NHeJPzEh0O ']'
2024-05-15 12:19:18.638 | + ./stack.sh:exit_trap:560 : rm /tmp/tmp.NHeJPzEh0O
2024-05-15 12:19:18.640 | + ./stack.sh:exit_trap:564 : kill_spinner
2024-05-15 12:19:18.641 | + ./stack.sh:kill_spinner:459 : '[' '!' -z '' ']'
2024-05-15 12:19:18.642 | + ./stack.sh:exit_trap:566 : [[ 1 -ne 0 ]]
2024-05-15 12:19:18.643 | + ./stack.sh:exit_trap:567 : echo 'Error on exit'
2024-05-15 12:19:18.643 | Error on exit
2024-05-15 12:19:18.644 | + ./stack.sh:exit_trap:569 : type -p generate-subunit
2024-05-15 12:19:18.645 | + ./stack.sh:exit_trap:570 : generate-subunit 1715774676 882 fail
2024-05-15 12:19:18.728 | + ./stack.sh:exit_trap:572 : [[ -z /opt/stack/logs ]]
2024-05-15 12:19:18.729 | + ./stack.sh:exit_trap:575 : /opt/stack/data/venv/bin/python3 /opt/stack/devstack/tools/worlddump.py -d /opt/stack/logs

Revision history for this message
Yasufumi Ogawa (yasufum) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.