Skip to content

Can't create VLAN resources through API with a reference to site,vlan-group #4514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kr3ator opened this issue Apr 21, 2020 · 1 comment
Closed

Comments

@kr3ator
Copy link

kr3ator commented Apr 21, 2020

Environment

  • Python version: sameas in netbox-docker
  • NetBox version: 2.8.0
  • This is a clean, testing installation of netbox-docker

Steps to Reproduce

  1. Disable any installed plugins by commenting out the PLUGINS setting in
    configuration.py.
  2. Open Netbox Swagger API interface
  3. Create new VLAN-group with site defined through the API using:
curl -X POST "http://192.168.163.130:8000/api/ipam/vlan-groups/" -H "accept: application/json" -H "Content-Type: application/json" -H "X-CSRFToken: FpmEtE3MuOSNQME9PJIbXwv7pdYm1AlcUrwR9DBHnwAtkb63cm1lg0aaH6ckpsQX" -d "{ \"name\": \"DEV-GLOBAL\", \"slug\": \"dev\", \"site\": 8}"

Site 'Development' has been predefined:

{
   "id": 8,
   "name": "Development",
   "slug": "dev",
   "status": {
     "value": "active",
     "label": "Active",
     "id": 1
    },
  ......
}

No VLAN-groups had been defined.

Expected Behavior

VLAN group configured with specified parameters. Code 201 returned with return data as in the API definition.

Observed Behavior

API throws code 500 'Error: Internal Server Error'
In the response body I can see:

<pre><strong>&lt;class &#x27;AttributeError&#x27;&gt;</strong><br />
&#x27;UniqueTogetherValidator&#x27; object has no attribute &#x27;set_context&#x27;</pre>

Additional information

When reference to site ID (8) is ommited the VLAN group is created correctly.
After that, when trying to do a PATCH call to add the site to the just created vlan-group, the same error is thrown.

The same thing happens when I'm trying to create a VLAN (with site and/or group).
However, there seems to be no issues in the DCIM module as I was able to create a LAG (ref. to device id), then PATCH interface to add it to the LAG (ref. to LAG id) and finally create an IP and assign it to the interface.

Same behaviour is observed using different tools for making API requests.

@DouglasHeriot
Copy link

I ran into this as well. It's a duplicate issue of #4496 which has now been fixed in develop branch.

@kr3ator kr3ator closed this as completed Apr 21, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants