Well this was strange, been using NetBox on v2.3.7 for a decent chunk of time. My Dockerfile is based on the ninech repo. I stopped my Docker services, backed up my data, and tried upgrading to v2.4.3, then received the below error. I destroyed all of the v2.4.3 attempt and tried to just start up my data from v2.3.7 to get back to usable and now I get the same error. As far as I can tell this was just a ticking timebomb since I never restarted after upgrading to v2.3.7.
I found the following thread, but figured I'd check with Stretch for any quick fixes before running in circles experimenting.
Creating netbox_postgres_1 ... done
Creating network "netbox_default" with the default driver
Creating netbox_app_1 ... done
Creating netbox_app_1 ...
Creating netbox_nginx_1 ... done
Attaching to netbox_postgres_1, netbox_app_1, netbox_nginx_1
postgres_1 | LOG: database system was shut down at 2018-08-13 14:38:39 UTC
postgres_1 | LOG: MultiXact member wraparound protections are now enabled
postgres_1 | LOG: database system is ready to accept connections
postgres_1 | LOG: autovacuum launcher started
app_1 | Operations to perform:
app_1 | Apply all migrations: admin, auth, circuits, contenttypes, dcim, extras, ipam, secrets, sessions, taggit, tenancy, users, virtualization
app_1 | Running migrations:
app_1 | Applying dcim.0058_relax_rack_naming_constraints...Traceback (most recent call last):
app_1 | File "./manage.py", line 10, in <module>
app_1 | execute_from_command_line(sys.argv)
app_1 | File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
app_1 | utility.execute()
app_1 | File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 365, in execute
app_1 | self.fetch_command(subcommand).run_from_argv(self.argv)
app_1 | File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
app_1 | self.execute(*args, **cmd_options)
app_1 | File "/usr/local/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute
app_1 | output = self.handle(*args, **options)
app_1 | File "/usr/local/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 200, in handle
app_1 | fake_initial=fake_initial,
app_1 | File "/usr/local/lib/python3.6/site-packages/django/db/migrations/executor.py", line 117, in migrate
app_1 | state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
app_1 | File "/usr/local/lib/python3.6/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
app_1 | state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
app_1 | File "/usr/local/lib/python3.6/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
app_1 | state = migration.apply(state, schema_editor)
app_1 | File "/usr/local/lib/python3.6/site-packages/django/db/migrations/migration.py", line 122, in apply
app_1 | operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
app_1 | File "/usr/local/lib/python3.6/site-packages/django/db/migrations/operations/models.py", line 525, in database_forwards
app_1 | getattr(new_model._meta, self.option_name, set()),
app_1 | File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 358, in alter_unique_together
app_1 | self._delete_composed_index(model, fields, {'unique': True}, self.sql_delete_unique)
app_1 | File "/usr/local/lib/python3.6/site-packages/django/db/backends/base/schema.py", line 387, in _delete_composed_index
app_1 | ", ".join(columns),
app_1 | ValueError: Found wrong number (2) of constraints for dcim_rack(site_id, facility_id)
app_1 | ⏳ Waiting on DB...
^CGracefully stopping... (press Ctrl+C again to force)
Stopping netbox_nginx_1 ... done
Stopping netbox_app_1 ... done
Stopping netbox_postgres_1 ... done
Thanks!