VLAN Groups Not Populating #1427

Closed
opened 2025-12-29 16:32:08 +01:00 by adam · 13 comments
Owner

Originally created by @engageant on GitHub (Nov 29, 2017).

Issue type

[ ] Feature request
[ X] Bug report
[ ] Documentation

Environment

  • Python version: 3.5.2
  • NetBox version: 2.2.6

Description

I am having issues with VLAN groups:

  1. I cannot assign a prefix to a vlan that's in a vlan group, only to those not in a group. It lets me select the site, but the group and vlan listboxes are empty, despite the sites having groups assigned.
    To reproduce: Add a new prefix. Select a site. The VLAN group listbox does not populate (and understandably, neither does the VLAN listbox).
  2. When editing an existing prefix that's assigned to a vlan group, the group is shown correctly, but you cannot change it. Same as before - you can select a site but the group and vlan listboxes are empty.
    To reproduce: edit an existing prefix. Select a different site. The VLAN group listbox does not populate (and understandably, neither does the VLAN listbox).
  3. I cannot add a vlan to a vlan group. Same symptoms.
    To reproduce: edit a vlan. Select a site. The group listbox does not populate.

I tried creating a new site, group, and vlan, and have the same issue. As an aside, I can't figure out how to delete the test site I created.

Originally created by @engageant on GitHub (Nov 29, 2017). <!-- Before opening a new issue, please search through the existing issues to see if your topic has already been addressed. Note that you may need to remove the "is:open" filter from the search bar to include closed issues. Check the appropriate type for your issue below by placing an x between the brackets. For assistance with installation issues, or for any other issues other than those listed below, please raise your topic for discussion on our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please note that issues which do not fall under any of the below categories will be closed. Due to an excessive backlog of feature requests, we are not currently accepting any proposals which extend NetBox's feature scope. Do not prepend any sort of tag to your issue's title. An administrator will review your issue and assign labels as appropriate. ---> ### Issue type [ ] Feature request <!-- An enhancement of existing functionality --> [ X] Bug report <!-- Unexpected or erroneous behavior --> [ ] Documentation <!-- A modification to the documentation --> <!-- Please describe the environment in which you are running NetBox. (Be sure to verify that you are running the latest stable release of NetBox before submitting a bug report.) If you are submitting a bug report and have made any changes to the code base, please first validate that your bug can be recreated while running an official release. --> ### Environment * Python version: 3.5.2 * NetBox version: 2.2.6 <!-- BUG REPORTS must include: * A list of the steps needed for someone else to reproduce the bug * A description of the expected and observed behavior * Any relevant error messages (screenshots may also help) FEATURE REQUESTS must include: * A detailed description of the proposed functionality * A use case for the new feature * A rough description of any necessary changes to the database schema * Any relevant third-party libraries which would be needed --> ### Description I am having issues with VLAN groups: 1. I cannot assign a prefix to a vlan that's in a vlan group, only to those not in a group. It lets me select the site, but the group and vlan listboxes are empty, despite the sites having groups assigned. To reproduce: Add a new prefix. Select a site. The VLAN group listbox does not populate (and understandably, neither does the VLAN listbox). 2. When editing an existing prefix that's assigned to a vlan group, the group is shown correctly, but you cannot change it. Same as before - you can select a site but the group and vlan listboxes are empty. To reproduce: edit an existing prefix. Select a different site. The VLAN group listbox does not populate (and understandably, neither does the VLAN listbox). 3. I cannot add a vlan to a vlan group. Same symptoms. To reproduce: edit a vlan. Select a site. The group listbox does not populate. I tried creating a new site, group, and vlan, and have the same issue. As an aside, I can't figure out how to delete the test site I created.
adam closed this issue 2025-12-29 16:32:08 +01:00
Author
Owner

@jeremystretch commented on GitHub (Nov 29, 2017):

Please post the exact steps that can be taken to reproduce the issue you're seeing.

@jeremystretch commented on GitHub (Nov 29, 2017): Please post the exact steps that can be taken to reproduce the issue you're seeing.
Author
Owner

@engageant commented on GitHub (Nov 29, 2017):

@jeremystretch I updated the OP.

@engageant commented on GitHub (Nov 29, 2017): @jeremystretch I updated the OP.
Author
Owner

@jeremystretch commented on GitHub (Nov 29, 2017):

To reproduce: Add a new prefix. Select a site. The VLAN group listbox does not populate (and understandably, neither does the VLAN listbox).

Works for me. Do you have one or more VLAN groups assigned to the site? Is the API call being made by the browser when a site is selected? If so, what response is being returned?

@jeremystretch commented on GitHub (Nov 29, 2017): > To reproduce: Add a new prefix. Select a site. The VLAN group listbox does not populate (and understandably, neither does the VLAN listbox). Works for me. Do you have one or more VLAN groups assigned to the site? Is the API call being made by the browser when a site is selected? If so, what response is being returned?
Author
Owner

@engageant commented on GitHub (Nov 30, 2017):

