Skip to content

augur.tasks.github.events.collect_events: duplicate key value violates unique constraint "issue-insert-unique" #3457

@cdolfi

Description

@cdolfi

I think this error will get solved the same way as #3192

IntegrityError('(psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "issue-insert-unique"\nDETAIL: Key (issue_url)=(https://api.github.com/repos/pulp/pulp-ui/issues/1) already exists.\n')

Stack Trace
Traceback (most recent call last):
  File "/augur/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1938, in _exec_single_context
    self.dialect.do_executemany(
  File "/augur/.venv/lib/python3.11/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 794, in do_executemany
    cursor.executemany(statement, parameters)
psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "issue-insert-unique"
DETAIL:  Key (issue_url)=(https://api.github.com/repos/pulp/pulp-ui/issues/1) already exists.


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

Traceback (most recent call last):
  File "/augur/.venv/lib/python3.11/site-packages/celery/app/trace.py", line 453, in trace_task
    R = retval = fun(*args, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^
  File "/augur/.venv/lib/python3.11/site-packages/celery/app/trace.py", line 736, in __protected_call__
    return self.run(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/augur/augur/tasks/github/events.py", line 46, in collect_events
    collection_strategy.collect(repo_git, key_auth, core_data_last_collected)
  File "/augur/augur/tasks/github/events.py", line 128, in collect
    self._process_events(events, repo_id)
  File "/augur/augur/tasks/github/events.py", line 167, in _process_events
    update_issue_closed_cntrbs_by_repo_id(repo_id)
  File "/augur/augur/application/db/lib.py", line 555, in update_issue_closed_cntrbs_by_repo_id
    connection.execute(update_stmt, update_data)
  File "/augur/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1416, in execute
    return meth(
           ^^^^^
  File "/augur/.venv/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 516, in _execute_on_connection
    return connection._execute_clauseelement(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/augur/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1639, in _execute_clauseelement
    ret = self._execute_context(
          ^^^^^^^^^^^^^^^^^^^^^^
  File "/augur/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1848, in _execute_context
    return self._exec_single_context(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/augur/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1988, in _exec_single_context
    self._handle_dbapi_exception(
  File "/augur/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2343, in _handle_dbapi_exception
    raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
  File "/augur/.venv/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1938, in _exec_single_context
    self.dialect.do_executemany(
  File "/augur/.venv/lib/python3.11/site-packages/sqlalchemy/dialects/postgresql/psycopg2.py", line 794, in do_executemany
    cursor.executemany(statement, parameters)
sqlalchemy.exc.IntegrityError: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "issue-insert-unique"
DETAIL:  Key (issue_url)=(https://api.github.com/repos/pulp/pulp-ui/issues/1) already exists.

[SQL: 
                UPDATE issues
                SET cntrb_id = %(cntrb_id)s
                WHERE issue_id = %(issue_id)s
                AND repo_id = %(repo_id)s
            ]
[parameters: [{'cntrb_id': UUID('01035995-d400-0000-0000-000000000000'), 'issue_id': 428805, 'repo_id': 27505}, {'cntrb_id': UUID('01035995-d400-0000-0000-000000000000'), 'issue_id': 428816, 'repo_id': 27505}, {'cntrb_id': UUID('0100047d-c300-0000-0000-000000000000'), 'issue_id': 428821, 'repo_id': 27505}, {'cntrb_id': UUID('01035995-d400-0000-0000-000000000000'), 'issue_id': 428823, 'repo_id': 27505}, {'cntrb_id': UUID('0101724c-7f00-0000-0000-000000000000'), 'issue_id': 212279091, 'repo_id': 27505}, {'cntrb_id': UUID('0100046b-cf00-0000-0000-000000000000'), 'issue_id': 212279092, 'repo_id': 27505}, {'cntrb_id': UUID('0100046b-cf00-0000-0000-000000000000'), 'issue_id': 212279102, 'repo_id': 27505}, {'cntrb_id': UUID('01008560-6200-0000-0000-000000000000'), 'issue_id': 212279103, 'repo_id': 27505}  ... displaying 10 of 23 total bound parameter sets ...  {'cntrb_id': UUID('0100046b-cf00-0000-0000-000000000000'), 'issue_id': 239085787, 'repo_id': 27505}, {'cntrb_id': UUID('010058be-8500-0000-0000-000000000000'), 'issue_id': 239085788, 'repo_id': 27505}]]
(Background on this error at: https://sqlalche.me/e/20/gkpj)

https://github.com/pulp/pulp-ui'

Metadata

Metadata

Assignees

Labels

bugDocuments unexpected/wrong/buggy behaviordeployed versionLive problems with deployed versions

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions