Closed kguest closed 3 weeks ago
It seems you use plugins. Make sure that every plugin is updated and compatible with NetBox 4.x.
So you were right it looks like I had a couple of plugins that weren't compatible with Netbox 4.x
I've removed them from plugins.py and ran a rebuild to stop them being loaded as they weren't really getting used.
However, now I'm recieving a different error:
netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/migrations/loader.py", line 276, in build_graph
netbox-docker-netbox-1 | self.graph.validate_consistency()
netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/migrations/graph.py", line 198, in validate_consistency
netbox-docker-netbox-1 | [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/migrations/graph.py", line 198, in <listcomp>
netbox-docker-netbox-1 | [n.raise_error() for n in self.node_map.values() if isinstance(n, DummyNode)]
netbox-docker-netbox-1 | ^^^^^^^^^^^^^^^
netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/migrations/graph.py", line 60, in raise_error
netbox-docker-netbox-1 | raise NodeNotFoundError(self.error_message, self.key, origin=self.origin)
netbox-docker-netbox-1 | django.db.migrations.exceptions.NodeNotFoundError: Migration dcim.0183_devicetype_exclude_from_utilization dependencies reference nonexistent parent node ('dcim', '0182_zero_length_cable_fix')
netbox-docker-netbox-1 |
netbox-docker-netbox-1 | The above exception was the direct cause of the following exception:
netbox-docker-netbox-1 |
netbox-docker-netbox-1 | Traceback (most recent call last):
netbox-docker-netbox-1 | File "/opt/netbox/netbox/./manage.py", line 10, in <module>
netbox-docker-netbox-1 | execute_from_command_line(sys.argv)
netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
netbox-docker-netbox-1 | utility.execute()
netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/__init__.py", line 436, in execute
netbox-docker-netbox-1 | self.fetch_command(subcommand).run_from_argv(self.argv)
netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/base.py", line 413, in run_from_argv
netbox-docker-netbox-1 | self.execute(*args, **cmd_options)
netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/base.py", line 459, in execute
netbox-docker-netbox-1 | output = self.handle(*args, **options)
netbox-docker-netbox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/commands/showmigrations.py", line 66, in handle
netbox-docker-netbox-1 | return self.show_list(connection, options["app_label"])
netbox-docker-netbox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/core/management/commands/showmigrations.py", line 85, in show_list
netbox-docker-netbox-1 | loader = MigrationLoader(connection, ignore_no_migrations=True)
netbox-docker-netbox-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/migrations/loader.py", line 58, in __init__
netbox-docker-netbox-1 | self.build_graph()
netbox-docker-netbox-1 | File "/opt/netbox/venv/lib/python3.11/site-packages/django/db/migrations/loader.py", line 295, in build_graph
netbox-docker-netbox-1 | raise NodeNotFoundError(
netbox-docker-netbox-1 | 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.
netbox-docker-netbox-1 | ⏳ Waiting on DB... (15s / 30s)```
This now looks like a problem unrelated to the Docker image, and hence you should use them upstream issue tracker and discussions and chat to get help. Generally, make sure that you are not skipping too many versions while upgrading and that you read the release notes carefully. Afaik, before the upgrade to NB 4.x, you should first upgrade to the latest patch version of NB 3.x
Ah I see, I'll try updating to latest 3.x first!
Cheers for the help.
I had exactly the same issue on v4.0.3 installed on an empty database and the problem has two parts:
collectstatic
phase after pip install - obvious user mistakeThe second one seems concerning, but is probably more related to Netbox itself, not this repo. However, if Netbox app has that behaviour by design, I think this repo should incorporate some logic to bypass it - the same way as superuser insert is handled.
Current Behavior
Ran through the upgrade steps with no errors - I have a backup so can run through this again and provide screenshots if required.
Ran docker compose up - container starts but gets stuck on the health check for the DB.
Added DB_WAIT_DEBUG: 1 to my env variables and will attach the error output below.
Expected Behavior
I expected that due to the upgrade process being successful that the container would run,
Docker Compose Version
Docker Compose version v2.27.0
Docker Version
The git Revision
0c99ff8b5663db3e0db5a45660cebda9f917508b
The git Status
Startup Command
sudo docker compose up
NetBox Logs
Content of docker-compose.override.yml