NetBox upgrade from 4.0.11 to 4.1.X fails #19888
Unanswered
sumaullagaddi
asked this question in
Help Wanted!
Replies: 1 comment 1 reply
-
Backup your DB. Re-run all migrations: |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
We had NetBox(self-hosted) version 3.6.3. I have managed to update it to 4.0.11 by following the path 3.6.3>3.7.8>4.0.11. However, from here I am unable to upgrade to any 4.1.X version. It always fails with below error:
Postgrsql: 14.18
Python: 3.10
Redis: 6.0.16
Operations to perform:
Apply all migrations: account, auth, circuits, contenttypes, core, dcim, django_rq, extras, ipam, sessions, social_django, taggit, tenancy, users, virtualization, vpn, wireless
Running migrations:
Applying core.0011_move_objectchange... OK
Applying extras.0117_move_objectchange...Traceback (most recent call last):
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 103, in _execute
return self.cursor.execute(sql)
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/psycopg/cursor.py", line 97, in execute
raise ex.with_traceback(None)
psycopg.errors.UndefinedObject: constraint "extras_objectchange_user_id_7fdf8186_fk_auth_user_id" for table "core_objectchange" does not exist
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/netbox-4.1.0/netbox/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/django/core/management/init.py", line 442, in execute_from_command_line
utility.execute()
File "/opt/netbox-4.1.0/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-4.1.0/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-4.1.0/venv/lib/python3.10/site-packages/django/core/management/base.py", line 459, in execute
output = self.handle(*args, **options)
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/django/core/management/base.py", line 107, in wrapper
res = handle_func(*args, **kwargs)
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/django/core/management/commands/migrate.py", line 356, in handle
post_migrate_state = executor.migrate(
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/django/db/migrations/executor.py", line 135, in migrate
state = self._migrate_all_forwards(
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
state = self.apply_migration(
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/django/db/migrations/executor.py", line 252, in apply_migration
state = migration.apply(state, schema_editor)
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/django/db/migrations/migration.py", line 132, in apply
operation.database_forwards(
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/django/db/migrations/operations/special.py", line 37, in database_forwards
database_operation.database_forwards(
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/django/db/migrations/operations/special.py", line 106, in database_forwards
self._run_sql(schema_editor, self.sql)
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/django/db/migrations/operations/special.py", line 133, in _run_sql
schema_editor.execute(statement, params=None)
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/django/db/backends/postgresql/schema.py", line 45, in execute
return super().execute(sql, params)
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/django/db/backends/base/schema.py", line 202, in execute
cursor.execute(sql, params)
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 79, in execute
return self._execute_with_wrappers(
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 92, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 100, in _execute
with self.db.wrap_database_errors:
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/django/db/utils.py", line 91, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 103, in _execute
return self.cursor.execute(sql)
File "/opt/netbox-4.1.0/venv/lib/python3.10/site-packages/psycopg/cursor.py", line 97, in execute
raise ex.with_traceback(None)
django.db.utils.ProgrammingError: constraint "extras_objectchange_user_id_7fdf8186_fk_auth_user_id" for table "core_objectchange" does not exist
I have checked database and the table "core_objectchange" does not exist. Any help to resolve the error and move forward is appreciated. Target is to reach 4.1.11.
Beta Was this translation helpful? Give feedback.
All reactions