Skip to content

KeyError when creating a tagged interface with a VLAN assigned #4084

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
jeremystretch opened this issue Feb 4, 2020 · 0 comments
Closed
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@jeremystretch
Copy link
Member

Environment

  • Python version: 3.6.9
  • NetBox version: 2.7.3

Steps to Reproduce

  1. Navigate to a device and add a new interface
  2. Set the mode to "Tagged" and select one or more VLANs
  3. Submit the interface creation form

Expected Behavior

The interface should be created with the selected VLAN(s) assigned.

Observed Behavior

A KeyError exception is raised. The full traceback is below.

Traceback:

File "/home/jstretch/.virtualenvs/netbox/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/home/jstretch/.virtualenvs/netbox/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  115.                 response = self.process_exception_by_middleware(e, request)

File "/home/jstretch/.virtualenvs/netbox/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
  113.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/home/jstretch/.virtualenvs/netbox/lib/python3.6/site-packages/django/views/generic/base.py" in view
  71.             return self.dispatch(request, *args, **kwargs)

File "/home/jstretch/.virtualenvs/netbox/lib/python3.6/site-packages/django/contrib/auth/mixins.py" in dispatch
  85.         return super().dispatch(request, *args, **kwargs)

File "/home/jstretch/.virtualenvs/netbox/lib/python3.6/site-packages/django/views/generic/base.py" in dispatch
  97.         return handler(request, *args, **kwargs)

File "/home/jstretch/netbox/netbox/utilities/views.py" in post
  863.         if form.is_valid():

File "/home/jstretch/.virtualenvs/netbox/lib/python3.6/site-packages/django/forms/forms.py" in is_valid
  185.         return self.is_bound and not self.errors

File "/home/jstretch/.virtualenvs/netbox/lib/python3.6/site-packages/django/forms/forms.py" in errors
  180.             self.full_clean()

File "/home/jstretch/.virtualenvs/netbox/lib/python3.6/site-packages/django/forms/forms.py" in full_clean
  382.         self._clean_form()

File "/home/jstretch/.virtualenvs/netbox/lib/python3.6/site-packages/django/forms/forms.py" in _clean_form
  409.             cleaned_data = self.clean()

File "/home/jstretch/netbox/netbox/dcim/forms.py" in clean
  113.             valid_sites = [None, self.cleaned_data['device'].site]

Exception Type: KeyError at /dcim/devices/2649/interfaces/add/
Exception Value: 'device'
@jeremystretch jeremystretch added type: bug A confirmed report of unexpected behavior in the application status: accepted This issue has been accepted for implementation labels Feb 4, 2020
@jeremystretch jeremystretch self-assigned this Feb 4, 2020
@jeremystretch jeremystretch pinned this issue Feb 4, 2020
@jeremystretch jeremystretch unpinned this issue Feb 5, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

1 participant