Resolving Unique Constraint Violation in Phoenix Container Logs
RunLLM We're seeing this error in phoenix container logs
2025-01-15T16:40:04.8402960Z raise translated_error from error
2025-01-15T16:40:04.8403021Z sqlalchemy.exc.IntegrityError: (sqlalchemy.dialects.postgresql.asyncpg.IntegrityError) <class 'asyncpg.exceptions.UniqueViolationError'>: duplicate key value violates unique constraint "uq_traces_trace_id"
2025-01-15T16:40:04.8403066Z DETAIL: Key (trace_id)=(3130227716884e2bb0ad47f76f9ecf1e) already exists.
2025-01-15T16:40:04.8403122Z [SQL: INSERT INTO traces (project_rowid, trace_id, start_time, end_time) VALUES ($1::INTEGER, $2::VARCHAR, $3::TIMESTAMP WITH TIME ZONE, $4::TIMESTAMP WITH TIME ZONE) RETURNING traces.id]
2025-01-15T16:40:04.8403174Z [parameters: (1, '3130227716884e2bb0ad47f76f9ecf1e', datetime.datetime(2025, 1, 15, 16, 40, 4, 733228, tzinfo=datetime.timezone.utc), datetime.datetime(2025, 1, 15, 16, 40, 4, 742625, tzinfo=datetime.timezone.utc))]
Content/appsvctmp/volatile/logs/runtime/container.2.log
2025-01-15T09:53:21.2386183Z raise translated_error from error
2025-01-15T09:53:21.2386243Z sqlalchemy.dialects.postgresql.asyncpg.AsyncAdapt_asyncpg_dbapi.IntegrityError: <class 'asyncpg.exceptions.UniqueViolationError'>: duplicate key value violates unique constraint "uq_traces_trace_id"
2025-01-15T09:53:21.2386280Z DETAIL: Key (trace_id)=(2a37078bf25b429e8d8764d4a2063ea7) already exists.
2025-01-15T09:53:21.2386304Z
2025-01-15T09:53:21.2386335Z The above exception was the direct cause of the following exception:
2025-01-15T09:53:21.2386358Z
2025-01-15T09:53:21.2386384Z Traceback (most recent call last):
2025-01-15T09:53:21.2386416Z File "/phoenix/env/phoenix/db/bulk_inserter.py", line 190, in _insert_spans
2025-01-15T09:53:21.2386443Z result = await insert_span(session, span, project_name)
2025-01-15T09:53:21.2386471Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^/appsvctmp/volatile/logs/runtime/container.log
2025-01-15T18:47:33.8171192Z self._handle_exception(error)
2025-01-15T18:47:33.8171234Z File "/phoenix/env/sqlalchemy/dialects/postgresql/asyncpg.py", line 497, in _handle_exception
2025-01-15T18:47:33.8171269Z self._adapt_connection._handle_exception(error)
2025-01-15T18:47:33.8171309Z File "/phoenix/env/sqlalchemy/dialects/postgresql/asyncpg.py", line 780, in _handle_exception
2025-01-15T18:47:33.8171349Z raise translated_error from error
2025-01-15T18:47:33.8171424Z sqlalchemy.exc.IntegrityError: (sqlalchemy.dialects.postgresql.asyncpg.IntegrityError) <class 'asyncpg.exceptions.UniqueViolationError'>: duplicate key value violates unique constraint "uq_traces_trace_id"
2025-01-15T18:47:33.8171469Z DETAIL: Key (trace_id)=(67bc09a02c26cdb1f18bc7aa53fa261c) already exists.
2025-01-15T18:47:33.8171518Z [SQL: INSERT INTO traces (project_rowid, trace_id, start_time, end_time) VALUES ($1::INTEGER, $2::VARCHAR, $3::TIMESTAMP WITH TIME ZONE, $4::TIMESTAMP WITH TIME ZONE) RETURNING traces.id]
2025-01-15T18:47:33.8171577Z [parameters: (65116, '67bc09a02c26cdb1f18bc7aa53fa261c', datetime.datetime(2025, 1, 15, 18, 47, 31, 666405, tzinfo=datetime.timezone.utc), datetime.datetime(2025, 1, 15, 18, 47, 31, 738636, tzinfo=datetime.timezone.utc))]
2025-01-15T18:47:33.8171620Z (Background on this error at: https://sqlalche.me/e/20/gkpj)Ending Log Tail of existing logs ---Starting Live Log Stream ---
What steps should i take?
