Skip to content
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

Bulk edit of VM interfaces raises an error #14444

Closed
dteknet opened this issue Dec 6, 2023 · 1 comment
Closed

Bulk edit of VM interfaces raises an error #14444

dteknet opened this issue Dec 6, 2023 · 1 comment
Labels
status: duplicate This issue has already been raised type: bug A confirmed report of unexpected behavior in the application

Comments

@dteknet
Copy link

dteknet commented Dec 6, 2023

NetBox version

3.6.4

Python version

3.8

Steps to Reproduce

  1. Create a VM
  2. Create two interfaces in VM (type: virtual)
  3. Return to the list of VM interfaces
  4. Select two VM interfaces
  5. Press the "Edit selected" button

Expected Behavior

Edit dialog displayed

Observed Behavior

Exception raised
image

Internal Server Error: /virtualization/interfaces/edit/

AttributeError at /virtualization/interfaces/edit/ 'NoneType' object has no attribute 'site'

Request Method: POST
Request URL: https://netbox.domain.local/virtualization/interfaces/edit/?return_url=/virtualization/virtual-machines/1541/interfaces/
Django Version: 4.2.6
Python Executable: /opt/netbox/venv/bin/python3 Python Version: 3.8.10 Python Path: ['/opt/netbox/netbox', '/opt/netbox', '/opt/netbox/venv/bin', '/usr/lib/python38.zip', '/usr/lib/python3.8', '/usr/lib/python3.8/lib-dynload', '/opt/netbox/venv/lib/python3.8/site-packages']
Server time: Wed, 06 Dec 2023 10:43:27 +0200 Installed Applications:
['django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.humanize',
 'django.forms',
 'corsheaders',
 'debug_toolbar',
 'graphiql_debug_toolbar',
 'django_filters',
 'django_tables2',
 'django_prometheus',
 'graphene_django',
 'mptt',
 'rest_framework',
 'social_django',
 'taggit',
 'timezone_field',
 'core',
 'account',
 'circuits',
 'dcim',
 'ipam',
 'extras',
 'tenancy',
 'users',
 'utilities',
 'virtualization',
 'wireless',
 'django_rq',
 'drf_spectacular',
 'drf_spectacular_sidecar']
Installed Middleware:
['graphiql_debug_toolbar.middleware.DebugToolbarMiddleware',
 'django_prometheus.middleware.PrometheusBeforeMiddleware',
 'corsheaders.middleware.CorsMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware',
 'django.middleware.clickjacking.XFrameOptionsMiddleware',
 'django.middleware.security.SecurityMiddleware',
 'netbox.middleware.RemoteUserMiddleware',
 'netbox.middleware.CoreMiddleware',
 'netbox.middleware.MaintenanceModeMiddleware',
 'django_prometheus.middleware.PrometheusAfterMiddleware']


Traceback (most recent call last):
  File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner
    response = get_response(request)
  File "/opt/netbox/venv/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/opt/netbox/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 104, in view
    return self.dispatch(request, *args, **kwargs)
  File "/opt/netbox/netbox/netbox/views/generic/base.py", line 77, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/opt/netbox/netbox/utilities/views.py", line 99, in dispatch
    return super().dispatch(request, *args, **kwargs)
  File "/opt/netbox/venv/lib/python3.8/site-packages/django/views/generic/base.py", line 143, in dispatch
    return handler(request, *args, **kwargs)
  File "/opt/netbox/netbox/netbox/views/generic/bulk_views.py", line 642, in post
    form = self.form(initial=initial_data)
  File "/opt/netbox/netbox/virtualization/forms/bulk_edit.py", line 298, in __init__
    site = interface.virtual_machine.cluster.site

Exception Type: AttributeError at /virtualization/interfaces/edit/ Exception Value: 'NoneType' object has no attribute 'site'
Raised during: virtualization.views.VMInterfaceBulkEditView
@dteknet dteknet added the type: bug A confirmed report of unexpected behavior in the application label Dec 6, 2023
@jeremystretch
Copy link
Member

It looks like you've hit #14363, which was fixed in NetBox v3.6.6. Please try upgrading.

@jeremystretch jeremystretch closed this as not planned Won't fix, can't repro, duplicate, stale Dec 6, 2023
@jeremystretch jeremystretch added the status: duplicate This issue has already been raised label Dec 6, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: duplicate This issue has already been raised type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

2 participants