Can't establish BGP session with password authentication

Bug #1898886 reported by Mauricio Prates
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Neutron Dynamic Routing charm
New
Undecided
Unassigned
neutron
Invalid
Undecided
Unassigned
python-os-ken (Ubuntu)
New
Undecided
Unassigned

Bug Description

Creating a neutron BGP peer with password authentication leads to an error reported on neutron-bgp-dragent.log.

2020-10-06 18:58:51.861 125213 DEBUG bgpspeaker.peer [-] Started peer Peer(ip: 100.94.2.2, asn: 65200) _run /usr/lib/python3/dist-packages/os_ken/services/protocols/bgp/peer.py:676
2020-10-06 18:58:51.861 125213 DEBUG bgpspeaker.peer [-] start connect loop. (mode: active) _on_update_connect_mode /usr/lib/python3/dist-packages/os_ken/services/protocols/bgp/peer.py:582
2020-10-06 18:58:52.862 125213 DEBUG bgpspeaker.peer [-] Peer 100.94.2.2 BGP FSM went from Idle to Connect bgp_state /usr/lib/python3/dist-packages/os_ken/services/protocols/bgp/peer.py:236
2020-10-06 18:58:52.863 125213 DEBUG bgpspeaker.peer [-] Peer(ip: 100.94.2.2, asn: 65200) trying to connect to ('100.94.2.2', 179) _connect_loop /usr/lib/python3/dist-packages/os_ken/services/protocols/bgp/peer.py:1292
2020-10-06 18:58:52.863 125213 DEBUG bgpspeaker.base [-] Connect TCP called for 100.94.2.2:179 _connect_tcp /usr/lib/python3/dist-packages/os_ken/services/protocols/bgp/base.py:412
2020-10-06 18:58:52.864 125213 ERROR os_ken.lib.hub [-] hub: uncaught exception: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/os_ken/lib/hub.py", line 69, in _launch
    return func(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/os_ken/services/protocols/bgp/peer.py", line 1296, in _connect_loop
    self._connect_tcp(peer_address, File "/usr/lib/python3/dist-packages/os_ken/services/protocols/bgp/base.py", line 422, in _connect_tcp
    sockopt.set_tcp_md5sig(sock, peer_addr[0], password) File "/usr/lib/python3/dist-packages/os_ken/lib/sockopt.py", line 71, in set_tcp_md5sig
    impl(s, addr, key) File "/usr/lib/python3/dist-packages/os_ken/lib/sockopt.py", line 38, in _set_tcp_md5sig_linux
    sa = sockaddr.sa_in4(addr) File "/usr/lib/python3/dist-packages/os_ken/lib/sockaddr.py", line 63, in sa_in4
    return _pad_to(hdr + data, _SIN_SIZE) File "/usr/lib/python3/dist-packages/os_ken/lib/sockaddr.py", line 57, in _pad_to
    return data + pad_len * '\0'
TypeError: can't concat str to bytes

The log is reported after peer is created and associated to speaker.
Ex.:

#openstack bgp speaker create --ip-version 4 --local-as 65211 --no-advertise-floating-ip-host-routes bgpspeaker
#openstack bgp speaker add network bgpspeaker provider-network
#openstack bgp peer create --peer-ip 100.94.2.2 --remote-as 65200 --auth-type md5 --password cisco bgppeer
#openstack bgp speaker add peer bgpspeaker bgppeer
#openstack bgp dragent add speaker 27f6b5bc-4b0d-466c-957e-34059bd2cc2b bgpspeaker

If you create a BGP peer without password, everything works just fine.

Opesntack version: Ussuri
Deployed using Juju
Distro: Ubuntu Focal Fossa
The environment is a full deployment with all core services running in multi-node.

This looks a lot with the already reported and fixed bug #1592982.

Revision history for this message
Dr. Jens Harbott (j-harbott) wrote :

This is an issue with the os-ken library, see https://storyboard.openstack.org/#!/story/2007910 . The issue is fixed with the latest release of the library, make sure to upgrade.

Changed in neutron:
status: New → Invalid
Revision history for this message
Felipe Alencastro (falencastro) wrote :

Refiled this here, as Focal currently doesn't provide python3-os-ken >= 1.2 which includes the fix mentioned by @j-harbott

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.