Skip to content

Fix #17685 seems to break script functionality in 4.1.5 #17885

Closed
@acederlund

Description

@acederlund

Deployment Type

Self-hosted

Triage priority

N/A

NetBox Version

v4.1.5

Python Version

3.12

Steps to Reproduce

  1. Have scripts enabled in Netbox
  2. Try to run a script
  3. Netbox uses the job functionality to create a job, but does not provide a "name" for the job (as can be seen in previous jobs).
  4. A fault page is displayed

Expected Behavior

A job for the script was submitted, and output from the script was shown. Was working in v4.1.3 (we went straight from 4.1.3 to 4.1.5).

Problem seems to be related to these changes: #17847

Observed Behavior

`<class 'django.core.exceptions.ValidationError'>

{'name': ['This field cannot be blank.']}

Python version: 3.12.3
NetBox version: 4.1.5`

Log file says:
netbox-1 | 2024-10-29T14:52:01.481459179Z Initialized configuration netbox-1 | 2024-10-29T14:52:01.525754364Z Internal Server Error: /extras/scripts/2/ netbox-1 | 2024-10-29T14:52:01.525828197Z Traceback (most recent call last): netbox-1 | 2024-10-29T14:52:01.525832479Z File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/handlers/exception.py", line 55, in inner netbox-1 | 2024-10-29T14:52:01.525835327Z response = get_response(request) netbox-1 | 2024-10-29T14:52:01.525837521Z ^^^^^^^^^^^^^^^^^^^^^ netbox-1 | 2024-10-29T14:52:01.525839747Z File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/handlers/base.py", line 197, in _get_response netbox-1 | 2024-10-29T14:52:01.525842232Z response = wrapped_callback(request, *callback_args, **callback_kwargs) netbox-1 | 2024-10-29T14:52:01.525844385Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ netbox-1 | 2024-10-29T14:52:01.525846530Z File "/opt/netbox/venv/lib/python3.12/site-packages/django/views/generic/base.py", line 104, in view netbox-1 | 2024-10-29T14:52:01.525848922Z return self.dispatch(request, *args, **kwargs) netbox-1 | 2024-10-29T14:52:01.525851221Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ netbox-1 | 2024-10-29T14:52:01.525853286Z File "/opt/netbox/netbox/netbox/views/generic/base.py", line 26, in dispatch netbox-1 | 2024-10-29T14:52:01.525855462Z return super().dispatch(request, *args, **kwargs) netbox-1 | 2024-10-29T14:52:01.525857623Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ netbox-1 | 2024-10-29T14:52:01.525859696Z File "/opt/netbox/netbox/utilities/views.py", line 125, in dispatch netbox-1 | 2024-10-29T14:52:01.525861854Z return super().dispatch(request, *args, **kwargs) netbox-1 | 2024-10-29T14:52:01.525863888Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ netbox-1 | 2024-10-29T14:52:01.525865945Z File "/opt/netbox/netbox/utilities/views.py", line 39, in dispatch netbox-1 | 2024-10-29T14:52:01.525868267Z return super().dispatch(request, *args, **kwargs) netbox-1 | 2024-10-29T14:52:01.525870381Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ netbox-1 | 2024-10-29T14:52:01.525872525Z File "/opt/netbox/venv/lib/python3.12/site-packages/django/views/generic/base.py", line 143, in dispatch netbox-1 | 2024-10-29T14:52:01.525874774Z return handler(request, *args, **kwargs) netbox-1 | 2024-10-29T14:52:01.525899945Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ netbox-1 | 2024-10-29T14:52:01.525902029Z File "/opt/netbox/netbox/extras/views.py", line 1175, in post netbox-1 | 2024-10-29T14:52:01.525903704Z job = ScriptJob.enqueue( netbox-1 | 2024-10-29T14:52:01.525905171Z ^^^^^^^^^^^^^^^^^^ netbox-1 | 2024-10-29T14:52:01.525909231Z File "/opt/netbox/netbox/netbox/jobs.py", line 106, in enqueue netbox-1 | 2024-10-29T14:52:01.525910895Z return Job.enqueue(cls.handle, name=name, *args, **kwargs) netbox-1 | 2024-10-29T14:52:01.525912581Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ netbox-1 | 2024-10-29T14:52:01.525914117Z File "/opt/netbox/netbox/core/models/jobs.py", line 236, in enqueue netbox-1 | 2024-10-29T14:52:01.525915757Z job.full_clean() netbox-1 | 2024-10-29T14:52:01.525917239Z File "/opt/netbox/venv/lib/python3.12/site-packages/django/db/models/base.py", line 1561, in full_clean netbox-1 | 2024-10-29T14:52:01.525918937Z raise ValidationError(errors) netbox-1 | 2024-10-29T14:52:01.525920928Z django.core.exceptions.ValidationError: {'name': ['This field cannot be blank.']} netbox-1 | 2024-10-29T14:52:01.525922608Z Cleared configuration

Metadata

Metadata

Assignees

Labels

netboxseverity: highCompletely breaks certain functions, or substantially degrades performance application-widestatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions