-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Scripts issue post v4.0.2 upgrade #16218
Comments
@cruse1977 thanks for the report and the example script. |
I ran into this problem because my CD dev pipeline tries to launch a new VM, restore the latest database backup locally, install the new Netbox, then run |
Did some digging on this - this look in part to be due to somewhere in the migration and creation of the ScriptModule objects; the data source being blanked but this is intermittent:
Upgrade 1: - migration creating empty data source ID print(ScriptModule.objects.all()[0].dict)
Upgrade 2: - migration correctly preserving data source id
When the data source is preserved, running an 'edit' then save, seems to sync the data source, updates the is_executable flag which allows the script to run - but its not available until this is done. |
I think there's a few things going on here; one is the migration sometimes blanking the data source; the other is when the sync occurs within NetBox. See my other post on this. |
Deployment Type
Self-hosted
NetBox Version
4.0.2
Python Version
3.12
Steps to Reproduce
This bug occurs with a 3.7 -> 4.x upgrade and cannot be resolved without removing affected scripts. It only occurs when the upgrade occurs with missing scripts.
Replicate empty 'file' environment whereas DB has been restored but files NOT:
Go to Script:
Run Upgrade to 4.0.2 - upgrade succeeds
Go to scripts -
Sync datasource (UI, or manage.py syncdatasource --all) manually
REPO used: https://github.com/cruse1977/test-scripts
Expected Behavior
Observed Behavior
The text was updated successfully, but these errors were encountered: