-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
severity: mediumResults in substantial degraded or broken functionality for specfic workflowsResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
Deployment Type
Self-hosted
NetBox Version
v4.0.0
Python Version
3.11
Steps to Reproduce
not sure on exact steps yet. but scripts need to exist in the db that no longer exist on disk.
Expected Behavior
migration should complete successfully even if there are missing scripts
Observed Behavior
db migration fails and blocks netbox from starting.
netbox-1 | ⚙️ Applying database migrations
netbox-1 | 🧬 loaded config '/etc/netbox/config/configuration.py'
netbox-1 | 🧬 loaded config '/etc/netbox/config/extra.py'
netbox-1 | 🧬 loaded config '/etc/netbox/config/logging.py'
netbox-1 | 🧬 loaded config '/etc/netbox/config/plugins.py'
netbox-1 | Operations to perform:
netbox-1 | Apply all migrations: account, auth, circuits, contenttypes, core, dcim, django_rq, extras, ipam, netbox_gateways, sessions, social_django, taggit, tenancy, users, virtualization, vpn, wireless
netbox-1 | Running migrations:
netbox-1 | Traceback (most recent call last):
netbox-1 | File "/opt/netbox/netbox/./manage.py", line 10, in <module>
netbox-1 | execute_from_command_line(sys.argv)
netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
netbox-1 | utility.execute()
netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute
netbox-1 | self.fetch_command(subcommand).run_from_argv(self.argv)
netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/base.py", line 413, in run_from_argv
netbox-1 | self.execute(*args, **cmd_options)
netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/base.py", line 459, in execute
netbox-1 | output = self.handle(*args, **options)
netbox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/base.py", line 107, in wrapper
netbox-1 | res = handle_func(*args, **kwargs)
netbox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/commands/migrate.py", line 356, in handle
netbox-1 | post_migrate_state = executor.migrate(
netbox-1 | ^^^^^^^^^^^^^^^^^
netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/migrations/executor.py", line 135, in migrate
netbox-1 | state = self._migrate_all_forwards(
netbox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
netbox-1 | state = self.apply_migration(
netbox-1 | ^^^^^^^^^^^^^^^^^^^^^
netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/migrations/executor.py", line 252, in apply_migration
netbox-1 | state = migration.apply(state, schema_editor)
netbox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/migrations/migration.py", line 132, in apply
netbox-1 | operation.database_forwards(
netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/migrations/operations/special.py", line 193, in database_forwards
netbox-1 | self.code(from_state.apps, schema_editor)
netbox-1 | File "/opt/netbox/netbox/extras/migrations/0109_script_model.py", line 93, in update_scripts
netbox-1 | for script_name in get_module_scripts(module):
netbox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox-1 | File "/opt/netbox/netbox/extras/migrations/0109_script_model.py", line 63, in get_module_scripts
netbox-1 | module = loader.load_module()
netbox-1 | ^^^^^^^^^^^^^^^^^^^^
netbox-1 | File "<frozen importlib._bootstrap_external>", line 605, in _check_name_wrapper
netbox-1 | File "<frozen importlib._bootstrap_external>", line 1120, in load_module
netbox-1 | File "<frozen importlib._bootstrap_external>", line 945, in load_module
netbox-1 | File "<frozen importlib._bootstrap>", line 290, in _load_module_shim
netbox-1 | File "<frozen importlib._bootstrap>", line 721, in _load
netbox-1 | File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
netbox-1 | File "<frozen importlib._bootstrap_external>", line 936, in exec_module
netbox-1 | File "<frozen importlib._bootstrap_external>", line 1073, in get_code
netbox-1 | File "<frozen importlib._bootstrap_external>", line 1130, in get_data
netbox-1 | FileNotFoundError: [Errno 2] No such file or directory: '/opt/netbox/netbox/scripts/add_gateways_to_prefixes.py'
Metadata
Metadata
Assignees
Labels
severity: mediumResults in substantial degraded or broken functionality for specfic workflowsResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application