@jeremystretch yes, the sites have valid groups. Something broke somewhere along the way, as there are older groups properly assigned to sites. This is essentially issue 2 in my OP - the existing group is shown, but you can't select a different one. How do I check if the API call is made, and what the response is?

@engageant commented on GitHub (Nov 30, 2017): @jeremystretch yes, the sites have valid groups. Something broke somewhere along the way, as there are older groups properly assigned to sites. This is essentially issue 2 in my OP - the existing group is shown, but you can't select a different one. How do I check if the API call is made, and what the response is?
Author
Owner

@jeremystretch commented on GitHub (Dec 1, 2017):

@engageant In Firefox or Chrome, you can press F12 to bring up the developer console. Select the network tab, then select a site from the list. You should see the HTTP request recorded under the tab, as well as its response.

@jeremystretch commented on GitHub (Dec 1, 2017): @engageant In Firefox or Chrome, you can press F12 to bring up the developer console. Select the network tab, then select a site from the list. You should see the HTTP request recorded under the tab, as well as its response.
Author
Owner

@engageant commented on GitHub (Dec 1, 2017):

@jeremystretch here's what comes back in the response for the edit page the first time:

  <select name="site" placeholder="None" filter-for="group" nullable="true" id="id_site" class="form-control">
  <option value="">---------</option>
  <option value="7">Site7</option>
  <option value="4">Site4</option>
  <option value="3" selected>Site3</option>
  <option value="5">Site5</option>
  <option value="2">Site2</option>
  <option value="11">Site11</option>
  <option value="9">Site9</option>
  <option value="1">Site1</option>
  <option value="8">Site8</option>
  <option value="6">Site6</option>
</select>         
<select name="group" placeholder="Group" class="api-select form-control" api-url="/api/ipam/vlan-groups/?site_id={{site}}" id="id_group">
  <option value="">---------</option>
  <option value="2" selected>Site3 VLANs</option>
</select>

When I then change the site selection, this appears in the Console:

Uncaught TypeError: Cannot read property 'id' of null
    at forms.js?v2.2.6:127
    at Function.each (jquery-3.2.1.min.js:2)
    at Object.success (forms.js?v2.2.6:126)
    at i (jquery-3.2.1.min.js:2)
    at Object.fireWith [as resolveWith] (jquery-3.2.1.min.js:2)
    at A (jquery-3.2.1.min.js:4)
    at XMLHttpRequest.<anonymous> (jquery-3.2.1.min.js:4) 
@engageant commented on GitHub (Dec 1, 2017): @jeremystretch here's what comes back in the response for the edit page the first time: ``` <select name="site" placeholder="None" filter-for="group" nullable="true" id="id_site" class="form-control"> <option value="">---------</option> <option value="7">Site7</option> <option value="4">Site4</option> <option value="3" selected>Site3</option> <option value="5">Site5</option> <option value="2">Site2</option> <option value="11">Site11</option> <option value="9">Site9</option> <option value="1">Site1</option> <option value="8">Site8</option> <option value="6">Site6</option> </select> <select name="group" placeholder="Group" class="api-select form-control" api-url="/api/ipam/vlan-groups/?site_id={{site}}" id="id_group"> <option value="">---------</option> <option value="2" selected>Site3 VLANs</option> </select> ``` When I then change the site selection, this appears in the Console: ``` Uncaught TypeError: Cannot read property 'id' of null at forms.js?v2.2.6:127 at Function.each (jquery-3.2.1.min.js:2) at Object.success (forms.js?v2.2.6:126) at i (jquery-3.2.1.min.js:2) at Object.fireWith [as resolveWith] (jquery-3.2.1.min.js:2) at A (jquery-3.2.1.min.js:4) at XMLHttpRequest.<anonymous> (jquery-3.2.1.min.js:4) ```
Author
Owner

@jeremystretch commented on GitHub (Dec 5, 2017):

Ok, but what is the request being made to the API and what is the response being received? Look under the "network" tab?

@jeremystretch commented on GitHub (Dec 5, 2017): Ok, but what is the request being made to the API and what is the response being received? Look under the "network" tab?
Author
Owner

@engageant commented on GitHub (Dec 5, 2017):

https://user-images.githubusercontent.com/3442922/33767388-59b36952-dbef-11e7-9ab0-983b008c8f10.PNG
Maybe this helps? This is when I choose a different site when editing a
VLAN.

And here's the response:

