Error "ScriptModule matching query does not exist." after upgrading netbox to 3.5.1 #14
-
I have updated netbox to version 3.5.1, removed netbox-dns and installed netbox-plugin-dns packages.
/opt/netbox/netbox/scripts/bindrndc.py:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
Hi @kemeris2000, did this script work before you upgraded to NetBox 3.5.1/NetBox DNS 0.18.0? If it did, could you please provide everything that is required to make it work? There is at least one reference to the path It would also be helpful to have a minimal version of the script that demonstrates the issue. Minimal in this context means that in the best case there no code that is not required to cause the problem, but the problem is still present. This helps a lot in finding and fixing the problem. In your example you wrote that the issue is occurring when zones are updated, so at the very least all the other event handlers probably can be omitted. |
Beta Was this translation helpful? Give feedback.
-
Thank you for reply peteeckel. This script is not finished but was fully working on Netbox 3.4.7. After upgrade rest of the scripts works, except this one. Have reduced script to minimum and get same problem, no matter which content type triggers it. Tried to change class name, still does not work. I suspect this is netbox problem and not netbox-plugin-dns. from extras.scripts import *
|
Beta Was this translation helpful? Give feedback.
-
Hi @kemeris2000, I converted this issue to a discussion as it isn't an issue with NetBox DNS (or NetBox). With your minimal script, we can run the tests quite easily. Let's do a walkthrough so you get an idea how that can be done. Test the script itselfI just recreated your script on my NetBox 3.5.1 test instance (as file
In the GUI, look under 'Customization/Scripts' if it shows up. If it doesn't, one possible reason is permission problems - I stumbled across that myself in the first attempt. Another issue might be SELinux, look at the audit log for hints. But the script itself is OK. If it shows up like this, you should be fine: Run the script from the GUIYou can also run the script from the GUI, and as expected it works like a charm: Test the API invocation of the scriptThe next step is to test whether the script can be invoked from the API, which is what your webhook uses. You probably have an API token for this, so let's see what happens. And voilá:
Reproduce the errorNow how can we recreate your error message Easy: Get the URL wrong. More precisely: Get the name of the script file wrong, which is the first part of the last path element in the URL:
When you mess up the second part (the name of your
ConclusionIf you can rule out the first possible issue by checking the script in the GUI, you should try with the If your script file is named |
Beta Was this translation helpful? Give feedback.
Hi @kemeris2000, I converted this issue to a discussion as it isn't an issue with NetBox DNS (or NetBox).
With your minimal script, we can run the tests quite easily. Let's do a walkthrough so you get an idea how that can be done.
Test the script itself
I just recreated your script on my NetBox 3.5.1 test instance (as file
test.py
):In the GUI, look under 'Customization/Scripts' if it shows up. If it doesn't, one possible reason is permission problems - I stumbled…