Replies: 2 comments
-
Had the same error while transferring my 3.7.6 database to a new 4.4.0 install. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi all, I was able to reproduce this error when running migrations directly from NetBox 3.7.8 to 4.4.0. This does appear to be a bug in the migration path, even though a direct upgrade should be supported. I’ve opened issue #20290 - Upgrade from v3.7.8 to v4.4.0 fails on migration Thanks for raising it. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
errors when upgrading. please help point me in the right direction!
Running migrations:
Applying users.0005_alter_user_table...Traceback (most recent call last):
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 105, in _execute
return self.cursor.execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/psycopg/cursor.py", line 97, in execute
raise ex.with_traceback(None)
psycopg.errors.UndefinedTable: relation "core_objecttype" does not exist
LINE 1: ...type"."public", "core_objecttype"."features" FROM "core_obje...
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/netbox-4.4.0/netbox/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/core/management/init.py", line 442, in execute_from_command_line
utility.execute()
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/core/management/init.py", line 436, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/core/management/base.py", line 416, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/core/management/base.py", line 460, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/core/management/base.py", line 107, in wrapper
res = handle_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/core/management/commands/migrate.py", line 353, in handle
post_migrate_state = executor.migrate(
^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/db/migrations/executor.py", line 135, in migrate
state = self._migrate_all_forwards(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
state = self.apply_migration(
^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/db/migrations/executor.py", line 255, in apply_migration
state = migration.apply(state, schema_editor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/db/migrations/migration.py", line 132, in apply
operation.database_forwards(
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/db/migrations/operations/special.py", line 196, in database_forwards
self.code(from_state.apps, schema_editor)
File "/opt/netbox-4.4.0/netbox/users/migrations/0005_alter_user_table.py", line 22, in update_content_types
netboxuser_ct.delete()
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/db/models/base.py", line 1281, in delete
return collector.delete()
^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/db/models/deletion.py", line 458, in delete
signals.pre_delete.send(
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/dispatch/dispatcher.py", line 189, in send
response = receiver(signal=self, sender=sender, **named)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.4.0/netbox/extras/signals.py", line 152, in notify_object_changed
if not has_feature(instance, 'notifications'):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.4.0/netbox/netbox/models/features.py", line 682, in has_feature
ot = ObjectType.objects.get_for_model(model_or_ct)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.4.0/netbox/core/models/object_types.py", line 75, in get_for_model
ot = self.get(app_label=opts.app_label, model=opts.model_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/db/models/manager.py", line 87, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/db/models/query.py", line 629, in get
num = len(clone)
^^^^^^^^^^
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/db/models/query.py", line 366, in len
self._fetch_all()
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/db/models/query.py", line 1949, in _fetch_all
self._result_cache = list(self._iterable_class(self))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/db/models/query.py", line 91, in iter
results = compiler.execute_sql(
^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/db/models/sql/compiler.py", line 1623, in execute_sql
cursor.execute(sql, params)
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 79, in execute
return self._execute_with_wrappers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 92, in _execute_with_wrappers
return executor(sql, params, many, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 100, in _execute
with self.db.wrap_database_errors:
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/db/utils.py", line 91, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 105, in _execute
return self.cursor.execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox-4.4.0/venv/lib/python3.12/site-packages/psycopg/cursor.py", line 97, in execute
raise ex.with_traceback(None)
django.db.utils.ProgrammingError: relation "core_objecttype" does not exist
LINE 1: ...type"."public", "core_objecttype"."features" FROM "core_obje...
Beta Was this translation helpful? Give feedback.
All reactions