learningequality / kolibri

Kolibri Learning Platform: the offline app for universal education
https://learningequality.org/kolibri/
MIT License
759 stars 638 forks source link

500 error when importing facility from different device #12299

Closed marcellamaki closed 1 week ago

marcellamaki commented 2 weeks ago

Observed behavior

For @AlexVelezLl (0.17.0-alpha0 bug bash) during the setup flow, importing from an existing device was not working as expected. image

Errors and logs

ERROR 2024-06-17 10:15:25,356 django.request Internal Server Error: /api/discovery/networklocation_facilities/59ba08844e8484c01d12b5fb54fa4123/
Traceback (most recent call last):
  File "/home/alexvelezll/.pex/installed_wheels/a319987fd510881ad7ed07d04a07b218a83ba205d6621d21a727bbf3d414153d/kolibri-0.17.0a0-py2.py3-none-any.whl/kolibri/dist/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/home/alexvelezll/.pex/installed_wheels/a319987fd510881ad7ed07d04a07b218a83ba205d6621d21a727bbf3d414153d/kolibri-0.17.0a0-py2.py3-none-any.whl/kolibri/dist/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/alexvelezll/.pex/installed_wheels/a319987fd510881ad7ed07d04a07b218a83ba205d6621d21a727bbf3d414153d/kolibri-0.17.0a0-py2.py3-none-any.whl/kolibri/dist/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/alexvelezll/.pex/installed_wheels/a319987fd510881ad7ed07d04a07b218a83ba205d6621d21a727bbf3d414153d/kolibri-0.17.0a0-py2.py3-none-any.whl/kolibri/dist/rest_framework/viewsets.py", line 104, in view
    self = cls(**initkwargs)
  File "/home/alexvelezll/.pex/installed_wheels/a319987fd510881ad7ed07d04a07b218a83ba205d6621d21a727bbf3d414153d/kolibri-0.17.0a0-py2.py3-none-any.whl/kolibri/core/api.py", line 149, in __init__
    raise TypeError("values must be defined as a tuple")
TypeError: values must be defined as a tuple

Expected behavior

User should be able to import from other devices on the network, or be notified properly that there are no devices available

Steps to reproduce/Context

Clean setup on Kolibri

marcellamaki commented 2 weeks ago

@radinamatic @pcenov - can you try to reproduce this across a few other OSes/installers and see if there is any additional details we can add into the issue?

pcenov commented 2 weeks ago

Hi @marcellamaki here is a video of what I am observing:

https://github.com/learningequality/kolibri/assets/79847249/6ea19e99-33ae-4aa1-a3c7-ceaea52894b7

Logs: Ubuntu2ndDevice.zip UbuntuServer.zip

The import is also not working at Device > Facilities.

A note that I reported this issue while testing the following PR: https://github.com/learningequality/kolibri/pull/12165 but I thought that it was caused by the Python changes made there.

Also I am able to replicate the issue on 2 Windows devices as well so it's not OS specific.