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

Kolibri is incompatible with a database cache #9158

Closed
jredrejo opened this issue Mar 2, 2022 · 1 comment
Closed

Kolibri is incompatible with a database cache #9158

jredrejo opened this issue Mar 2, 2022 · 1 comment

Comments

@jredrejo
Copy link
Member

jredrejo commented Mar 2, 2022

Observed behavior

Whenever a kolibri manage... command is executed migrations happen unless --skip-update is used

kolibri manage createcachetable does fail because migrations are run and when they are running they need the table that this command creates.

Errors and logs

From GitHub console:

2022-03-02T16:42:49.4108029Z   Applying device.0002_devicesettings_default_facility... OK
2022-03-02T16:42:49.4464649Z Traceback (most recent call last):
2022-03-02T16:42:49.4473824Z   File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/kolibri/dist/django/db/backends/utils.py", line 62, in execute
2022-03-02T16:42:49.4474365Z     return self.cursor.execute(sql)
2022-03-02T16:42:49.4474759Z psycopg2.errors.UndefinedTable: relation "cache_table" does not exist
2022-03-02T16:42:49.4475128Z LINE 1: SELECT COUNT(*) FROM "cache_table"
2022-03-02T16:42:49.4475381Z                              ^
2022-03-02T16:42:49.4475528Z 
2022-03-02T16:42:49.4475535Z 
2022-03-02T16:42:49.4475723Z The above exception was the direct cause of the following exception:
2022-03-02T16:42:49.4475954Z 
2022-03-02T16:42:49.4476077Z Traceback (most recent call last):
2022-03-02T16:42:49.4476469Z   File "/opt/hostedtoolcache/Python/3.8.12/x64/bin/kolibri", line 8, in <module>
2022-03-02T16:42:49.4476789Z     sys.exit(main())
2022-03-02T16:42:49.4477490Z   File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/kolibri/dist/click/core.py", line 764, in __call__
2022-03-02T16:42:49.4477879Z     return self.main(*args, **kwargs)
2022-03-02T16:42:49.4478465Z   File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/kolibri/dist/click/core.py", line 717, in main
2022-03-02T16:42:49.4478851Z     rv = self.invoke(ctx)
2022-03-02T16:42:49.4479435Z   File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/kolibri/dist/click/core.py", line 1137, in invoke
2022-03-02T16:42:49.4479878Z     return _process_result(sub_ctx.command.invoke(sub_ctx))
2022-03-02T16:42:49.4480493Z   File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/kolibri/utils/cli.py", line 272, in invoke
2022-03-02T16:42:49.4481127Z     initialize()
2022-03-02T16:42:49.4481727Z   File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/kolibri/utils/cli.py", line 369, in initialize
2022-03-02T16:42:49.4482132Z     update(version, kolibri.__version__)
2022-03-02T16:42:49.4482726Z   File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/kolibri/utils/cli.py", line 439, in update
2022-03-02T16:42:49.4483101Z     _migrate_databases()
2022-03-02T16:42:49.4484162Z   File "/opt/hostedtoolcache/Python/3.8.12/x64/lib/python3.8/site-packages/kolibri/utils/cli.py", line 187, in _migrate_databases

Expected behavior

Creating a cache table in the db should be possible just using kolibri manage createcachetable

User-facing consequences

It's not possible to use a db cache if needed (as in KDP where file cache is not an option)

Context

KDP tests in develop (currently using kolibri 0.14.8a4)

@rtibbles
Copy link
Member

Fixed in #9543

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

2 participants