Upgrade from 3.3.7 to 4.4.2 fails;;; #7450

Closed
opened 2025-12-29 20:23:36 +01:00 by adam · 0 comments
Owner

Originally created by @christophenouvel on GitHub (Jan 4, 2023).

NetBox version

v3.4.7

Python version

3.9

Steps to Reproduce

  1. Prepare migration following https://docs.netbox.dev/en/stable/installation/upgrading/ as usual.
    Today from 3.3.7 to 4.4.2

  2. run upgrade.sh

Expected Behavior

upgrade.sh returns no error.

Observed Behavior

Migration error :

Running migrations:
Applying virtualization.0033_unique_constraints...Traceback (most recent call last):
File "/opt/netbox-3.4.2/netbox/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/core/management/init.py", line 446, in execute_from_command_line
utility.execute()
File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/core/management/init.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/core/management/base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/core/management/base.py", line 448, in execute
output = self.handle(*args, **options)
File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/core/management/base.py", line 96, in wrapped
res = handle_func(*args, **kwargs)
File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/core/management/commands/migrate.py", line 349, in handle
post_migrate_state = executor.migrate(
File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/db/migrations/executor.py", line 135, in migrate
state = self._migrate_all_forwards(
File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
state = self.apply_migration(
File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/db/migrations/executor.py", line 252, in apply_migration
state = migration.apply(state, schema_editor)
File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/db/migrations/migration.py", line 130, in apply
operation.database_forwards(
File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/db/migrations/operations/models.py", line 564, in database_forwards
alter_together(
File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/db/backends/base/schema.py", line 533, in alter_unique_together
self._delete_composed_index(
File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/db/backends/base/schema.py", line 589, in _delete_composed_index
raise ValueError(
ValueError: Found wrong number (0) of constraints for virtualization_vminterface(virtual_machine_id, name)

Note :

  • upgrade from 3.3.7 to 3.3.10 works as expected.
  • upgrade from 3.3.7 to 4.4.0 fails with same error.
  • upgrade from 3.3.10 to 4.4.0 fails with same error.
Originally created by @christophenouvel on GitHub (Jan 4, 2023). ### NetBox version v3.4.7 ### Python version 3.9 ### Steps to Reproduce 1. Prepare migration following https://docs.netbox.dev/en/stable/installation/upgrading/ as usual. Today from 3.3.7 to 4.4.2 2. run upgrade.sh ### Expected Behavior upgrade.sh returns no error. ### Observed Behavior Migration error : Running migrations: Applying virtualization.0033_unique_constraints...Traceback (most recent call last): File "/opt/netbox-3.4.2/netbox/manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line utility.execute() File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 440, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/core/management/base.py", line 402, in run_from_argv self.execute(*args, **cmd_options) File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/core/management/base.py", line 448, in execute output = self.handle(*args, **options) File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/core/management/base.py", line 96, in wrapped res = handle_func(*args, **kwargs) File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/core/management/commands/migrate.py", line 349, in handle post_migrate_state = executor.migrate( File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/db/migrations/executor.py", line 135, in migrate state = self._migrate_all_forwards( File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards state = self.apply_migration( File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/db/migrations/executor.py", line 252, in apply_migration state = migration.apply(state, schema_editor) File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/db/migrations/migration.py", line 130, in apply operation.database_forwards( File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/db/migrations/operations/models.py", line 564, in database_forwards alter_together( File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/db/backends/base/schema.py", line 533, in alter_unique_together self._delete_composed_index( File "/opt/netbox-3.4.2/venv/lib/python3.9/site-packages/django/db/backends/base/schema.py", line 589, in _delete_composed_index raise ValueError( ValueError: Found wrong number (0) of constraints for virtualization_vminterface(virtual_machine_id, name) Note : - upgrade from 3.3.7 to 3.3.10 works as expected. - upgrade from 3.3.7 to 4.4.0 fails with same error. - upgrade from 3.3.10 to 4.4.0 fails with same error.
adam closed this issue 2025-12-29 20:23:36 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7450