Upgrading from Release to Release Via Docker #1192
Replies: 1 comment 1 reply
-
To add additional information; we were at 3.1.1 release moved to the next release then next but eventually we would run into similar error as about in which it appears the migrate.py upgrade startup script attempts to create tables that already exist causing it to loop until we stop it. In reviewing the documentation of upgrading each release we read the release notes to include the specialist netbox 3.2 upgrade custom scripts which we executed. We didnt have any ASN date but the site information was corrected accordingly. We would greatly appreciate any pointers and links to a process we may have overlooked in our hast to get to the latest release. Appreciate your time |
Beta Was this translation helpful? Give feedback.
-
Current Behavior
We have been attempting to update our Netbox docker container and have been going release by release. Though we continue to run into issues after importing the data from the previous versions. We have followed the database backup procedures and restore procedure and they run fine, but when we start the container up we get following errors as below:
Operations to perform:
Apply all migrations: admin, auth, circuits, contenttypes, dcim, django_rq, extras, ipam, sessions, social_django, taggit, tenancy, users, virtualization, wireless
Running migrations:
Traceback (most recent call last):
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.DuplicateColumn: column "status" of relation "dcim_location" already exists
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/lib/python3.10/site-packages/django/core/management/init.py", line 446, in execute_from_command_line
utility.execute()
File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/init.py", line 440, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/base.py", line 414, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/base.py", line 460, in execute
output = self.handle(*args, **options)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/base.py", line 98, in wrapped
res = handle_func(*args, **kwargs)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/core/management/commands/migrate.py", line 290, in handle
post_migrate_state = executor.migrate(
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/executor.py", line 131, in migrate
state = self._migrate_all_forwards(
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/executor.py", line 163, in _migrate_all_forwards
state = self.apply_migration(
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/executor.py", line 248, in apply_migration
state = migration.apply(state, schema_editor)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/migration.py", line 131, in apply
operation.database_forwards(
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/migrations/operations/fields.py", line 108, in database_forwards
schema_editor.add_field(
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/backends/base/schema.py", line 641, in add_field
self.execute(sql, params)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/backends/base/schema.py", line 192, in execute
cursor.execute(sql, params)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 67, in execute
return self._execute_with_wrappers(
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 84, in _execute
with self.db.wrap_database_errors:
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/utils.py", line 91, in exit
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/opt/netbox/venv/lib/python3.10/site-packages/django/db/backends/utils.py", line 89, in _execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: column "status" of relation "dcim_location" already exists
Expected Behavior
Expect upon starting the NetBox container after importing the backup data that upgrade completes on the data without error. Hate to go through pgadmin to manually remote tables/columns to get past the errors.
Docker Compose Version
Docker Compose version v2.18.1
Docker Version
The git Revision
git version 2.39.2
The git Status
Startup Command
docker compose up -d
NetBox Logs
Content of docker-compose.override.yml
Beta Was this translation helpful? Give feedback.
All reactions