Neutron VPNAAS don't update site connections on python3

Bug #1794718 reported by Viktor Křivák
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Unassigned

Bug Description

Tested with StrongSwan but I hope this can cause issues on others drivers too.

On python3 when new connection is created it's stuck in PENDING_CREATE state. Everything is working but connection state is never updated. Main reason is that agent send wrong id to server. On python3 message look like this:

[{'updated_pending_status': False, 'ipsec_site_connections': {'a': {'updated_pending_status': False, 'status': 'ACTIVE'}}, 'status': 'ACTIVE', 'id': 'a621a382-308d-4cd0-be0a-01c757064a13'}, {'updated_pending_status': False, 'ipsec_site_connections': {'a': {'updated_pending_status': False, 'status': 'ACTIVE'}}, 'status': 'ACTIVE', 'id': 'd004c466-cc36-4b6b-8aa3-84d7e45569ad'}]

on python2

[{'status': 'ACTIVE', 'ipsec_site_connections': {u'7e14400a-60df-48d8-91aa-ec97749555fc': {'status': 'ACTIVE', 'updated_pending_status': False}}, 'updated_pending_status': False, 'id': u'c903732e-67da-4363-baf1-0cdcb7476ee7'}, {'status': 'ACTIVE', 'ipsec_site_connections': {u'70671513-e0cf-4bdf-845e-cb6ef084baea': {'status': 'ACTIVE', 'updated_pending_status': True}}, 'updated_pending_status': True, 'id': u'995ed22c-00c3-4496-b590-b84787ba6caa'}]

Notice uid in ipsec_site_connections. Problem is that this uid is parsed from subprocess and on python3 this subprocess return bytes instead of string. Because of this whole output parsing i kind of screw up.

We was able to fix this issue via patching netns_wrapper:

diff --git a/neutron_vpnaas/services/vpn/common/netns_wrapper.py b/neutron_vpnaas/services/vpn/common/netns_wrapper.py
index 77378dcc7..35614a717 100644
--- a/neutron_vpnaas/services/vpn/common/netns_wrapper.py
+++ b/neutron_vpnaas/services/vpn/common/netns_wrapper.py
@@ -23,6 +23,7 @@ from neutron.common import utils
 from oslo_config import cfg
 from oslo_log import log as logging
 from oslo_rootwrap import wrapper
+from neutron_lib.utils import helpers
 import six

 from neutron_vpnaas._i18n import _
@@ -67,6 +68,8 @@ def execute(cmd):
                                  env=env)

     _stdout, _stderr = obj.communicate()
+ _stdout = helpers.safe_decode_utf8(_stdout)
+ _stderr = helpers.safe_decode_utf8(_stderr)
     msg = ('Command: %(cmd)s Exit code: %(returncode)s '
            'Stdout: %(stdout)s Stderr: %(stderr)s' %
            {'cmd': cmd,

Changed in neutron:
assignee: nobody → Viktor Křivák (viktor-krivak)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-vpnaas (master)

Fix proposed to branch: master
Review: https://review.openstack.org/605783

Changed in neutron:
status: New → In Progress
Changed in neutron:
importance: Undecided → High
tags: added: vpnaas
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron-vpnaas (master)

Reviewed: https://review.openstack.org/605783
Committed: https://git.openstack.org/cgit/openstack/neutron-vpnaas/commit/?id=3075f3c29854da23fdb436ebfb7099d2991d2be4
Submitter: Zuul
Branch: master

commit 3075f3c29854da23fdb436ebfb7099d2991d2be4
Author: Viktor Krivak <email address hidden>
Date: Thu Sep 27 17:26:33 2018 +0200

    Call helper to convert bytes to str for Python3 in netns-wrapper

    Closes-Bug: #1794718

    Change-Id: I29ae5102ac9c29a5f6e63bae9a08004af620e27f

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

This issue was fixed in the openstack/neutron-vpnaas 15.0.0.0b1 development milestone.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron-vpnaas (stable/stein)

Fix proposed to branch: stable/stein
Review: https://review.opendev.org/c/openstack/neutron-vpnaas/+/798331

Revision history for this message
Slawek Kaplonski (slaweq) wrote : auto-abandon-script

This bug has had a related patch abandoned and has been automatically un-assigned due to inactivity. Please re-assign yourself if you are continuing work or adjust the state as appropriate if it is no longer valid.

Changed in neutron:
assignee: Viktor Křivák (viktor-krivak) → nobody
tags: added: timeout-abandon
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron-vpnaas (stable/stein)

Change abandoned by "Slawek Kaplonski <email address hidden>" on branch: stable/stein
Review: https://review.opendev.org/c/openstack/neutron-vpnaas/+/798331
Reason: This review is > 4 weeks without comment, and failed Zuul jobs the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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