Getting an error when clicking on create virtual chassis without device selected #1512

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

Originally created by @dgarros on GitHub (Jan 26, 2018).

Issue type

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

Environment

  • Python version: 3.6
  • NetBox version: 2.3-beta1

Description

I'm getting an error when I'm clicking on create virtual chassis at the bottom of the device page if there are no device selected.

screen shot 2018-01-25 at 11 36 08 pm

To reproduce,

  • Go to the device page Devices > Devices
  • Go to the bottom of the page, without selecting anything
  • Click create virtual chassis

BTW it took me some time to find this button since it's at the bottom of the page. I have more than 50 devices and buy default these buttons are not visible for me, I need to scroll down.

Originally created by @dgarros on GitHub (Jan 26, 2018). ### Issue type [ ] Feature request <!-- An enhancement of existing functionality --> [X] Bug report <!-- Unexpected or erroneous behavior --> [ ] Documentation <!-- A modification to the documentation --> ### Environment * Python version: 3.6 * NetBox version: 2.3-beta1 ### Description I'm getting an error when I'm clicking on `create virtual chassis` at the bottom of the device page if there are no device selected. <img width="766" alt="screen shot 2018-01-25 at 11 36 08 pm" src="https://user-images.githubusercontent.com/304126/35429348-8e0b1470-0228-11e8-8385-1b1e9cad685a.png"> To reproduce, - Go to the device page `Devices > Devices` - Go to the bottom of the page, without selecting anything - Click `create virtual chassis` > BTW it took me some time to find this button since it's at the bottom of the page. I have more than 50 devices and buy default these buttons are not visible for me, I need to scroll down.
adam added the type: bugstatus: accepted labels 2025-12-29 16:32:34 +01:00
adam closed this issue 2025-12-29 16:32:34 +01:00
Author
Owner

@nathbooth commented on GitHub (Jan 26, 2018):

Ditto!

Request Method: POST
Request URL: http://...:8080//dcim/virtual-chassis/add/

Django Version: 1.11.9
Python Version: 3.6.4
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
'corsheaders',
'debug_toolbar',
'django_filters',
'django_tables2',
'mptt',
'rest_framework',
'rest_framework_swagger',
'timezone_field',
'circuits',
'dcim',
'ipam',
'extras',
'secrets',
'tenancy',
'users',
'utilities',
'virtualization')
Installed Middleware:
('debug_toolbar.middleware.DebugToolbarMiddleware',
'corsheaders.middleware.CorsMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
'utilities.middleware.ExceptionHandlingMiddleware',
'utilities.middleware.LoginRequiredMiddleware',
'utilities.middleware.APIVersionMiddleware')

Traceback:

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner
41. response = get_response(request)

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)

File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/usr/local/lib/python3.6/site-packages/django/views/generic/base.py" in view
68. return self.dispatch(request, *args, **kwargs)

File "/usr/local/lib/python3.6/site-packages/django/contrib/auth/mixins.py" in dispatch
92. return super(PermissionRequiredMixin, self).dispatch(request, *args, **kwargs)

File "/usr/local/lib/python3.6/site-packages/django/views/generic/base.py" in dispatch
88. return handler(request, *args, **kwargs)

File "/opt/netbox/netbox/dcim/views.py" in post
2047. device_list = pk_form.cleaned_data['pk']

Exception Type: KeyError at /netbox/aviva/dcim/virtual-chassis/add/
Exception Value: 'pk'

@nathbooth commented on GitHub (Jan 26, 2018): Ditto! Request Method: POST Request URL: http://*.*.*.*:8080//dcim/virtual-chassis/add/ Django Version: 1.11.9 Python Version: 3.6.4 Installed Applications: ('django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.humanize', 'corsheaders', 'debug_toolbar', 'django_filters', 'django_tables2', 'mptt', 'rest_framework', 'rest_framework_swagger', 'timezone_field', 'circuits', 'dcim', 'ipam', 'extras', 'secrets', 'tenancy', 'users', 'utilities', 'virtualization') Installed Middleware: ('debug_toolbar.middleware.DebugToolbarMiddleware', 'corsheaders.middleware.CorsMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.security.SecurityMiddleware', 'utilities.middleware.ExceptionHandlingMiddleware', 'utilities.middleware.LoginRequiredMiddleware', 'utilities.middleware.APIVersionMiddleware') Traceback: File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py" in inner 41. response = get_response(request) File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response 187. response = self.process_exception_by_middleware(e, request) File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py" in _get_response 185. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/usr/local/lib/python3.6/site-packages/django/views/generic/base.py" in view 68. return self.dispatch(request, *args, **kwargs) File "/usr/local/lib/python3.6/site-packages/django/contrib/auth/mixins.py" in dispatch 92. return super(PermissionRequiredMixin, self).dispatch(request, *args, **kwargs) File "/usr/local/lib/python3.6/site-packages/django/views/generic/base.py" in dispatch 88. return handler(request, *args, **kwargs) File "/opt/netbox/netbox/dcim/views.py" in post 2047. device_list = pk_form.cleaned_data['pk'] Exception Type: KeyError at /netbox/aviva/dcim/virtual-chassis/add/ Exception Value: 'pk'
Author
Owner

@jeremystretch commented on GitHub (Jan 30, 2018):

Fixed in 8b6d731cb6

@jeremystretch commented on GitHub (Jan 30, 2018): Fixed in 8b6d731cb61cda10c76b6607a21e95dc3ee72d73
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1512