Skip to content

relation "dcim_cabletermination_unique_termination" already exists #260

@jakub-krysl-ipf

Description

@jakub-krysl-ipf

Plugin Version

0.5.5

NetBox Version

4.2.6

Python Version

3.12.3

Steps to Reproduce

  1. Try to provision branch

Expected Behavior

Branch provisioned

Observed Behavior

relation "dcim_cabletermination_unique_termination" already exists

Stack Trace: `Traceback (most recent call last): File "/opt/netbox/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 103, in _execute return self.cursor.execute(sql) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/netbox/venv/lib/python3.12/site-packages/psycopg/cursor.py", line 97, in execute raise ex.with_traceback(None) psycopg.errors.DuplicateTable: relation "dcim_cabletermination_unique_termination" already exists

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/source/ipfabric_netbox/models.py", line 709, in sync
    branch.provision(user=user)
File "/opt/netbox/venv/lib/python3.12/site-packages/netbox_branching/models/branches.py", line 608, in provision
    raise e
File "/opt/netbox/venv/lib/python3.12/site-packages/netbox_branching/models/branches.py", line 591, in provision
    raise e
File "/opt/netbox/venv/lib/python3.12/site-packages/netbox_branching/models/branches.py", line 587, in provision
    cursor.execute(sql)
File "/opt/netbox/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 79, in execute return
    self._execute_with_wrappers( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 92, in _execute_with_wrappers
    return executor(sql, params, many, context) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.12/site-packages/django/db/backends/utils.py", line 100, in _execute with
    self.db.wrap_database_errors:
File "/opt/netbox/venv/lib/python3.12/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.12/site-packages/django/db/backends/utils.py", line 103, in _execute
    return self.cursor.execute(sql) ^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/netbox/venv/lib/python3.12/site-packages/psycopg/cursor.py", line 97, in execute
    raise ex.with_traceback(None)
django.db.utils.ProgrammingError: relation "dcim_cabletermination_unique_termination" already exists
netbox-worker_1  | 2025-05-16T18:23:41.994463876Z DEBUG ALTER INDEX branch_tg0w3gki.dcim_cabletermination_termination_type_id_termination_id_key RENAME TO dcim_cabletermination_unique_termination                
netbox-worker_1  | 2025-05-16T18:23:42.028738399Z ERROR ALTER INDEX branch_tg0w3gki.dcim_cabletermination_termination_type_id_termination_id_idx RENAME TO dcim_cabletermination_unique_termination                
netbox-worker_1  | 2025-05-16T18:23:42.029611384Z ERROR relation "dcim_cabletermination_unique_termination" already exists 

Metadata

Metadata

Assignees

Labels

severity: highCompletely breaks certain functions, or substantially degrades performance application-widestatus: acceptedtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions