amphora update API call fails

Bug #2039281 reported by Gregory Thiemonge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
octavia
Fix Released
High
Gregory Thiemonge

Bug Description

on master and 2023.2

amphora update API call fails because a sqlalchemy transaction already exists

seen in the CI:
https://bc75cdbb8efc10b29313-45537cc5c7120f43f6e626c6c78dc0c0.ssl.cf1.rackcdn.com/898212/1/check/octavia-v2-dsvm-noop-api/3bcdf31/controller/logs/screen-o-cw.txt

note: the tempest test doesn't fail because it doesn't check that the config of amphora was correctly updated

Oct 13 09:39:06.952583 np0035490584 octavia-worker[74674]: INFO octavia.controller.queue.v2.endpoints [-] Updating amphora '39afc7c4-02d0-47a1-aeeb-1bdcb3f36fda' agent configuration...
Oct 13 09:39:06.952913 np0035490584 octavia-worker[74674]: INFO octavia.controller.worker.v2.controller_worker [-] Start amphora agent configuration update, amphora's id is: 39afc7c4-02d0-47a1-aeeb-1bdcb3f36fda
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server [-] Exception during message handling: sqlalchemy.exc.InvalidRequestError: A transaction is already begun on this Session.
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server Traceback (most recent call last):
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server File "/opt/stack/data/venv/lib/python3.10/site-packages/oslo_messaging/rpc/server.py", line 165, in _process_incoming
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server res = self.dispatcher.dispatch(message)
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server File "/opt/stack/data/venv/lib/python3.10/site-packages/oslo_messaging/rpc/dispatcher.py", line 309, in dispatch
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server return self._do_dispatch(endpoint, method, ctxt, args)
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server File "/opt/stack/data/venv/lib/python3.10/site-packages/oslo_messaging/rpc/dispatcher.py", line 229, in _do_dispatch
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server result = func(ctxt, **new_args)
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server File "/opt/stack/octavia/octavia/controller/queue/v2/endpoints.py", line 170, in update_amphora_agent_config
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server self.worker.update_amphora_agent_config(amphora_id)
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server File "/opt/stack/octavia/octavia/controller/worker/v2/controller_worker.py", line 1251, in update_amphora_agent_config
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server lb = self._amphora_repo.get_lb_for_amphora(session,
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server File "/opt/stack/octavia/octavia/db/repositories.py", line 1247, in get_lb_for_amphora
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server with session.begin():
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server File "<string>", line 2, in begin
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server File "/opt/stack/data/venv/lib/python3.10/site-packages/sqlalchemy/util/deprecations.py", line 309, in warned
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server return fn(*args, **kwargs)
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server File "/opt/stack/data/venv/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 1331, in begin
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server raise sa_exc.InvalidRequestError(
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server sqlalchemy.exc.InvalidRequestError: A transaction is already begun on this Session.
Oct 13 09:39:06.980713 np0035490584 octavia-worker[74674]: ERROR oslo_messaging.rpc.server

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to octavia (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/octavia/+/898232

Changed in octavia:
status: New → In Progress
Changed in octavia:
assignee: nobody → Gregory Thiemonge (gthiemonge)
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to octavia (master)

Reviewed: https://review.opendev.org/c/openstack/octavia/+/898232
Committed: https://opendev.org/openstack/octavia/commit/e756866a7ba2dfad14b3d89b6f016c59fa6d8972
Submitter: "Zuul (22348)"
Branch: master

commit e756866a7ba2dfad14b3d89b6f016c59fa6d8972
Author: Gregory Thiemonge <email address hidden>
Date: Fri Oct 13 10:19:11 2023 -0400

    Fix Amphora Configure API call

    The Amphora Configure API call failed because a new sqlalchemy
    transaction was created but a transaction was already begun.
    Remove the nested begin() calls to fix the issue.

    Closes-Bug: #2039281
    Change-Id: Ie20cce4e8355737711a9def7470550e4e43c0c35

Changed in octavia:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to octavia (stable/2023.2)

Fix proposed to branch: stable/2023.2
Review: https://review.opendev.org/c/openstack/octavia/+/898766

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/octavia 14.0.0.0rc1

This issue was fixed in the openstack/octavia 14.0.0.0rc1 release candidate.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to octavia (stable/2023.2)

Reviewed: https://review.opendev.org/c/openstack/octavia/+/898766
Committed: https://opendev.org/openstack/octavia/commit/7c67c1023200b11995672619145711420ae8a50f
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit 7c67c1023200b11995672619145711420ae8a50f
Author: Gregory Thiemonge <email address hidden>
Date: Fri Oct 13 10:19:11 2023 -0400

    Fix Amphora Configure API call

    The Amphora Configure API call failed because a new sqlalchemy
    transaction was created but a transaction was already begun.
    Remove the nested begin() calls to fix the issue.

    Closes-Bug: #2039281
    Change-Id: Ie20cce4e8355737711a9def7470550e4e43c0c35
    (cherry picked from commit e756866a7ba2dfad14b3d89b6f016c59fa6d8972)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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