ORM session: SQL execution without transaction in progress

Bug #1995738 reported by Felipe Reyes
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Cloud Archive
New
Undecided
Unassigned
Zed
New
Undecided
Unassigned
neutron
Fix Released
High
Felipe Reyes
neutron (Ubuntu)
New
Undecided
Unassigned
Kinetic
Won't Fix
Undecided
Unassigned

Bug Description

When deploying neutron on Kinetic the stacktrace below

Platform: Kinetic on s390x

ii python3-sqlalchemy 1.4.31+ds1-1build1 all SQL toolkit and Object Relational Mapper for Python 3
ii python3-sqlalchemy-ext:s390x 1.4.31+ds1-1build1 s390x SQL toolkit and Object Relational Mapper for Python3 - C extension

ORM session: SQL execution without transaction in progress, traceback:
  File "/usr/lib/python3/dist-packages/eventlet/greenthread.py", line 221, in main
    result = function(*args, **kwargs)

  File "/usr/lib/python3/dist-packages/eventlet/wsgi.py", line 825, in process_request
    proto.__init__(conn_state, self)

  File "/usr/lib/python3/dist-packages/eventlet/wsgi.py", line 357, in __init__
    self.handle()

  File "/usr/lib/python3/dist-packages/eventlet/wsgi.py", line 390, in handle
    self.handle_one_request()

  File "/usr/lib/python3/dist-packages/eventlet/wsgi.py", line 466, in handle_one_request
    self.handle_one_response()

  File "/usr/lib/python3/dist-packages/eventlet/wsgi.py", line 573, in handle_one_response
    result = self.application(self.environ, start_response)

  File "/usr/lib/python3/dist-packages/paste/urlmap.py", line 216, in __call__
    return app(environ, start_response)

  File "/usr/lib/python3/dist-packages/webob/dec.py", line 129, in __call__
    resp = self.call_func(req, *args, **kw)

  File "/usr/lib/python3/dist-packages/webob/dec.py", line 193, in call_func
    return self.func(req, *args, **kwargs)

  File "/usr/lib/python3/dist-packages/oslo_middleware/base.py", line 124, in __call__
    response = req.get_response(self.application)

  File "/usr/lib/python3/dist-packages/webob/request.py", line 1313, in send
    status, headers, app_iter = self.call_application(

  File "/usr/lib/python3/dist-packages/webob/request.py", line 1278, in call_application
    app_iter = application(self.environ, start_response)

  File "/usr/lib/python3/dist-packages/webob/dec.py", line 129, in __call__
    resp = self.call_func(req, *args, **kw)

  File "/usr/lib/python3/dist-packages/webob/dec.py", line 193, in call_func
    return self.func(req, *args, **kwargs)

  File "/usr/lib/python3/dist-packages/oslo_middleware/base.py", line 124, in __call__
    response = req.get_response(self.application)

  File "/usr/lib/python3/dist-packages/webob/request.py", line 1313, in send
    status, headers, app_iter = self.call_application(

  File "/usr/lib/python3/dist-packages/webob/request.py", line 1278, in call_application
    app_iter = application(self.environ, start_response)

  File "/usr/lib/python3/dist-packages/webob/dec.py", line 129, in __call__
    resp = self.call_func(req, *args, **kw)

  File "/usr/lib/python3/dist-packages/webob/dec.py", line 193, in call_func
    return self.func(req, *args, **kwargs)

  File "/usr/lib/python3/dist-packages/oslo_middleware/request_id.py", line 58, in __call__
    response = req.get_response(self.application)

  File "/usr/lib/python3/dist-packages/webob/request.py", line 1313, in send
    status, headers, app_iter = self.call_application(

  File "/usr/lib/python3/dist-packages/webob/request.py", line 1278, in call_application
    app_iter = application(self.environ, start_response)

  File "/usr/lib/python3/dist-packages/webob/dec.py", line 129, in __call__
    resp = self.call_func(req, *args, **kw)

  File "/usr/lib/python3/dist-packages/webob/dec.py", line 193, in call_func
    return self.func(req, *args, **kwargs)

  File "/usr/lib/python3/dist-packages/oslo_middleware/catch_errors.py", line 40, in __call__
    response = req.get_response(self.application)

  File "/usr/lib/python3/dist-packages/webob/request.py", line 1313, in send
    status, headers, app_iter = self.call_application(

  File "/usr/lib/python3/dist-packages/webob/request.py", line 1278, in call_application
    app_iter = application(self.environ, start_response)

  File "/usr/lib/python3/dist-packages/webob/dec.py", line 129, in __call__
    resp = self.call_func(req, *args, **kw)

  File "/usr/lib/python3/dist-packages/webob/dec.py", line 193, in call_func
    return self.func(req, *args, **kwargs)

  File "/usr/lib/python3/dist-packages/keystonemiddleware/auth_token/__init__.py", line 341, in __call__
    response = req.get_response(self._app)

  File "/usr/lib/python3/dist-packages/webob/request.py", line 1313, in send
    status, headers, app_iter = self.call_application(

  File "/usr/lib/python3/dist-packages/webob/request.py", line 1278, in call_application
    app_iter = application(self.environ, start_response)

  File "/usr/lib/python3/dist-packages/webob/dec.py", line 143, in __call__
    return resp(environ, start_response)

  File "/usr/lib/python3/dist-packages/webob/dec.py", line 143, in __call__
    return resp(environ, start_response)

  File "/usr/lib/python3/dist-packages/routes/middleware.py", line 153, in __call__
    response = self.app(environ, start_response)

  File "/usr/lib/python3/dist-packages/webob/dec.py", line 143, in __call__
    return resp(environ, start_response)

  File "/usr/lib/python3/dist-packages/pecan/middleware/recursive.py", line 56, in __call__
    return self.application(environ, start_response)

  File "/usr/lib/python3/dist-packages/pecan/core.py", line 852, in __call__
    return super(Pecan, self).__call__(environ, start_response)

  File "/usr/lib/python3/dist-packages/pecan/core.py", line 745, in __call__
    self.handle_hooks(

  File "/usr/lib/python3/dist-packages/pecan/core.py", line 877, in handle_hooks
    return super(Pecan, self).handle_hooks(hooks, *args, **kw)

  File "/usr/lib/python3/dist-packages/pecan/core.py", line 342, in handle_hooks
    result = getattr(hook, hook_type)(*args)

  File "/usr/lib/python3/dist-packages/neutron_lib/db/api.py", line 138, in wrapped
    return f(*args, **kwargs)

  File "/usr/lib/python3/dist-packages/oslo_db/api.py", line 142, in wrapper
    return f(*args, **kwargs)

  File "/usr/lib/python3/dist-packages/neutron_lib/db/api.py", line 184, in wrapped
    return f(*dup_args, **dup_kwargs)

  File "/usr/lib/python3/dist-packages/neutron/pecan_wsgi/hooks/quota_enforcement.py", line 74, in after
    resource_registry.resync_resource(

  File "/usr/lib/python3/dist-packages/neutron/quota/resource_registry.py", line 83, in resync_resource
    res.resync(context, tenant_id)
  File "/usr/lib/python3/dist-packages/neutron/quota/resource.py", line 267, in resync
    project_id=project_id).count()

  File "/usr/lib/python3/dist-packages/sqlalchemy/orm/query.py", line 3145, in count
    return self._from_self(col).enable_eagerloads(False).scalar()

  File "/usr/lib/python3/dist-packages/sqlalchemy/orm/query.py", line 2879, in scalar
    ret = self.one()

  File "/usr/lib/python3/dist-packages/sqlalchemy/orm/query.py", line 2856, in one
    return self._iter().one()

  File "/usr/lib/python3/dist-packages/sqlalchemy/orm/query.py", line 2894, in _iter
    result = self.session.execute(

  File "/usr/lib/python3/dist-packages/sqlalchemy/orm/session.py", line 1673, in execute
    result = fn(orm_exec_state)

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

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

Changed in neutron:
status: New → In Progress
Changed in neutron:
assignee: nobody → Felipe Reyes (freyes)
Changed in neutron:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.opendev.org/c/openstack/neutron/+/863780
Committed: https://opendev.org/openstack/neutron/commit/234c5a376bef74bcd1af07d4be8adc69715f1af5
Submitter: "Zuul (22348)"
Branch: master

commit 234c5a376bef74bcd1af07d4be8adc69715f1af5
Author: Rodolfo Alonso Hernandez <email address hidden>
Date: Fri Dec 2 02:38:36 2022 +0100

    [sqlalchemy-20] Add missing DB context decorator

    This fixes two queries still being executed without the context
    decorator, which is causing warning messages.

    Closes-Bug: #1995738
    Change-Id: I61692e09119751ac7e19cecf6bf0b4b3a9fb38c7

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 22.0.0.0rc1

This issue was fixed in the openstack/neutron 22.0.0.0rc1 release candidate.

Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Ubuntu 22.10 (Kinetic Kudu) has reached end of life, so this bug will not be fixed for that specific release.

Changed in neutron (Ubuntu Kinetic):
status: New → Won't Fix
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.