← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2125185] Re: nova-tox-py312-threading fails intermittently

 

Reviewed:  https://review.opendev.org/c/openstack/nova/+/961781
Committed: https://opendev.org/openstack/nova/commit/520057663a4825d5b0fb07cf2252e4be5fa0b21d
Submitter: "Zuul (22348)"
Branch:    master

commit 520057663a4825d5b0fb07cf2252e4be5fa0b21d
Author: Balazs Gibizer <gibi@xxxxxxxxxx>
Date:   Fri Sep 19 10:58:36 2025 +0200

    [nova-tox-py312-threading]Ignore failing tests
    
    There is two intermittently failing tests we need to ignore for now so
    this patch extends the list.
    
    Closes-Bug: #2125185
    
    Change-Id: I8d440013c84ae1dac4e2a1f661fc31138944b032
    Signed-off-by: Balazs Gibizer <gibi@xxxxxxxxxx>


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/2125185

Title:
  nova-tox-py312-threading fails intermittently

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  nova.tests.unit.api.openstack.compute.test_services.ServicesTestV275.test_services_list_with_additional_filter_old_version:

  ft1.1: nova.tests.unit.api.openstack.compute.test_services.ServicesTestV275.test_services_list_with_additional_filter_old_versiontesttools.testresult.real._StringException: pythonlogging:'': {{{
  2025-09-18 15:25:40,853 WARNING [oslo_policy.policy] JSON formatted policy_file support is deprecated since Victoria release. You need to use YAML format which will be default in future. You can use ``oslopolicy-convert-json-to-yaml`` tool to convert existing JSON-formatted policy file to YAML-formatted in backward compatible way: https://docs.openstack.org/oslo.policy/latest/cli/oslopolicy-convert-json-to-yaml.html.
  2025-09-18 15:25:40,854 WARNING [oslo_policy.policy] JSON formatted policy_file support is deprecated since Victoria release. You need to use YAML format which will be default in future. You can use ``oslopolicy-convert-json-to-yaml`` tool to convert existing JSON-formatted policy file to YAML-formatted in backward compatible way: https://docs.openstack.org/oslo.policy/latest/cli/oslopolicy-convert-json-to-yaml.html.
  2025-09-18 15:25:40,855 WARNING [oslo_policy.policy] Policy Rules ['os_compute_api:extensions', 'os_compute_api:os-floating-ip-pools', 'os_compute_api:os-quota-sets:defaults', 'os_compute_api:os-availability-zone:list', 'os_compute_api:limits', 'project_manager_api', 'project_member_api', 'project_reader_api', 'service_api', 'project_manager_or_admin', 'project_member_or_admin', 'project_reader_or_admin', 'service_or_admin', 'os_compute_api:limits:other_project', 'os_compute_api:os-lock-server:unlock:unlock_override', 'os_compute_api:servers:create:zero_disk_flavor', 'compute:servers:resize:cross_cell', 'os_compute_api:os-shelve:unshelve_to_host'] specified in policy files are the same as the defaults provided by the service. You can remove these rules from policy files which will make maintenance easier. You can detect these redundant rules by ``oslopolicy-list-redundant`` tool also.
  2025-09-18 15:25:40,864 INFO [nova.utils] The cell worker thread pool MainProcess.cell_worker is initialized
  2025-09-18 15:25:40,878 ERROR [nova.context] Error gathering result from cell 00000000-0000-0000-0000-000000000000
  Traceback (most recent call last):
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1961, in _exec_single_context
      self.dialect.do_execute(
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/default.py", line 944, in do_execute
      cursor.execute(statement, parameters)
  sqlite3.OperationalError: cannot start a transaction within a transaction

  The above exception was the direct cause of the following exception:

  Traceback (most recent call last):
    File "/home/zuul/src/opendev.org/openstack/nova/nova/context.py", line 420, in gather_result
      result = fn(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/oslo_versionedobjects/base.py", line 184, in wrapper
      result = fn(cls, context, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/objects/service.py", line 730, in get_all
      db_services = availability_zones.set_availability_zones(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/availability_zones.py", line 71, in set_availability_zones
      aggregates = objects.AggregateList.get_by_metadata_key(context,
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/oslo_versionedobjects/base.py", line 184, in wrapper
      result = fn(cls, context, *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/objects/aggregate.py", line 536, in get_by_metadata_key
      db_aggregates = _get_by_metadata_from_db(context, key=key)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 1183, in wrapper
      return fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/objects/aggregate.py", line 459, in _get_by_metadata_from_db
      return query.all()
             ^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/orm/query.py", line 2704, in all
      return self._iter().all()  # type: ignore
             ^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/orm/query.py", line 2857, in _iter
      result: Union[ScalarResult[_T], Result[_T]] = self.session.execute(
                                                    ^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2365, in execute
      return self._execute_internal(
             ^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2241, in _execute_internal
      conn = self._connection_for_bind(bind)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2110, in _connection_for_bind
      return trans._connection_for_bind(engine, execution_options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<string>", line 2, in _connection_for_bind
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/orm/state_changes.py", line 137, in _go
      ret_value = fn(self, *arg, **kw)
                  ^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 1242, in _connection_for_bind
      transaction = conn.begin()
                    ^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 856, in begin
      self._transaction = RootTransaction(self)
                          ^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 2678, in __init__
      self._connection_begin_impl()
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 2696, in _connection_begin_impl
      self.connection._begin_impl(self)
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1099, in _begin_impl
      self.dispatch.begin(self)
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/event/attr.py", line 497, in __call__
      fn(*args, **kw)
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/oslo_db/sqlalchemy/engines.py", line 448, in _sqlite_emit_begin
      conn.execute(sqlalchemy.text("BEGIN"))
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1413, in execute
      return meth(
             ^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/sql/elements.py", line 526, in _execute_on_connection
      return connection._execute_clauseelement(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1635, in _execute_clauseelement
      ret = self._execute_context(
            ^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1840, in _execute_context
      return self._exec_single_context(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1980, in _exec_single_context
      self._handle_dbapi_exception(
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 2346, in _handle_dbapi_exception
      raise newraise.with_traceback(exc_info[2]) from e
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1961, in _exec_single_context
      self.dialect.do_execute(
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/default.py", line 944, in do_execute
      cursor.execute(statement, parameters)
  sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) cannot start a transaction within a transaction
  [SQL: BEGIN]
  (Background on this error at: https://sqlalche.me/e/20/e3q8)
  2025-09-18 15:25:40,888 ERROR [nova.api.openstack.wsgi] Unexpected exception in API method
  Traceback (most recent call last):
    File "/home/zuul/src/opendev.org/openstack/nova/nova/api/openstack/wsgi.py", line 767, in wrapped
      return f(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/api/validation/__init__.py", line 384, in wrapper
      return func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/api/validation/__init__.py", line 384, in wrapper
      return func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/api/openstack/compute/services.py", line 379, in index
      _services = self._get_services_list(req, ['forced_down'])
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/api/openstack/compute/services.py", line 127, in _get_services_list
      _services = self._get_services(req)
                  ^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/api/openstack/compute/services.py", line 65, in _get_services
      for s in self.host_api.service_get_all(context, set_zones=True,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/compute/api.py", line 6321, in service_get_all
      services = self._service_get_all_cells(context, disabled,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/compute/api.py", line 6264, in _service_get_all_cells
      cell0_computes = [
                       ^
  TypeError: 'OperationalError' object is not iterable
  }}}

  Traceback (most recent call last):
    File "/home/zuul/src/opendev.org/openstack/nova/nova/api/openstack/wsgi.py", line 767, in wrapped
      return f(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/api/validation/__init__.py", line 384, in wrapper
      return func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/api/validation/__init__.py", line 384, in wrapper
      return func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/api/openstack/compute/services.py", line 379, in index
      _services = self._get_services_list(req, ['forced_down'])
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/api/openstack/compute/services.py", line 127, in _get_services_list
      _services = self._get_services(req)
                  ^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/api/openstack/compute/services.py", line 65, in _get_services
      for s in self.host_api.service_get_all(context, set_zones=True,
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/compute/api.py", line 6321, in service_get_all
      services = self._service_get_all_cells(context, disabled,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/compute/api.py", line 6264, in _service_get_all_cells
      cell0_computes = [
                       ^
  TypeError: 'OperationalError' object is not iterable

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/home/zuul/src/opendev.org/openstack/nova/nova/tests/unit/api/openstack/compute/test_services.py", line 1362, in test_services_list_with_additional_filter_old_version
      self.controller.index(req)
    File "/home/zuul/src/opendev.org/openstack/nova/nova/api/openstack/wsgi.py", line 814, in wrapped
      raise webob.exc.HTTPInternalServerError(explanation=msg)
  webob.exc.HTTPInternalServerError: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
  <class 'TypeError'>

  Two builds hit it so far:

  Builds with matching logs 2/10:
  +----------------------------------+---------------------+----------------+----------+-----------------------------------+--------+
  | uuid                             | finished            | project        | pipeline | review                            | branch |
  +----------------------------------+---------------------+----------------+----------+-----------------------------------+--------+
  | 146ecd079c564b2491ec6873c6194ae1 | 2025-09-18T15:31:27 | openstack/nova | check    | https://review.opendev.org/961634 | master |
  | 4aed0df34af84312a500a2e43632f1fa | 2025-09-05T15:23:05 | openstack/nova | check    | https://review.opendev.org/959866 | master |
  +----------------------------------+---------------------+----------------+----------+-----------------------------------+--------+

  This should be categorized as
  https://github.com/openstack/nova/blob/master/threading_unit_test_excludes.txt#L72

  ---

  There is another failure that is a variant of this in 
  nova.tests.unit.conductor.test_conductor.ConductorTaskRPCAPITestCase.test_evacuate_old_rpc_without_target_state

  ft1.4: nova.tests.unit.conductor.test_conductor.ConductorTaskRPCAPITestCase.test_evacuate_old_rpc_without_target_statetesttools.testresult.real._StringException: pythonlogging:'': {{{
  2025-09-15 14:48:42,676 WARNING [oslo_policy.policy] JSON formatted policy_file support is deprecated since Victoria release. You need to use YAML format which will be default in future. You can use ``oslopolicy-convert-json-to-yaml`` tool to convert existing JSON-formatted policy file to YAML-formatted in backward compatible way: https://docs.openstack.org/oslo.policy/latest/cli/oslopolicy-convert-json-to-yaml.html.
  2025-09-15 14:48:42,677 WARNING [oslo_policy.policy] JSON formatted policy_file support is deprecated since Victoria release. You need to use YAML format which will be default in future. You can use ``oslopolicy-convert-json-to-yaml`` tool to convert existing JSON-formatted policy file to YAML-formatted in backward compatible way: https://docs.openstack.org/oslo.policy/latest/cli/oslopolicy-convert-json-to-yaml.html.
  2025-09-15 14:48:42,679 WARNING [oslo_policy.policy] Policy Rules ['os_compute_api:extensions', 'os_compute_api:os-floating-ip-pools', 'os_compute_api:os-quota-sets:defaults', 'os_compute_api:os-availability-zone:list', 'os_compute_api:limits', 'project_manager_api', 'project_member_api', 'project_reader_api', 'service_api', 'project_manager_or_admin', 'project_member_or_admin', 'project_reader_or_admin', 'service_or_admin', 'os_compute_api:limits:other_project', 'os_compute_api:os-lock-server:unlock:unlock_override', 'os_compute_api:servers:create:zero_disk_flavor', 'compute:servers:resize:cross_cell', 'os_compute_api:os-shelve:unshelve_to_host'] specified in policy files are the same as the defaults provided by the service. You can remove these rules from policy files which will make maintenance easier. You can detect these redundant rules by ``oslopolicy-list-redundant`` tool also.
  2025-09-15 14:48:42,690 INFO [nova.virt.driver] Loading compute driver 'fake.SmallFakeDriver'
  2025-09-15 14:48:42,690 INFO [nova.compute.provider_config] No provider configs found in /etc/nova/provider_config/. If files are present, ensure the Nova process has access.
  2025-09-15 14:48:42,695 INFO [nova.compute.provider_config] No provider configs found in /etc/nova/provider_config/. If files are present, ensure the Nova process has access.
  2025-09-15 14:48:42,696 WARNING [nova.compute.manager] Found orphan compute node 2 hypervisor host is fake_phyp1, nodes are {'fakenode2', 'fakenode1'}. We are not deleting this as the driver says this node has not been deleted.
  2025-09-15 14:48:42,704 WARNING [nova.compute.resource_tracker] No compute node record for fake-mini:6afc9855-b923-42b6-9dfd-8ddd5786329a
  2025-09-15 14:48:42,710 INFO [nova.compute.resource_tracker] Compute node record created for fake-mini:fakenode2 with uuid: 6afc9855-b923-42b6-9dfd-8ddd5786329a
  2025-09-15 14:48:42,753 WARNING [nova.compute.resource_tracker] No compute node record for fake-mini:61287d5b-e870-45fd-9be6-5a380217f143
  2025-09-15 14:48:42,756 INFO [nova.compute.resource_tracker] Compute node record created for fake-mini:fakenode1 with uuid: 61287d5b-e870-45fd-9be6-5a380217f143
  2025-09-15 14:48:42,781 INFO [nova.utils] The cell worker thread pool MainProcess.cell_worker is initialized
  2025-09-15 14:48:42,790 INFO [nova.service] Starting conductor node (version 32.1.0)
  2025-09-15 14:48:42,960 ERROR [oslo_messaging.rpc.server] Exception during message handling
  Traceback (most recent call last):
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/oslo_messaging/rpc/server.py", line 174, in _process_incoming
      res = self.dispatcher.dispatch(message)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/oslo_messaging/rpc/dispatcher.py", line 309, in dispatch
      return self._do_dispatch(endpoint, method, ctxt, args)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/oslo_messaging/rpc/dispatcher.py", line 229, in _do_dispatch
      result = func(ctxt, **new_args)
               ^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/conductor/manager.py", line 102, in wrapper
      return fn(self, context, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/conductor/manager.py", line 1366, in rebuild_instance
      compute_utils.notify_about_instance_rebuild(
    File "/home/zuul/src/opendev.org/openstack/nova/nova/rpc.py", line 249, in wrapped
      return f(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/compute/utils.py", line 935, in notify_about_instance_rebuild
      notification.emit(context)
    File "/home/zuul/src/opendev.org/openstack/nova/nova/rpc.py", line 249, in wrapped
      return f(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/notifications/objects/base.py", line 227, in emit
      self._emit(context,
    File "/home/zuul/src/opendev.org/openstack/nova/nova/notifications/objects/base.py", line 215, in _emit
      notify(context, event_type=event_type, payload=payload)
    File "/home/zuul/src/opendev.org/openstack/nova/nova/tests/fixtures/notifications.py", line 163, in _notify
      sender_test_case_id = self._get_sender_test_case_id()
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/tests/fixtures/notifications.py", line 159, in _get_sender_test_case_id
      current = current.parent
                ^^^^^^^^^^^^^^
  AttributeError: 'NoneType' object has no attribute 'parent'
  }}}

  Traceback (most recent call last):
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1961, in _exec_single_context
      self.dialect.do_execute(
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/default.py", line 944, in do_execute
      cursor.execute(statement, parameters)
  sqlite3.OperationalError: cannot start a transaction within a transaction

  The above exception was the direct cause of the following exception:

  Traceback (most recent call last):
    File "/home/zuul/src/opendev.org/openstack/nova/nova/tests/unit/compute/test_compute.py", line 288, in tearDown
      db.instance_destroy(ctxt, instance['uuid'])
    File "/home/zuul/src/opendev.org/openstack/nova/nova/db/utils.py", line 35, in wrapper
      return f(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/oslo_db/api.py", line 144, in wrapper
      with excutils.save_and_reraise_exception() as ectxt:
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/oslo_utils/excutils.py", line 227, in __exit__
      self.force_reraise()
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/oslo_utils/excutils.py", line 200, in force_reraise
      raise self.value
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/oslo_db/api.py", line 142, in wrapper
      return f(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/db/main/api.py", line 207, in wrapper
      return f(context, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/db/main/api.py", line 1315, in instance_destroy
      instance_ref = _instance_get_by_uuid(context, instance_uuid)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/nova/db/main/api.py", line 1401, in _instance_get_by_uuid
      ).filter_by(uuid=uuid).first()
                             ^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/orm/query.py", line 2759, in first
      return self.limit(1)._iter().first()  # type: ignore
             ^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/orm/query.py", line 2857, in _iter
      result: Union[ScalarResult[_T], Result[_T]] = self.session.execute(
                                                    ^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2365, in execute
      return self._execute_internal(
             ^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2241, in _execute_internal
      conn = self._connection_for_bind(bind)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 2110, in _connection_for_bind
      return trans._connection_for_bind(engine, execution_options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "<string>", line 2, in _connection_for_bind
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/orm/state_changes.py", line 137, in _go
      ret_value = fn(self, *arg, **kw)
                  ^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 1242, in _connection_for_bind
      transaction = conn.begin()
                    ^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 856, in begin
      self._transaction = RootTransaction(self)
                          ^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 2678, in __init__
      self._connection_begin_impl()
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 2696, in _connection_begin_impl
      self.connection._begin_impl(self)
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1099, in _begin_impl
      self.dispatch.begin(self)
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/event/attr.py", line 497, in __call__
      fn(*args, **kw)
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/oslo_db/sqlalchemy/engines.py", line 448, in _sqlite_emit_begin
      conn.execute(sqlalchemy.text("BEGIN"))
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1413, in execute
      return meth(
             ^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/sql/elements.py", line 526, in _execute_on_connection
      return connection._execute_clauseelement(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1635, in _execute_clauseelement
      ret = self._execute_context(
            ^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1840, in _execute_context
      return self._exec_single_context(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1980, in _exec_single_context
      self._handle_dbapi_exception(
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 2346, in _handle_dbapi_exception
      raise newraise.with_traceback(exc_info[2]) from e
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1961, in _exec_single_context
      self.dialect.do_execute(
    File "/home/zuul/src/opendev.org/openstack/nova/.tox/py312-threading/lib/python3.12/site-packages/sqlalchemy/engine/default.py", line 944, in do_execute
      cursor.execute(statement, parameters)
  sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) cannot start a transaction within a transaction
  [SQL: BEGIN]
  (Background on this error at: https://sqlalche.me/e/20/e3q8)

  Only a single hit so far:

  Builds with matching logs 1/10:
  +----------------------------------+---------------------+----------------+----------+-----------------------------------+--------+
  | uuid                             | finished            | project        | pipeline | review                            | branch |
  +----------------------------------+---------------------+----------------+----------+-----------------------------------+--------+
  | d7e3a680f4bc411ab9e0bb6707e12d24 | 2025-09-15T14:54:50 | openstack/nova | check    | https://review.opendev.org/960349 | master |
  +----------------------------------+---------------------+----------------+----------+-----------------------------------+--------+

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



References