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

Update content request handling to not use just any reserved location #12876

Closed
bjester opened this issue Nov 22, 2024 · 0 comments · Fixed by #12881
Closed

Update content request handling to not use just any reserved location #12876

bjester opened this issue Nov 22, 2024 · 0 comments · Fixed by #12881
Assignees
Labels
DEV: backend Python, databases, networking, filesystem... P0 - critical Priority: Release blocker or regression TAG: tech update / debt Change not visible to user

Comments

@bjester
Copy link
Member

bjester commented Nov 22, 2024

Observed behavior

When a Kolibri has content requests that need processing, it may attempt to download content from KDP, now that KDP is included as a reserved network location, similarly to Studio. Originally, Studio was the only reserved location when the automatic content import feature was released.

[python-devserver] INFO     2024-11-22 10:05:42,385 Attempting connection to: https://kolibridataportal.learningequality.org/
[python-devserver] DEBUG    2024-11-22 10:05:42,387 Starting new HTTPS connection (1): kolibridataportal.learningequality.org:443
[python-devserver] DEBUG    2024-11-22 10:05:42,622 [https://kolibridataportal.learningequality.org:443](https://kolibridataportal.learningequality.org/) "GET /api/public/info/?v=3 HTTP/1.1" 200 None
[python-devserver] ERROR    2024-11-22 10:05:42,623 Server is not running Kolibri or Studio
[python-devserver] Traceback (most recent call last):
[python-devserver]   File "/home/richard/github/kolibri/kolibri/core/content/utils/content_request.py", line 816, in _process_download
[python-devserver]     import_manager = ContentDownloadRequestResourceImportManager(
[python-devserver]   File "/home/richard/github/kolibri/kolibri/core/content/utils/resource_import.py", line 560, in __init__
[python-devserver]     super(ContentDownloadRequestResourceImportManager, self).__init__(
[python-devserver]   File "/home/richard/github/kolibri/kolibri/core/content/utils/resource_import.py", line 390, in __init__
[python-devserver]     self.public = lookup_channel_listing_status(
[python-devserver]   File "/home/richard/github/kolibri/kolibri/core/content/utils/resource_import.py", line 46, in lookup_channel_listing_status
[python-devserver]     client = NetworkClient.build_for_address(baseurl)
[python-devserver]   File "/home/richard/github/kolibri/kolibri/core/discovery/utils/network/client.py", line 83, in build_for_address
[python-devserver]     if client.connect(raise_if_unavailable=False):
[python-devserver]   File "/home/richard/github/kolibri/kolibri/core/discovery/utils/network/client.py", line 218, in connect
[python-devserver]     raise errors.NetworkLocationInvalidResponse(
[python-devserver] kolibri.core.discovery.utils.network.errors.NetworkLocationInvalidResponse: Server is not running Kolibri or Studio

Desired behavior

This check intends to allow Studio to be used for content import. Since that's its intent, we should just make it explicit so it avoids picking up KDP, and only bypasses the connection check if the location represents Studio.

@bjester bjester added TAG: tech update / debt Change not visible to user P0 - critical Priority: Release blocker or regression DEV: backend Python, databases, networking, filesystem... labels Nov 22, 2024
@LianaHarris360 LianaHarris360 self-assigned this Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DEV: backend Python, databases, networking, filesystem... P0 - critical Priority: Release blocker or regression TAG: tech update / debt Change not visible to user
Projects
None yet
2 participants