openwisp / openwisp/openwisp-controller
[bug]: VPN peers not removed when VPN template is detached from device
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 773
- Forks
- 315
- Avg merge
- 2d 16h
- Merged PRs (30d)
- 14
Description
Describe the bug
When a VPN template is removed from a device configuration, the device is not removed from the VPN server’s peer list (e.g. WireGuard/OpenVPN).
Although the related VpnClient record is deleted from the database, the VPN server configuration is not updated, leaving the peer active.
Steps To Reproduce
- Create or edit a device and attach a VPN template.
- Save the device and verify that the device appears in the VPN server peer list (via the VPN server preview).
- Edit the same device and remove the VPN template.
- Save the device.
Expected behavior
Removing a VPN template from a device should immediately revoke the device’s VPN access and remove its peer entry from the VPN server configuration.
Actual behavior
The peer remains present on the VPN server until the peer cache expires or the server is restarted, even though the VpnClient database record has been removed.
Screenshots
Not applicable.
System Information:
- OS: Ubuntu (WSL)
- Python Version: 3.x
- Django Version: 4.x
- OpenWISP Controller: current master
- VPN Backend: WireGuard
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the VpnClient deletion path triggered when a VPN template is detached from a device, then inspect how the VPN server preview obtains its peer list. Reproduce the save flow with a WireGuard-backed device and verify that removing the template also removes the peer from the generated server configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- backend, networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100