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

Integrity Error for SyncQueue #12194

Closed
rtibbles opened this issue May 22, 2024 · 1 comment
Closed

Integrity Error for SyncQueue #12194

rtibbles opened this issue May 22, 2024 · 1 comment
Assignees

Comments

@rtibbles
Copy link
Member

rtibbles commented May 22, 2024

Observed behavior

An integrity error in the syncqueue table is preventing Kolibri from starting

Errors and logs

Operations to perform:
Apply all migrations: admin, analytics, auth, bookmarks, content, contenttypes, device, discovery,
exams, kolibriauth, lessons, logger, morango, notifications, sessions
Running migrations:
No migrations to apply.
Operations to perform:
Apply all migrations: admin, analytics, auth, bookmarks, content, contenttypes, device, discovery,
exams, kolibriauth, lessons, logger, morango, notifications, sessions
Running migrations:
Applying device.0019_syncqueue_and_status...Error: Traceback (most recent call last):
File "c:\python36\lib\site-packages\kolibri\dist\django\db\backends\utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "c:\python36\lib\site-packages\kolibri\dist\django\db\backends\sqlite3\base.py", line 328, in execute
return Database.Cursor.execute(self, query, params)
sqlite3.IntegrityError: UNIQUE constraint failed: device_syncqueue.user_id,
device_syncqueue.instance_id

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "c:\python36\lib\site-packages\kolibri\utils\cli.py", line 193, in invoke
initialize(**get_initialize_params())
File "c:\python36\lib\site-packages\kolibri\utils\main.py", line 311, in initialize
update(version, kolibri.__version__)
File "c:\python36\lib\site-packages\kolibri\utils\main.py", line 365, in update
_migrate_databases()
File "c:\python36\lib\site-packages\kolibri\utils\main.py", line 113, in _migrate_databases
call_command("migrate", interactive=False, database=database)
File "c:\python36\lib\site-packages\kolibri\dist\django\core\management\__init__.py", line 131, in
call_command
return command.execute(*args, **defaults)
File "c:\python36\lib\site-packages\kolibri\dist\django\core\management\base.py", line 330, in execute
output = self.handle(*args, **options)
File "c:\python36\lib\site-packages\kolibri\dist\django\core\management\commands\migrate.py", line
204, in handle
fake_initial=fake_initial,
File "c:\python36\lib\site-packages\kolibri\dist\django\db\migrations\executor.py", line 115, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
File "c:\python36\lib\site-packages\kolibri\dist\django\db\migrations\executor.py", line 145, in
_migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "c:\python36\lib\site-packages\kolibri\dist\django\db\migrations\executor.py", line 244, in
apply_migration
state = migration.apply(state, schema_editor)
File "c:\python36\lib\site-packages\kolibri\dist\django\db\migrations\migration.py", line 129, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File "c:\python36\lib\site-packages\kolibri\dist\django\db\migrations\operations\models.py", line 536, in
database_forwards
getattr(new_model._meta, self.option_name, set()),
File "c:\python36\lib\site-packages\kolibri\dist\django\db\backends\base\schema.py", line 369, in
alter_unique_together
self.execute(self._create_unique_sql(model, columns))
File "c:\python36\lib\site-packages\kolibri\dist\django\db\backends\base\schema.py", line 136, in
execute
cursor.execute(sql, params)
File "c:\python36\lib\site-packages\kolibri\dist\django\db\backends\utils.py", line 64, in execute

return self.cursor.execute(sql, params)
File "c:\python36\lib\site-packages\kolibri\dist\django\db\utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "c:\python36\lib\site-packages\kolibri\dist\django\utils\six.py", line 685, in reraise
raise value.with_traceback(tb)
File "c:\python36\lib\site-packages\kolibri\dist\django\db\backends\utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "c:\python36\lib\site-packages\kolibri\dist\django\db\backends\sqlite3\base.py", line 328, in execute
return Database.Cursor.execute(self, query, params)
django.db.utils.IntegrityError: UNIQUE constraint failed: device_syncqueue.user_id,
device_syncqueue.instance_id```

Expected behavior

Kolibri should start regardless!

User-facing consequences

Utter breakage of Kolibri.

Steps to reproduce

Unclear.

Context

Kolibri 0.16.1

@rtibbles
Copy link
Member Author

Fixed in #12197

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

1 participant