Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IntegrityError: duplicate key value violates unique constraint "hint_hintuse_hint_id_team_id_a08fcf36_uniq" #195

Open
sentry-io bot opened this issue Oct 9, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@sentry-io
Copy link

sentry-io bot commented Oct 9, 2021

Sentry Issue: BACKEND-31

UniqueViolation: duplicate key value violates unique constraint "hint_hintuse_hint_id_team_id_a08fcf36_uniq"
DETAIL:  Key (hint_id, team_id)=(4, 224) already exists.

  File "django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "newrelic/hooks/database_psycopg2.py", line 64, in execute
    return super(CursorWrapper, self).execute(sql, parameters, *args,
  File "newrelic/hooks/database_dbapi2.py", line 38, in execute
    return self.__wrapped__.execute(sql, parameters,
  File "django_prometheus/db/common.py", line 71, in execute
    return super().execute(*args, **kwargs)

IntegrityError: duplicate key value violates unique constraint "hint_hintuse_hint_id_team_id_a08fcf36_uniq"
DETAIL:  Key (hint_id, team_id)=(4, 224) already exists.

(26 additional frame(s) were not displayed)
...
  File "django/db/utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "newrelic/hooks/database_psycopg2.py", line 64, in execute
    return super(CursorWrapper, self).execute(sql, parameters, *args,
  File "newrelic/hooks/database_dbapi2.py", line 38, in execute
    return self.__wrapped__.execute(sql, parameters,
  File "django_prometheus/db/common.py", line 71, in execute
    return super().execute(*args, **kwargs)
@jchristgit
Copy link
Collaborator

This is the case where a team has already used a specific hint, right? How would using a hint twice work? Maybe this is ap problem in the frontend?

@0xAda
Copy link
Contributor

0xAda commented Oct 9, 2021 via email

@jchristgit
Copy link
Collaborator

jchristgit commented Oct 9, 2021

Thanks, Ada.

@Bentechy66 could you confirm whether this is a frontend issue? Or should we handle this in backend?

@0xAda
Copy link
Contributor

0xAda commented Oct 9, 2021

we probably do need to send a websocket notification when someone uses a hint if we dont already, and it probably should be a 4xx error rather than stacktracing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants