Skip to content

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

@sentry

Description

@sentry

@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)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions