Update/Migration Failure #16142
Replies: 3 comments 2 replies
-
You can't upgrade from 3.1.8 to 4.0 First you need to uppgrade to 3.7, then upgrade to 4.0 |
Beta Was this translation helpful? Give feedback.
-
Have attempted that we end up with this with release 3.7.8
|
Beta Was this translation helpful? Give feedback.
-
So after a bit of playing around; doing this on a copy of the database; I removed the section in 0008_tenancy migration back in 3.4.0 and it upgraded all the way until I hit the upgrade to 4.0.0 which now I get the following error in which I just shake my head:
This tenancy issue is a real show stoppers for upgrades.. I reviewed the release notes; applied the migration plugin at 3.1.8. I can restore the database to its original state from 3.1.8 if anyone has an additional suggestion.. Basically I have taken this upgrade path: 3.1.8 -> (with plugin migration script installed and committed change for tenants; no ASN within our tables) |
Beta Was this translation helpful? Give feedback.
-
Deployment Type
Self-hosted
NetBox Version
v4.0.1
Python Version
3.11
Steps to Reproduce
1.) dump excluding object changes table from old NetBox environment 3.1.8
2.) import sql dump into fresh 4.0.1 environment
3.) Execute the sudo PYTHON=/usr/bin/python3.11 ./upgrade.sh
Expected Behavior
New environment come online.
Observed Behavior
`Applying database migrations (python3 netbox/manage.py migrate)...
Traceback (most recent call last):
File "/opt/netbox-4.0/venv/lib64/python3.11/site-packages/django/db/migrations/loader.py", line 276, in build_graph
self.graph.validate_consistency()
File "/opt/netbox-4.0/venv/lib64/python3.11/site-packages/django/db/migrations/graph.py", line 198, in validate_consistency
[n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
File "/opt/netbox-4.0/venv/lib64/python3.11/site-packages/django/db/migrations/graph.py", line 198, in
[n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
^^^^^^^^^^^^^^^
File "/opt/netbox-4.0/venv/lib64/python3.11/site-packages/django/db/migrations/graph.py", line 60, in raise_error
raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
django.db.migrations.exceptions.NodeNotFoundError: Migration circuits.0038_squashed_0042 dependencies reference nonexistent parent node ('circuits', '0037_new_cabling_models')
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/netbox-4.0/netbox/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/opt/netbox-4.0/venv/lib64/python3.11/site-packages/django/core/management/init.py", line 442, in execute_from_command_line
utility.execute()
File "/opt/netbox-4.0/venv/lib64/python3.11/site-packages/django/core/management/init.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/netbox-4.0/venv/lib64/python3.11/site-packages/django/core/management/base.py", line 413, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/netbox-4.0/venv/lib64/python3.11/site-packages/django/core/management/base.py", line 459, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.0/venv/lib64/python3.11/site-packages/django/core/management/base.py", line 107, in wrapper
res = handle_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.0/venv/lib64/python3.11/site-packages/django/core/management/commands/migrate.py", line 117, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.0/venv/lib64/python3.11/site-packages/django/db/migrations/executor.py", line 18, in init
self.loader = MigrationLoader(self.connection)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.0/venv/lib64/python3.11/site-packages/django/db/migrations/loader.py", line 58, in init
self.build_graph()
File "/opt/netbox-4.0/venv/lib64/python3.11/site-packages/django/db/migrations/loader.py", line 295, in build_graph
raise NodeNotFoundError(
django.db.migrations.exceptions.NodeNotFoundError: Migration circuits.0038_squashed_0042 depends on nonexistent node ('circuits', '0037_new_cabling_models'). Django tried to replace migration circu its.0037_new_cabling_models with any of [circuits.0003_squashed_0037] but wasn't able to because some of the replaced migrations are already applied.
`
Beta Was this translation helpful? Give feedback.
All reactions