-
|
Everything was working fine and all of a sudden get this: I tried to remove the data input in the command line to see if I get any error but I get the same thing. This is my CLI: Filename: ipnet.py /opt/netbox/venv/bin/python3 /opt/netbox/netbox/manage.py runscript --loglevel debug ipnet.NewIP --commit --data '{"hostname": "testing.example.com", "address":"192.168.12.32/32" } ======= |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
Based on the backtrace, presumably you are using Netbox 3.6.4? Also, what does "all of a sudden" mean? Presumably something else changed - did you upgrade Netbox for example? Or make a change to your script? However, without seeing the content of your script, it's impossible to see where the problem might be. Making the smallest possible script that reproduces your problem is a very good way to approach this issue. If you find that a minimal script works fine, but the script in question doesn't, then it's just a case of removing items from that script until you identify what's causing the problem. However, if your minimal script still reproduces the problem, then post it here so we can reproduce the issue too. I note that the Netbox code says: Therefore if script is None, it seems it was unable to load |
Beta Was this translation helpful? Give feedback.
-
|
I was able to reproduce your problem simply by putting a syntax error in a script: raised as #15353 so that this error handling can be improved in Netbox. I think the chances are that you've done the same. You may get a more useful error message by running the following at the CLI: If that doesn't show a syntax error, but instead shows a library loading error like Once you've found and fixed the problem, remove these lines. |
Beta Was this translation helpful? Give feedback.
I was able to reproduce your problem simply by putting a syntax error in a script: raised as #15353 so that this error handling can be improved in Netbox. I think the chances are that you've done the same.
You may get a more useful error message by running the following at the CLI:
If that doesn't show a syntax error, but instead shows a library loading error like
ModuleNotFoundError: No module named 'extras', then temporarily add the following four lines at the very top of your script, and try again: