I am trying to upgrade our Netbox from version v2.10.3 to v2.11.4, but I am encountering this error when running the upgrade.sh script:
I figured this was a problem with the cable and deleted the cable to recreate it. Once recreated the upgrade.sh script was able to progress, but it stopped on another cable with the same error. I repeated this process at least 10 times, but I don't know how deep this issue goes.
I didn't see anything in the release notes to suggest this is a known issue with a special procedure. I tried looking at the data in the dcim_cable and dcim_cablepath tables, but I was not able to make sense of what might be wrong.
Does anyone know how I can resolve this issue with the cables or at least identify how many cables need to be recreated?
Please let me know if anyone has any insight into this issue.
Thanks,
Austin
The mostly full traceback is shown below:
[...]
Operations to perform:
Apply all migrations: admin, auth, circuits, contenttypes, dcim, extras, ipam, secrets, sessions, taggit, tenancy, users, virtualization
Running migrations:
No migrations to apply.
Checking for missing cable paths (python3 netbox/manage.py trace_paths --no-input)...
Found no missing console port paths; skipping
Found no missing console server port paths; skipping
Retracing 79 cabled interfaces...
1GE1/1/26 3054
Traceback (most recent call last):
File "/opt/netbox/venv/lib64/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "dcim_cablepath_origin_type_id_origin_id_41b6f814_uniq"
DETAIL: Key (origin_type_id, origin_id)=(5, 3054) already exists.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "netbox/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
[..]
File "/opt/netbox/venv/lib64/python3.8/site-packages/django/db/utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/opt/netbox/venv/lib64/python3.8/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
django.db.utils.IntegrityError: duplicate key value violates unique constraint "dcim_cablepath_origin_type_id_origin_id_41b6f814_uniq"
DETAIL: Key (origin_type_id, origin_id)=(5, 3054) already exists.