-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Fix #17685 seems to break script functionality in 4.1.5 #17885
Comments
Apologies for the bad formatting when pasting the log file, here it is hopefully better formatted:
|
Hmm. Sad I didn't see this issue before and tests didn't catch it. The bug originates from the following code. The justification of this was to not have the script name twice (as job name and related object) listed in the job table. Just having "SciptJob" as generic name seemed a bit odd to me at that time. Lines 24 to 27 in 58bc388
Now having #17886 merged might lead to confusion for further maintenance, as the code mentioned above states the name is not set and on the other hand its set explicitly on enqueue. As I'm not allowed to file housekeeping issues, I'd like to ask a maintainer to do so: Reverting #17886 and removing the code linked above should fix the issue and avoid confusion. |
Deployment Type
Self-hosted
Triage priority
N/A
NetBox Version
v4.1.5
Python Version
3.12
Steps to Reproduce
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
The text was updated successfully, but these errors were encountered: