Netbox update failing from v3.7.3 #18766
Unanswered
xonacs
asked this question in
Help Wanted!
Replies: 1 comment 11 replies
-
Have you tried upgrading in smaller, incremental steps? I’d recommend first upgrading to the latest NetBox 3.7 release (3.7.8), then moving to 4.0.11, and so on. This way, you can either complete the upgrade smoothly or pinpoint where the issue occurs. Also, just for reference: Python 3.12 isn’t supported in NetBox 3.7, as its Django version only supports Python 3.8 to 3.11. That might be contributing to the problem. Let me know how it goes! |
Beta Was this translation helpful? Give feedback.
11 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.
Uh oh!
There was an error while loading. Please reload this page.
-
Deployment Type
Self-hosted
NetBox Version
v3.7.3
Python Version
3.12
Steps to Reproduce
I have a properly working version of Netbox v3.7.3. Postgres version 13.20, Oracle Linux 8.10, Python 3.12.
`
[root@ro-netbox-srv01 netbox]# git checkout v4.2.4
Note: switching to 'v4.2.4'.
HEAD is now at c4304d0 Merge pull request #18703 from netbox-community/release-v4.2.4
[root@ro-netbox-srv01 netbox]# ./upgrade.sh
You are installing (or upgrading to) NetBox version 4.2.4
Using Python 3.12.8
Removing old virtual environment...
Applying users.0005_alter_user_table... OK
Applying users.0006_custom_group_model... OK
Applying users.0007_objectpermission_update_object_types... OK
Applying users.0008_flip_objectpermission_assignments...Traceback (most recent call last):
File "/opt/netbox/venv/lib64/python3.12/site-packages/django/db/backends/utils.py", line 103, in _execute
return self.cursor.execute(sql)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib64/python3.12/site-packages/psycopg/cursor.py", line 97, in execute
raise ex.with_traceback(None)
psycopg.errors.UndefinedObject: constraint "users_objectpermission_users_user_id_16c0905d_fk_auth_user_id" for table "users_user_object_permissions" does not exist
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
execute_from_command_line(sys.argv)
File "/opt/netbox/venv/lib64/python3.12/site-packages/django/core/management/init.py", line 442, in execute_from_command_line
utility.execute()
File "/opt/netbox/venv/lib64/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/venv/lib64/python3.12/site-packages/django/core/management/base.py", line 413, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/netbox/venv/lib64/python3.12/site-packages/django/core/management/base.py", line 459, in execute
output = self.handle(*args, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib64/python3.12/site-packages/django/core/management/base.py", line 107, in wrapper
res = handle_func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib64/python3.12/site-packages/django/core/management/commands/migrate.py", line 357, in handle
post_migrate_state = executor.migrate(
^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib64/python3.12/site-packages/django/db/migrations/executor.py", line 135, in migrate
state = self._migrate_all_forwards(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib64/python3.12/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
state = self.apply_migration(
^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib64/python3.12/site-packages/django/db/migrations/executor.py", line 255, in apply_migration
state = migration.apply(state, schema_editor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib64/python3.12/site-packages/django/db/migrations/migration.py", line 132, in apply
operation.database_forwards(
File "/opt/netbox/venv/lib64/python3.12/site-packages/django/db/migrations/operations/special.py", line 38, in database_forwards
database_operation.database_forwards(
File "/opt/netbox/venv/lib64/python3.12/site-packages/django/db/migrations/operations/special.py", line 108, in database_forwards
self._run_sql(schema_editor, self.sql)
File "/opt/netbox/venv/lib64/python3.12/site-packages/django/db/migrations/operations/special.py", line 135, in _run_sql
schema_editor.execute(statement, params=None)
File "/opt/netbox/venv/lib64/python3.12/site-packages/django/db/backends/postgresql/schema.py", line 45, in execute
return super().execute(sql, params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib64/python3.12/site-packages/django/db/backends/base/schema.py", line 202, in execute
cursor.execute(sql, params)
File "/opt/netbox/venv/lib64/python3.12/site-packages/django/db/backends/utils.py", line 79, in execute
return self._execute_with_wrappers(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib64/python3.12/site-packages/django/db/backends/utils.py", line 92, in _execute_with_wrappers
return executor(sql, params, many, context)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib64/python3.12/site-packages/django/db/backends/utils.py", line 100, in _execute
with self.db.wrap_database_errors:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib64/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/venv/lib64/python3.12/site-packages/django/db/backends/utils.py", line 103, in _execute
return self.cursor.execute(sql)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib64/python3.12/site-packages/psycopg/cursor.py", line 97, in execute
raise ex.with_traceback(None)
django.db.utils.ProgrammingError: constraint "users_objectpermission_users_user_id_16c0905d_fk_auth_user_id" for table "users_user_object_permissions" does not exist
[root@ro-netbox-srv01 netbox]#
`
Beta Was this translation helpful? Give feedback.
All reactions