Skip to content

Do better validation on file payloads #5022

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

Open
sentry-io bot opened this issue Apr 25, 2025 · 0 comments · May be fixed by #5025
Open

Do better validation on file payloads #5022

sentry-io bot opened this issue Apr 25, 2025 · 0 comments · May be fixed by #5025
Assignees

Comments

@sentry-io
Copy link

sentry-io bot commented Apr 25, 2025

IntegrityError: new row for relation "contentcuration_file" violates check constraint "file_media_duration_int"

Sentry Issue: STUDIO-HRQ

CheckViolation: new row for relation "contentcuration_file" violates check constraint "file_media_duration_int"
DETAIL:  Failing row contains (db898e1b5381437fbc8f7d242d606983, 0b57166c9f549fbf4cadd6828d36ecb4, 1574207, storage/0/b/0b57166c9f549fbf4cadd6828d36ecb4.mp3, TLL_Leson 7.2_Mwayen-transpò_Odyo.mp3, 3e164cbf3dac4734898567d7d45dca64, mp3, null, document_thumbnail, null, null, 19, null, 2025-04-24 19:40:57.777972+00, 393).

  File "django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "django_prometheus/db/common.py", line 69, in execute
    return super().execute(*args, **kwargs)

IntegrityError: new row for relation "contentcuration_file" violates check constraint "file_media_duration_int"
DETAIL:  Failing row contains (db898e1b5381437fbc8f7d242d606983, 0b57166c9f549fbf4cadd6828d36ecb4, 1574207, storage/0/b/0b57166c9f549fbf4cadd6828d36ecb4.mp3, TLL_Leson 7.2_Mwayen-transpò_Odyo.mp3, 3e164cbf3dac4734898567d7d45dca64, mp3, null, document_thumbnail, null, null, 19, null, 2025-04-24 19:40:57.777972+00, 393).

(13 additional frame(s) were not displayed)
...
  File "contentcuration/views/internal.py", line 299, in api_add_nodes_to_tree
    "root_ids": convert_data_to_nodes(request.user, content_data, parent_id)
  File "contentcuration/views/internal.py", line 665, in convert_data_to_nodes
    map_files_to_node(user, new_node, node_data["files"])
  File "contentcuration/utils/nodes.py", line 92, in map_files_to_node
    resource_obj.save()
  File "contentcuration/models.py", line 2393, in save
    super(File, self).save(*args, **kwargs)
@rtibbles rtibbles linked a pull request Apr 25, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant