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

Using redis configuration breaks content navigation #11848

Closed
jredrejo opened this issue Feb 8, 2024 · 1 comment
Closed

Using redis configuration breaks content navigation #11848

jredrejo opened this issue Feb 8, 2024 · 1 comment
Assignees
Labels
P0 - critical Priority: Release blocker or regression TAG: regression Something that previously worked

Comments

@jredrejo
Copy link
Member

jredrejo commented Feb 8, 2024

Overview

When redis is set to cache resources in kolibri 0.16 beta, navigation gets messy: every time a resource is feched it produces a server error.

Description and outcomes

This is the kind of error that is seen when a resource is accesed for the very first time. After refreshing the page the endpoint response is correct.

ERROR    2024-02-08 18:42:01,269 Internal Server Error: /api/content/contentnode/8036442b7dde5b34b88c0e52b385c1bf/
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/utils/deprecation.py", line 142, in __call__
    response = self.process_response(request, response)
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/middleware/security.py", line 40, in process_response
    if self.content_type_nosniff and 'x-content-type-options' not in response:
TypeError: argument of type 'bool' is not iterable
ERROR    2024-02-08 18:42:01,257 Internal Server Error: /api/content/contentnode/
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/utils/deprecation.py", line 142, in __call__
    response = self.process_response(request, response)
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/middleware/security.py", line 40, in process_response
    if self.content_type_nosniff and 'x-content-type-options' not in response:
TypeError: argument of type 'bool' is not iterable

To reproduce it:
edit options.ini file in kolibri and add these lines (supossing a redis server is running):

[Cache]
CACHE_BACKEND = redis
CACHE_REDIS_MAXMEMORY_POLICY = allkeys-lru
CACHE_REDIS_MAXMEMORY = 1660575744

The browsing the library of installed channels or planning a lesson will produce the above errors

Related: This issue is the cause of this report learningequality/pi-gen#16

@jredrejo jredrejo added P0 - critical Priority: Release blocker or regression TAG: regression Something that previously worked labels Feb 8, 2024
@rtibbles rtibbles self-assigned this Feb 8, 2024
@rtibbles
Copy link
Member

rtibbles commented Feb 9, 2024

Fixed in #11849

@rtibbles rtibbles closed this as completed Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 - critical Priority: Release blocker or regression TAG: regression Something that previously worked
Projects
None yet
Development

No branches or pull requests

2 participants