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

Handle duplicate assessment_item_ids with a semantic error rather than a 500 #4431

Closed
sentry-io bot opened this issue Feb 8, 2024 · 0 comments · Fixed by #4614
Closed

Handle duplicate assessment_item_ids with a semantic error rather than a 500 #4431

sentry-io bot opened this issue Feb 8, 2024 · 0 comments · Fixed by #4614
Assignees
Labels
bug DEV: backend P1 - important Priority: High impact on UX

Comments

@sentry-io
Copy link

sentry-io bot commented Feb 8, 2024

IntegrityError: duplicate key value violates unique constraint "assessmentitem_unique_keypair_constraint"

Sentry Issue: STUDIO-H5X

UniqueViolation: duplicate key value violates unique constraint "assessmentitem_unique_keypair_constraint"
DETAIL:  Key (assessment_id, contentnode_id)=(7cec5924685552bc854f5e3df69aa65d, d4b9932897d34ac5b140917c6a05f224) 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 "assessmentitem_unique_keypair_constraint"
DETAIL:  Key (assessment_id, contentnode_id)=(7cec5924685552bc854f5e3df69aa65d, d4b9932897d34ac5b140917c6a05f224) already exists.

(15 additional frame(s) were not displayed)
...
  File "contentcuration/views/internal.py", line 298, in api_add_nodes_to_tree
    "root_ids": convert_data_to_nodes(request.user, content_data, parent_id)
  File "contentcuration/views/internal.py", line 666, in convert_data_to_nodes
    create_exercises(user, new_node, node_data["questions"])
  File "contentcuration/views/internal.py", line 797, in create_exercises
    question_obj.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug DEV: backend P1 - important Priority: High impact on UX
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants