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: insert or update on table "contentcuration_file" violates foreign key constraint "D3740c2e1920a8e... #3650

Closed
sentry-io bot opened this issue Sep 16, 2022 · 1 comment · Fixed by #3662
Assignees
Labels

Comments

@sentry-io
Copy link

sentry-io bot commented Sep 16, 2022

We should validate file formats before attempting to create a file object with them in the upload_url endpoint.

Sentry Issue: STUDIO-F8K

ForeignKeyViolation: insert or update on table "contentcuration_file" violates foreign key constraint "D3740c2e1920a8e54f999f6f101ff7e7"
DETAIL:  Key (file_format_id)=(pptx) is not present in table "contentcuration_fileformat".

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

IntegrityError: insert or update on table "contentcuration_file" violates foreign key constraint "D3740c2e1920a8e54f999f6f101ff7e7"
DETAIL:  Key (file_format_id)=(pptx) is not present in table "contentcuration_fileformat".

(24 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 65, in execute
    **kwargs)
  File "newrelic/hooks/database_dbapi2.py", line 39, in execute
    *args, **kwargs)
  File "django_prometheus/db/common.py", line 71, in execute
    return super().execute(*args, **kwargs)
@bjester
Copy link
Member

bjester commented Sep 20, 2022

@ozer550 Will take this one, but I'm unable to assign it until he's added to the org

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

Successfully merging a pull request may close this issue.

2 participants