eclipse-opendut / opendut

Test Electronic Control Units around the world in a transparent network.
https://opendut.eclipse.dev
Apache License 2.0
24 stars 13 forks source link

Unable to delete Peers from Netbird #267

Open mtwardawski opened 2 months ago

mtwardawski commented 2 months ago

If we try to delete peers from LEA (not sure, if this also happens in CLEO when trying to delete peers, but most likely) we encounter an error in CARLs logs which has its origin in Netbird.

The deletion of a group in Netbird was not successful:

Received status code '400 Bad Request' when deleting NetBird group with ID <GroupId("cq8k7e70vv0s73abfjb0")>:
  {"message":"group has been linked to setup key: opendut-peer-32b3fbc4-aa5c-49dc-900d-935cd50af57e","code":400}

Complete error log:

2024-07-12T14:58:48.628914Z TRACE delete_peer_descriptor:delete_peer_descriptor:delete_peer:delete_netbird_group: opendut_vpn_netbird::client::request_handler: Sending request DELETE https://netbird-api.opendut.local/api/groups/cq8k7e70vv0s73abfjb0 peer_id=PeerId(32b3fbc4-aa5c-49dc-900d-935cd50af57e) group_id=GroupId("cq8k7e70vv0s73abfjb0")
2024-07-12T14:58:48.631838Z TRACE delete_peer_descriptor:delete_peer_descriptor:delete_peer:delete_netbird_group: opendut_vpn_netbird::client::request_handler: Got response 400 Bad Request peer_id=PeerId(32b3fbc4-aa5c-49dc-900d-935cd50af57e) group_id=GroupId("cq8k7e70vv0s73abfjb0")
2024-07-12T14:58:48.631866Z TRACE delete_peer_descriptor:delete_peer_descriptor:delete_peer:delete_netbird_group: opendut_vpn_netbird::client::request_handler: Network request completed. peer_id=PeerId(32b3fbc4-aa5c-49dc-900d-935cd50af57e) group_id=GroupId("cq8k7e70vv0s73abfjb0")
2024-07-12T14:58:48.632020Z ERROR delete_peer_descriptor:delete_peer_descriptor:delete_peer:delete_netbird_group: opendut_vpn_netbird::client: Received status code '400 Bad Request' when deleting NetBird group with ID <GroupId("cq8k7e70vv0s73abfjb0")>:
  {"message":"group has been linked to setup key: opendut-peer-32b3fbc4-aa5c-49dc-900d-935cd50af57e","code":400}
 peer_id=PeerId(32b3fbc4-aa5c-49dc-900d-935cd50af57e) group_id=GroupId("cq8k7e70vv0s73abfjb0")
2024-07-12T14:58:48.632058Z ERROR delete_peer_descriptor:delete_peer_descriptor: opendut_carl::actions::peers: Peer 'matthias' <32b3fbc4-aa5c-49dc-900d-935cd50af57e> deleted with internal errors:
  An error occurred while deleting peer <32b3fbc4-aa5c-49dc-900d-935cd50af57e>:
  Received status code '400 Bad Request' indicating an error: {"message":"group has been linked to setup key: opendut-peer-32b3fbc4-aa5c-49dc-900d-935cd50af57e","code":400}

At the moment of writting the ticket, we have no particular solution. First steps could be to analyze the issue and try to make the deletion of peers in Netbird work.

AC:

mirenz1 commented 2 months ago

using Netbird groups was a workaround for missing persistence handling the peer IDs. Revoking the setup string should allow deletion of group. --> maybe we can keep the groups for now and just revoke the setup string (group becomes unusable).