Source versions:
- netbox 3.3.10
- netbox_dns 0.15.0
when doing a combined upgrade of netbox to 3.4.1 and netbox_dns to 0.16.0 migrations will fail, as netbox core is trying to index fields in their migration, which will be added later by netbox_dns migration. LEading to a failed migration.
Apply all migrations: admin, auth, circuits, contenttypes, dcim, django_rq, extras, ipam, netbox_dns, nk_netbox_requests, sessions, social_django, taggit, tenancy, users, virtualization, wireless
Running migrations:
Applying extras.0083_search...Reindexing 67 models.
Clearing cached values... 0 entries deleted.
Indexing models
netbox_dns.nameserver... 4 entries cached.
netbox_dns.zone... 170 entries cached.
netbox_dns.record... Traceback (most recent call last):
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedColumn: column netbox_dns_record.ip_address does not exist
LINE 1: ..."disable_ptr", "netbox_dns_record"."description", "netbox_dn...
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/opt/netbox-test/netbox/./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
utility.execute()
File "/opt/netbox-test/venv/lib64/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-test/venv/lib64/python3.9/site-packages/django/core/management/base.py", line 402, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/core/management/base.py", line 448, in execute
output = self.handle(*args, **options)
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/core/management/base.py", line 96, in wrapped
res = handle_func(*args, **kwargs)
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/core/management/commands/migrate.py", line 349, in handle
post_migrate_state = executor.migrate(
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/db/migrations/executor.py", line 135, in migrate
state = self._migrate_all_forwards(
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/db/migrations/executor.py", line 167, in _migrate_all_forwards
state = self.apply_migration(
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/db/migrations/executor.py", line 252, in apply_migration
state = migration.apply(state, schema_editor)
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/db/migrations/migration.py", line 130, in apply
operation.database_forwards(
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/db/migrations/operations/special.py", line 193, in database_forwards
self.code(from_state.apps, schema_editor)
File "/opt/netbox-test/netbox/extras/migrations/0083_search.py", line 13, in reindex
management.call_command('reindex')
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/core/management/__init__.py", line 198, in call_command
return command.execute(*args, **defaults)
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/core/management/base.py", line 448, in execute
output = self.handle(*args, **options)
File "/opt/netbox-test/netbox/extras/management/commands/reindex.py", line 68, in handle
i = search_backend.cache(model.objects.iterator(), remove_existing=False)
File "/opt/netbox-test/netbox/netbox/search/backends.py", line 148, in cache
for instance in instances:
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/db/models/query.py", line 512, in _iterator
yield from iterable
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/db/models/query.py", line 87, in __iter__
results = compiler.execute_sql(
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/db/models/sql/compiler.py", line 1398, in execute_sql
cursor.execute(sql, params)
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/db/utils.py", line 91, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/opt/netbox-test/venv/lib64/python3.9/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: column netbox_dns_record.ip_address does not exist
LINE 1: ..."disable_ptr", "netbox_dns_record"."description", "netbox_dn...
^