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

manage.py runscript broken in 4.1.5 #17892

Closed
llamafilm opened this issue Oct 30, 2024 · 3 comments
Closed

manage.py runscript broken in 4.1.5 #17892

llamafilm opened this issue Oct 30, 2024 · 3 comments
Labels
netbox status: duplicate This issue has already been raised type: bug A confirmed report of unexpected behavior in the application

Comments

@llamafilm
Copy link
Contributor

Deployment Type

Self-hosted

Triage priority

I'm a NetBox Labs customer

NetBox Version

v4.1.5

Python Version

3.12

Steps to Reproduce

  1. Install Netbox from this commit 5f94dff
  2. Run a script using manage.py runscript

Expected Behavior

no error

Observed Behavior

This looks like the same issue as #17885. This commit fixes the issue when running scripts in the GUI, but it's still broken in the CLI.

$ /opt/netbox/venv/bin/python /opt/netbox/netbox/manage.py runscript update_telegraf.UpdateTelegraf --commit
Traceback (most recent call last):
  File "/opt/netbox/netbox/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/base.py", line 413, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/core/management/base.py", line 459, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox-5f94dff81512e5fb687ccbc71883b2d629b1d091/netbox/extras/management/commands/runscript.py", line 85, in handle
    job = ScriptJob.enqueue(
          ^^^^^^^^^^^^^^^^^^
  File "/opt/netbox-5f94dff81512e5fb687ccbc71883b2d629b1d091/netbox/netbox/jobs.py", line 106, in enqueue
    return Job.enqueue(cls.handle, name=name, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/netbox-5f94dff81512e5fb687ccbc71883b2d629b1d091/netbox/core/models/jobs.py", line 236, in enqueue
    job.full_clean()
  File "/opt/netbox/venv/lib/python3.12/site-packages/django/db/models/base.py", line 1561, in full_clean
    raise ValidationError(errors)
django.core.exceptions.ValidationError: {'name': ['This field cannot be blank.']}
@llamafilm llamafilm added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels Oct 30, 2024
@jhofmueller
Copy link

For me it does not work via the UI either. Just Tested with this very simple script:

class TestScript(Script):
    class Meta:
        name = "TestScript"

    def run(self, data, commit):
        self.log_info('Script started.')
        self.log_success('Script finished.')

got

Server Error

There was a problem with your request. Please contact an administrator.
The complete exception is provided below:
<class 'django.core.exceptions.ValidationError'>

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

Python version: 3.12.3
NetBox version: 4.1.5
Plugins: 
  netbox_dns: 1.1.5
  netbox_secrets: 2.1.0

If further assistance is required, please post to the [NetBox discussion forum](https://github.com/netbox-community/netbox/discussions) on GitHub.
[Home Page](https://localhost/)

@jeremystretch jeremystretch closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2024
@jeremystretch jeremystretch added status: duplicate This issue has already been raised and removed status: needs triage This issue is awaiting triage by a maintainer labels Oct 30, 2024
@ly-sona
Copy link

ly-sona commented Oct 30, 2024

having the exact same issue

@theobarrague
Copy link

Same issue
2024-10-31 13:18:06 UTC 3b9349c1ea55 NetBox Community v4.1.5 (docker)

@netbox-community netbox-community locked as resolved and limited conversation to collaborators Oct 31, 2024
@jeremystretch jeremystretch added the netbox label Nov 1, 2024 — with Linear
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
netbox 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

5 participants