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: new row for relation "contentcuration_file" violates check constraint "file_media_duration_int" #4021

Closed
sentry-io bot opened this issue Apr 12, 2023 · 2 comments · Fixed by #4032

Comments

@sentry-io
Copy link

sentry-io bot commented Apr 12, 2023

@bjester: the issue here is that the user is uploading an empty video file (0 duration). To start, we should add some defensive checks to prevent this integrity error, and later add better UX feedback regarding the issue

Sentry Issue: STUDIO-G5Y

CheckViolation: new row for relation "contentcuration_file" violates check constraint "file_media_duration_int"
DETAIL:  Failing row contains (7ffea5cbeba247b2b10d0aede8afd147, e56d2e5e623359a50bfabbdfa6189a32, 25634, storage/e/5/e56d2e5e623359a50bfabbdfa6189a32.mp4, Solución 47.mp4, null, mp4, null, high_res_video, null, null, 28004, null, 2023-04-12 21:50:43.379923+00, 0).

  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: new row for relation "contentcuration_file" violates check constraint "file_media_duration_int"
DETAIL:  Failing row contains (7ffea5cbeba247b2b10d0aede8afd147, e56d2e5e623359a50bfabbdfa6189a32, 25634, storage/e/5/e56d2e5e623359a50bfabbdfa6189a32.mp4, Solución 47.mp4, null, mp4, null, high_res_video, null, null, 28004, null, 2023-04-12 21:50:43.379923+00, 0).

(23 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)
@bjester
Copy link
Member

bjester commented Apr 12, 2023

We need to figure out what to show to the user in this situation, since the file represents a content node being uploaded. This sort of validation piggybacks off a similar situation with HTML5 ZIP files #4013

@bjester
Copy link
Member

bjester commented Apr 12, 2023

To start, we should add some defensive checks to prevent this integrity error, and later add better UX feedback regarding the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants