← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2100909] [NEW] Neutron VPN agent fail with upgrade a READER transaction to a WRITER mid-transaction

 

Public bug reported:

We appears open DB read transaction in get_vpn_services_on_host from base_ipsec.py
but later try to change to write transaction in ovn ipsec implementation (which calls create_router_to_agent_binding from vpn_agentschedulers_db.py)


2025-03-05 00:21:25.398 100 ERROR oslo_service.service [-] Error starting thread.: TypeError: Can't upgrade a READER transaction to a WRITER mid-transaction
Traceback (most recent call last):

  File "/var/lib/openstack/lib/python3.10/site-packages/oslo_messaging/rpc/server.py", line 165, in _process_incoming
    res = self.dispatcher.dispatch(message)

  File "/var/lib/openstack/lib/python3.10/site-packages/oslo_messaging/rpc/dispatcher.py", line 309, in dispatch
    return self._do_dispatch(endpoint, method, ctxt, args)

  File "/var/lib/openstack/lib/python3.10/site-packages/oslo_messaging/rpc/dispatcher.py", line 229, in _do_dispatch
    result = func(ctxt, **new_args)

  File "/var/lib/openstack/lib/python3.10/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 998, in wrapper
    return fn(*args, **kwargs)

  File "/var/lib/openstack/lib/python3.10/site-packages/neutron_vpnaas/services/vpn/service_drivers/base_ipsec.py", line 77, in get_vpn_services_on_host
    vpnservices = self._get_agent_hosting_vpn_services(

  File "/var/lib/openstack/lib/python3.10/site-packages/neutron_vpnaas/services/vpn/service_drivers/ovn_ipsec.py", line 104, in _get_agent_hosting_vpn_services
    self.service_plugin.auto_schedule_routers(context, agent)

  File "/var/lib/openstack/lib/python3.10/site-packages/neutron_vpnaas/db/vpn/vpn_agentschedulers_db.py", line 371, in auto_schedule_routers
    return self.vpn_scheduler.auto_schedule_routers(

  File "/var/lib/openstack/lib/python3.10/site-packages/neutron_vpnaas/scheduler/vpn_agent_scheduler.py", line 83, in auto_schedule_routers
    self._bind_routers(context, plugin, target_routers, vpn_agent)

  File "/var/lib/openstack/lib/python3.10/site-packages/neutron_vpnaas/scheduler/vpn_agent_scheduler.py", line 95, in _bind_routers
    plugin.create_router_to_agent_binding(

  File "/var/lib/openstack/lib/python3.10/site-packages/neutron_vpnaas/db/vpn/vpn_agentschedulers_db.py", line 186, in create_router_to_agent_binding
    with db_api.CONTEXT_WRITER.using(context):

  File "/usr/lib/python3.10/contextlib.py", line 135, in __enter__
    return next(self.gen)

  File "/var/lib/openstack/lib/python3.10/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 1042, in _transaction_scope
    with current._produce_block(

  File "/var/lib/openstack/lib/python3.10/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 693, in _produce_block
    self._writer()

  File "/var/lib/openstack/lib/python3.10/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 707, in _writer
    raise TypeError(

** Affects: neutron
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/2100909

Title:
  Neutron VPN agent fail with upgrade a READER transaction to a WRITER
  mid-transaction

Status in neutron:
  New

Bug description:
  We appears open DB read transaction in get_vpn_services_on_host from base_ipsec.py
  but later try to change to write transaction in ovn ipsec implementation (which calls create_router_to_agent_binding from vpn_agentschedulers_db.py)


  2025-03-05 00:21:25.398 100 ERROR oslo_service.service [-] Error starting thread.: TypeError: Can't upgrade a READER transaction to a WRITER mid-transaction
  Traceback (most recent call last):

    File "/var/lib/openstack/lib/python3.10/site-packages/oslo_messaging/rpc/server.py", line 165, in _process_incoming
      res = self.dispatcher.dispatch(message)

    File "/var/lib/openstack/lib/python3.10/site-packages/oslo_messaging/rpc/dispatcher.py", line 309, in dispatch
      return self._do_dispatch(endpoint, method, ctxt, args)

    File "/var/lib/openstack/lib/python3.10/site-packages/oslo_messaging/rpc/dispatcher.py", line 229, in _do_dispatch
      result = func(ctxt, **new_args)

    File "/var/lib/openstack/lib/python3.10/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 998, in wrapper
      return fn(*args, **kwargs)

    File "/var/lib/openstack/lib/python3.10/site-packages/neutron_vpnaas/services/vpn/service_drivers/base_ipsec.py", line 77, in get_vpn_services_on_host
      vpnservices = self._get_agent_hosting_vpn_services(

    File "/var/lib/openstack/lib/python3.10/site-packages/neutron_vpnaas/services/vpn/service_drivers/ovn_ipsec.py", line 104, in _get_agent_hosting_vpn_services
      self.service_plugin.auto_schedule_routers(context, agent)

    File "/var/lib/openstack/lib/python3.10/site-packages/neutron_vpnaas/db/vpn/vpn_agentschedulers_db.py", line 371, in auto_schedule_routers
      return self.vpn_scheduler.auto_schedule_routers(

    File "/var/lib/openstack/lib/python3.10/site-packages/neutron_vpnaas/scheduler/vpn_agent_scheduler.py", line 83, in auto_schedule_routers
      self._bind_routers(context, plugin, target_routers, vpn_agent)

    File "/var/lib/openstack/lib/python3.10/site-packages/neutron_vpnaas/scheduler/vpn_agent_scheduler.py", line 95, in _bind_routers
      plugin.create_router_to_agent_binding(

    File "/var/lib/openstack/lib/python3.10/site-packages/neutron_vpnaas/db/vpn/vpn_agentschedulers_db.py", line 186, in create_router_to_agent_binding
      with db_api.CONTEXT_WRITER.using(context):

    File "/usr/lib/python3.10/contextlib.py", line 135, in __enter__
      return next(self.gen)

    File "/var/lib/openstack/lib/python3.10/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 1042, in _transaction_scope
      with current._produce_block(

    File "/var/lib/openstack/lib/python3.10/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 693, in _produce_block
      self._writer()

    File "/var/lib/openstack/lib/python3.10/site-packages/oslo_db/sqlalchemy/enginefacade.py", line 707, in _writer
      raise TypeError(

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