Migrate from 3.6.7 to 4.0.6 nonexistent node failure #9912

Closed
opened 2025-12-29 21:24:17 +01:00 by adam · 2 comments
Owner

Originally created by @NetworkingB2A on GitHub (Jun 26, 2024).

Deployment Type

Self-hosted

NetBox Version

v3.6.7

Python Version

3.10

Steps to Reproduce

Followed directions on netbox lab docs page for upgrades.

  1. cd /opt/netbox
  2. sudo git checkout master
  3. sudo git pull origin master

Expected Behavior

Migration to new database schema and netbox to load webpage

Observed Behavior

This is the exact error I received

Applying database migrations (python3 netbox/manage.py migrate)...
Traceback (most recent call last):
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/loader.py", line 276, in build_graph
    self.graph.validate_consistency()
  File "/opt/netbox/venv/lib/python3.10/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/venv/lib/python3.10/site-packages/django/db/migrations/graph.py", line 198, in <listcomp>
    [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
  File "/opt/netbox/venv/lib/python3.10/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 dcim.0183_devicetype_exclude_from_utilization dependencies reference nonexistent parent node ('dcim', '0182_zero_length_cable_fix')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/netbox/netbox/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/base.py", line 413, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/base.py", line 459, in execute
    output = self.handle(*args, **options)
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/base.py", line 107, in wrapper
    res = handle_func(*args, **kwargs)
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/commands/migrate.py", line 117, in handle
    executor = MigrationExecutor(connection, self.migration_progress_callback)
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/executor.py", line 18, in __init__
    self.loader = MigrationLoader(self.connection)
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/loader.py", line 58, in __init__
    self.build_graph()
  File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/loader.py", line 295, in build_graph
    raise NodeNotFoundError(
django.db.migrations.exceptions.NodeNotFoundError: Migration dcim.0183_devicetype_exclude_from_utilization depends on nonexistent node ('dcim', '0182_zero_length_cable_fix'). Django tried to replace migration dcim.0182_zero_length_cable_fix with any of [dcim.0167_squashed_0182] but wasn't able to because some of the replaced migrations are already applied.
Originally created by @NetworkingB2A on GitHub (Jun 26, 2024). ### Deployment Type Self-hosted ### NetBox Version v3.6.7 ### Python Version 3.10 ### Steps to Reproduce Followed directions on netbox lab docs page for upgrades. 1. cd /opt/netbox 2. sudo git checkout master 3. sudo git pull origin master ### Expected Behavior Migration to new database schema and netbox to load webpage ### Observed Behavior This is the exact error I received ```python Applying database migrations (python3 netbox/manage.py migrate)... Traceback (most recent call last): File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/loader.py", line 276, in build_graph self.graph.validate_consistency() File "/opt/netbox/venv/lib/python3.10/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/venv/lib/python3.10/site-packages/django/db/migrations/graph.py", line 198, in <listcomp> [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)] File "/opt/netbox/venv/lib/python3.10/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 dcim.0183_devicetype_exclude_from_utilization dependencies reference nonexistent parent node ('dcim', '0182_zero_length_cable_fix') The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/opt/netbox/netbox/manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line utility.execute() File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/__init__.py", line 436, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/base.py", line 413, in run_from_argv self.execute(*args, **cmd_options) File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/base.py", line 459, in execute output = self.handle(*args, **options) File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/base.py", line 107, in wrapper res = handle_func(*args, **kwargs) File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/commands/migrate.py", line 117, in handle executor = MigrationExecutor(connection, self.migration_progress_callback) File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/executor.py", line 18, in __init__ self.loader = MigrationLoader(self.connection) File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/loader.py", line 58, in __init__ self.build_graph() File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/loader.py", line 295, in build_graph raise NodeNotFoundError( django.db.migrations.exceptions.NodeNotFoundError: Migration dcim.0183_devicetype_exclude_from_utilization depends on nonexistent node ('dcim', '0182_zero_length_cable_fix'). Django tried to replace migration dcim.0182_zero_length_cable_fix with any of [dcim.0167_squashed_0182] but wasn't able to because some of the replaced migrations are already applied. ```
adam closed this issue 2025-12-29 21:24:18 +01:00
Author
Owner

@NetworkingB2A commented on GitHub (Jun 26, 2024):

In a few other issues, I need to upgrade to 3.7.8. I will follow that procedure and perform the update.

It would be beneficial if there were some easy-to-find migration steps and procedures to follow. Just a quick workflow showing which versions must be upgraded to which version from which versions.

@NetworkingB2A commented on GitHub (Jun 26, 2024): In a few other issues, I need to upgrade to 3.7.8. I will follow that procedure and perform the update. It would be beneficial if there were some easy-to-find migration steps and procedures to follow. Just a quick workflow showing which versions must be upgraded to which version from which versions.
Author
Owner

@jeremystretch commented on GitHub (Jun 26, 2024):

Just a quick workflow showing which versions must be upgraded to which version from which versions.

This can be found at the top of the documentation page for upgrading NetBox:

screenshot

@jeremystretch commented on GitHub (Jun 26, 2024): > Just a quick workflow showing which versions must be upgraded to which version from which versions. This can be found at the top of the [documentation page for upgrading NetBox](https://netboxlabs.com/docs/netbox/en/stable/installation/upgrading/): ![screenshot](https://github.com/netbox-community/netbox/assets/13487278/2d9ed5d5-e24b-4446-a561-5c65a3199cb7)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9912