Scripts are stuck at "running state" on execution #16298
Replies: 3 comments 6 replies
-
Netbox version? Can you show the script? I suggest you start with a simple "hello world" type of script, make sure you can run it, and then this would prove that the issue is with your script. There are some sample scripts here, although many may not have been updated for Netbox 4.0. |
Beta Was this translation helpful? Give feedback.
-
8e461e56f6e1 (v4.0.2)
Here is the docker stack: The container that the script appear in after adding via GUI is docker-netbox-1. UPD:
Having the same issue with the worker. |
Beta Was this translation helpful? Give feedback.
-
This issue has been fixed in netbox-community/netbox-chart#261 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am currently trying to start creating scripts for netbox, but on every run job stuck at "running" state and never quits.
Here is the log from netbox-worker-docker:
08:57:32 default: extras.scripts.run_script(commit=False, data={}, job=<Job: 1aa8a2f4-30dc-4d71-b6b2-e6b864181efb>, request=<utilities.request.NetBoxFakeRequest object at 0x7f1716bb1950>) (1aa8a2f4-30dc-4d71-b6b2-e6b864181efb)
08:57:32 [Job 1aa8a2f4-30dc-4d71-b6b2-e6b864181efb]: exception raised while executing (extras.scripts.run_script)
Traceback (most recent call last):
File "/opt/netbox/venv/lib/python3.11/site-packages/rq/worker.py", line 1430, in perform_job
rv = job.perform()
^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.11/site-packages/rq/job.py", line 1280, in perform
self._result = self._execute()
^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.11/site-packages/rq/job.py", line 1317, in _execute
result = self.func(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/netbox/extras/scripts.py", line 627, in run_script
script = ScriptModel.objects.get(pk=job.object_id).python_class()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: 'NoneType' object is not callable
P.S. Just to mention that it just does not run me everything under Class, but is able to run regular python command. For example I'm able to do ping via script, but it shouldn't be under "run()" function to be executed.
Kindly asking for assist.
Beta Was this translation helpful? Give feedback.
All reactions