Custom scripts broken in 4.2.7 #19192
Replies: 3 comments 1 reply
-
Hi - |
Beta Was this translation helpful? Give feedback.
-
I have also got this particular issue in upgrading from 4.2.6 - 4.2.7, nothing has been altered in scripts between versions. <class 'django.urls.exceptions.NoReverseMatch'> Reverse for 'script_jobs' with arguments '('',)' not found. 2 pattern(s) tried: ['extras/scripts/(?P[^/]+)\.(?P[^/]+)/jobs/\Z', 'extras/scripts/(?P[0-9]+)/jobs/\Z'] Python version: 3.10.12 |
Beta Was this translation helpful? Give feedback.
-
Hi, In my case, this was because one of the script became "invalid" after migration. import extras
extras.models.ScriptModule.objects.filter(file_path=script_filename).delete()
# extras.models.ScriptModule.objects.delete() Strangely enough, I was then able to just re-add the script file after deleting it. I don't know what the exact issue was. This is linked to the following line in the template that display the view list of scripts: {% if script.is_executable %}
<a href="{% url 'extras:script' script.pk %}" id="{{ script.module }}.{{ script.class_name }}">{{ script.python_class.name }}</a>
{% else %}
<a href="{% url 'extras:script_jobs' script.pk %}" id="{{ script.module }}.{{ script.class_name }}">{{ script.python_class.name }}</a>
<span class="text-danger">
<i class="mdi mdi-alert" title="{% trans "Script is no longer present in the source file" %}"></i>
</span>
{% endif %} |
Beta Was this translation helpful? Give feedback.
-
We just did a netbox upgrade from 3.7.8 to 4.2.7 and I was not able to get to customization scripts. I was able to downgrade to 4.2.6 and scripts seem to work on that release. The error I get in 4.2.7 is:
There was a problem with your request. Please contact an administrator.
The complete exception is provided below:
<class 'django.urls.exceptions.NoReverseMatch'>
Reverse for 'script_jobs' with arguments '('',)' not found. 2 pattern(s) tried: ['extras/scripts/(?P[^/]+)\.(?P[^/]+)/jobs/\Z', 'extras/scripts/(?P[0-9]+)/jobs/\Z']
Python version: 3.10.12
NetBox version: 4.2.7
Plugins:
netbox_branching: 0.5.4
netbox_lifecycle: 1.1.5
netbox_routing: 0.3.0
netbox_topology_views: 4.2.1
Beta Was this translation helpful? Give feedback.
All reactions