API call to add VPN tunnel fails: group field is required #9238

Closed
opened 2025-12-29 20:47:23 +01:00 by adam · 0 comments
Owner

Originally created by @markkuleinio on GitHub (Feb 13, 2024).

Originally assigned to: @jeremystretch on GitHub.

Deployment Type

Self-hosted

NetBox Version

v3.7.2

Python Version

3.11

Steps to Reproduce

$ curl -s -i http://netbox-test.lein.io/api/vpn/tunnels/ \
-H "Authorization: Token 176d4c04ccc8f2a549ea6fd393567d9da5a796ff" \
-H "Content-type: application/json" \
-H "Accept: application/json; indent=4" \
-d '{"name":"TestTunnel", "encapsulation":"ipsec-tunnel", "status":"active"}'

Expected Behavior

Tunnel "TestTunnel" is added successfully.

Observed Behavior

HTTP/1.1 400 Bad Request
API-Version: 3.7
...
{
    "group": [
        "This field is required."
    ]
}

Adding the same tunnel in GUI is successful (using only those three mandatory fields).

Workaround

Create a tunnel group like "TEMP", then add "group":1 (where 1 is the group ID) in the create call, and finally edit the resulted tunnel to remove the TEMP group.

Originally created by @markkuleinio on GitHub (Feb 13, 2024). Originally assigned to: @jeremystretch on GitHub. ### Deployment Type Self-hosted ### NetBox Version v3.7.2 ### Python Version 3.11 ### Steps to Reproduce ``` $ curl -s -i http://netbox-test.lein.io/api/vpn/tunnels/ \ -H "Authorization: Token 176d4c04ccc8f2a549ea6fd393567d9da5a796ff" \ -H "Content-type: application/json" \ -H "Accept: application/json; indent=4" \ -d '{"name":"TestTunnel", "encapsulation":"ipsec-tunnel", "status":"active"}' ``` ### Expected Behavior Tunnel "TestTunnel" is added successfully. ### Observed Behavior ``` HTTP/1.1 400 Bad Request API-Version: 3.7 ... { "group": [ "This field is required." ] } ``` Adding the same tunnel in GUI is successful (using only those three mandatory fields). ### Workaround Create a tunnel group like "TEMP", then add `"group":1` (where 1 is the group ID) in the create call, and finally edit the resulted tunnel to remove the TEMP group.
adam added the type: bugstatus: acceptedseverity: medium labels 2025-12-29 20:47:23 +01:00
adam closed this issue 2025-12-29 20:47:23 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9238