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: The row in table 'content_file' with primary key 'c91d3060ca084219ac8eb8eca9d1389c' has an invali... #2

Open
sentry-io bot opened this issue Jun 13, 2023 · 2 comments
Assignees

Comments

@sentry-io
Copy link

sentry-io bot commented Jun 13, 2023

This is related to the persistence of content databases with very old schemas for Sikana (ZH) and CK-12 (ES). They cannot be simply republished, because the channels have been significantly updated in Studio since the last publish, so we need to evaluate if doing the republish is appropriate.

Sentry Issue: STUDIO-GCV

OperationalError: no such table: content_localfile
  File "django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "django/db/backends/sqlite3/base.py", line 423, in execute
    return Database.Cursor.execute(self, query, params)

OperationalError: no such table: content_localfile
(9 additional frame(s) were not displayed)
...
  File "django/db/backends/utils.py", line 75, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  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 "django/db/backends/sqlite3/base.py", line 423, in execute
    return Database.Cursor.execute(self, query, params)

IntegrityError: The row in table 'content_file' with primary key 'c91d3060ca084219ac8eb8eca9d1389c' has an invalid foreign key: content_file.local_file_id contains a value 'local_file_id' that does not have a corresponding value in content_localfile.id.
(6 additional frame(s) were not displayed)
...
  File "kolibri_public/management/commands/export_channels_to_kolibri_public.py", line 77, in handle
    self._export_channel(channel_id)
  File "kolibri_public/management/commands/export_channels_to_kolibri_public.py", line 63, in _export_channel
    call_command("migrate", app_label=KolibriContentConfig.label, database=get_active_content_database())

Failed to export channel 6583e111dac85239bb533f26fae6860d to kolibri_public because of error: The row in table 'content_file' with primary key 'c91d3060ca084219ac8eb8eca9d1389c' has an invalid foreign key: content_file.local_file_id contains a value 'local_file_id' that does not have a corresponding value in content_localfile.id.
@bjester
Copy link
Member

bjester commented Jun 13, 2023

This occurred while manually running export_channels_to_kolibri_public.py in the hotfixes server environment

@bjester bjester assigned bjester and rtibbles and unassigned bjester Jun 14, 2023
@bjester
Copy link
Member

bjester commented Jul 5, 2023

Noting this affects 2 channels, which are fairly old. We need to re-publish them, but they have unpublished changes since the last publish, so we need to evaluate them in order to proceed.

@rtibbles rtibbles transferred this issue from learningequality/studio Aug 31, 2023
@marcellamaki marcellamaki added this to the Kolibri Library: Q2 2024 milestone Jul 30, 2024
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

No branches or pull requests

3 participants