{"count":1,"next":null,"previous":null,"results":[{"id":2,"name":"my site
VLANs","slug":"my-site-vlans","site":{"id":3,"url":"
http://sc-netbox-01/api/dcim/sites/3/","name":"my site","slug":"my-site"}}]}

On Tue, Dec 5, 2017 at 2:21 PM Jeremy Stretch notifications@github.com
wrote:

Ok, but what is the request being made to the API and what is the response
being received? Look under the "network" tab?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/digitalocean/netbox/issues/1742#issuecomment-349411962,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADSI6vca9aiAyGue6ksHjKd_qQFWVv7Oks5s9ZeogaJpZM4QvS96
.

@engageant commented on GitHub (Dec 5, 2017): https://user-images.githubusercontent.com/3442922/33767388-59b36952-dbef-11e7-9ab0-983b008c8f10.PNG Maybe this helps? This is when I choose a different site when editing a VLAN. And here's the response: {"count":1,"next":null,"previous":null,"results":[{"id":2,"name":"my site VLANs","slug":"my-site-vlans","site":{"id":3,"url":" http://sc-netbox-01/api/dcim/sites/3/","name":"my site","slug":"my-site"}}]} On Tue, Dec 5, 2017 at 2:21 PM Jeremy Stretch <notifications@github.com> wrote: > Ok, but what is the request being made to the API and what is the response > being received? Look under the "network" tab? > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/digitalocean/netbox/issues/1742#issuecomment-349411962>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/ADSI6vca9aiAyGue6ksHjKd_qQFWVv7Oks5s9ZeogaJpZM4QvS96> > . >
Author
Owner

@jeremystretch commented on GitHub (Dec 8, 2017):

Maybe you're running outdated Javascript. Did you run manage.py collectstatic as part of the last upgrade?

@jeremystretch commented on GitHub (Dec 8, 2017): Maybe you're running outdated Javascript. Did you run `manage.py collectstatic` as part of the last upgrade?
Author
Owner

@engageant commented on GitHub (Dec 8, 2017):

I have two Netbox instances that are both on the same version and one works
while the other doesn't. I'm beginning to think that something is up with
the DB in the non-working one. I don't recall ever running that command;
when I upgrade I follow the process for cloning the repo at
https://netbox.readthedocs.io/en/latest/installation/upgrading/

On Fri, Dec 8, 2017 at 11:44 AM Jeremy Stretch notifications@github.com
wrote:

Maybe you're running outdated Javascript. Did you run manage.py
collectstatic as part of the last upgrade?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/digitalocean/netbox/issues/1742#issuecomment-350310824,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADSI6lu5M3wJ64N_Ca7o_au0sXiPnAGlks5s-WdigaJpZM4QvS96
.

@engageant commented on GitHub (Dec 8, 2017): I have two Netbox instances that are both on the same version and one works while the other doesn't. I'm beginning to think that something is up with the DB in the non-working one. I don't recall ever running that command; when I upgrade I follow the process for cloning the repo at https://netbox.readthedocs.io/en/latest/installation/upgrading/ On Fri, Dec 8, 2017 at 11:44 AM Jeremy Stretch <notifications@github.com> wrote: > Maybe you're running outdated Javascript. Did you run manage.py > collectstatic as part of the last upgrade? > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/digitalocean/netbox/issues/1742#issuecomment-350310824>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/ADSI6lu5M3wJ64N_Ca7o_au0sXiPnAGlks5s-WdigaJpZM4QvS96> > . >
Author
Owner

@jeremystretch commented on GitHub (Dec 8, 2017):

manage.py collectstatic is performed by the upgrade.sh script, so you shouldn't need to do it manually if you've been running the script. Maybe try it on the server with issues though and see if it helps.

@jeremystretch commented on GitHub (Dec 8, 2017): `manage.py collectstatic` is performed by the `upgrade.sh` script, so you shouldn't need to do it manually if you've been running the script. Maybe try it on the server with issues though and see if it helps.
Author
Owner

@engageant commented on GitHub (Dec 11, 2017):

0 static files copied to '/opt/netbox/netbox/static', 264 unmodified.

I then restarted netbox and tested again; same issue.

On Fri, Dec 8, 2017 at 2:31 PM Jeremy Stretch notifications@github.com
wrote:

manage.py collectstatic is performed by the upgrade.sh script, so you
shouldn't need to do it manually if you've been running the script. Maybe
try it on the server with issues though and see if it helps.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/digitalocean/netbox/issues/1742#issuecomment-350351485,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADSI6lsyJiI3VO0FCUbkDHuflS6H6KOaks5s-Y6fgaJpZM4QvS96
.

@engageant commented on GitHub (Dec 11, 2017): 0 static files copied to '/opt/netbox/netbox/static', 264 unmodified. I then restarted netbox and tested again; same issue. On Fri, Dec 8, 2017 at 2:31 PM Jeremy Stretch <notifications@github.com> wrote: > manage.py collectstatic is performed by the upgrade.sh script, so you > shouldn't need to do it manually if you've been running the script. Maybe > try it on the server with issues though and see if it helps. > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/digitalocean/netbox/issues/1742#issuecomment-350351485>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/ADSI6lsyJiI3VO0FCUbkDHuflS6H6KOaks5s-Y6fgaJpZM4QvS96> > . >
Author
Owner

@jeremystretch commented on GitHub (Dec 13, 2017):

@engageant Sorry, don't know what else to look at. Maybe post on the mailing list and see if anyone has any ideas?

Going to close this out now since we can't positively identify this behavior as a reproducible bug.

@jeremystretch commented on GitHub (Dec 13, 2017): @engageant Sorry, don't know what else to look at. Maybe post on the mailing list and see if anyone has any ideas? Going to close this out now since we can't positively identify this behavior as a reproducible bug.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1427