question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'Server 500' response when trying to view any of the H5P content

See original GitHub issue

Observed behavior

Server 500 response within the content viewport when trying to view any H5P content imported from H5P Samples channel.

image

Expected behavior

H5P interactive content should have loaded correctly.

User-facing consequences

Can’t use the content.

Errors and logs

Logs herein - kolibri.txt

Steps to reproduce

  1. Enable h5p_viewer plugin
  2. Restart Kolibri
  3. Import content from H5P Samples channel
  4. Navigate in Learn to view content

Context

Firefox on Windows 10.

Some information from Device - Info:

OS:                Windows-8-6.2.9200 
Python:            3.4.3
Installer:         Windows
Server:            Kolibri internal server

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
rtibblescommented, May 27, 2020

I can fix 2, if you guys can tackle 1.

1reaction
cpauyacommented, May 27, 2020

For reference, here’s the last few lines of the kolibri.txt log file attached by @intelliant01 above:

INFO 2020-04-28 08:06:44,128 cherrypy.access.115203152 127.0.0.1 - - "GET /static/kolibri.plugins.h5p_viewer.main/kolibri.plugins.h5p_viewer.main-0.13.2.js HTTP/1.1" 200 5730 "http://127.0.0.1:8080/en/learn/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0"
ERROR 2020-04-28 08:06:44,171 exception Internal Server Error: /zipcontent/dda40b9ee291ef85d0911ccba551aba4.h5p/
Traceback (most recent call last):
  File "C:\Python34\lib\site-packages\kolibri\dist\django\core\handlers\exception.py", line 41, in inner
    response = get_response(request)
  File "C:\Python34\lib\site-packages\kolibri\dist\django\core\handlers\base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "C:\Python34\lib\site-packages\kolibri\dist\django\core\handlers\base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "C:\Python34\lib\site-packages\kolibri\dist\django\views\generic\base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "C:\Python34\lib\site-packages\kolibri\dist\django\views\generic\base.py", line 88, in dispatch
    return handler(request, *args, **kwargs)
  File "C:\Python34\lib\site-packages\kolibri\dist\django\utils\decorators.py", line 67, in _wrapper
    return bound_func(*args, **kwargs)
  File "C:\Python34\lib\site-packages\kolibri\dist\django\views\decorators\http.py", line 99, in inner
    response = func(request, *args, **kwargs)
  File "C:\Python34\lib\site-packages\kolibri\dist\django\utils\decorators.py", line 63, in bound_func
    return func.__get__(self, type(self))(*args2, **kwargs2)
  File "C:\Python34\lib\site-packages\kolibri\core\content\api.py", line 75, in wrapper_func
    response = some_func(*args, **kwargs)
  File "C:\Python34\lib\site-packages\kolibri\dist\django\views\decorators\clickjacking.py", line 58, in wrapped_view
    resp = view_func(*args, **kwargs)
  File "C:\Python34\lib\site-packages\kolibri\core\content\decorators.py", line 14, in wrapper_func
    response = some_func(request, *args, **kwargs)
  File "C:\Python34\lib\site-packages\kolibri\core\content\views.py", line 269, in get
    response = get_h5p(zf, embedded_filepath)
  File "C:\Python34\lib\site-packages\kolibri\core\content\views.py", line 151, in get_h5p
    h5pdata = json.loads(zf.open(zf.getinfo("h5p.json")).read())
  File "C:\Python34\lib\json\__init__.py", line 312, in loads
    s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'

This has the same exception to this issue: https://github.com/learningequality/kolibri/issues/6615 - I’m not sure if they are related or the same @indirectlylit.

@mrpau-richard You may be right that upgrading to Python 3.6 fixes the issue. The Python 3.6 release notes mentions json improvements very similar to this issue.

I reproduced this in Windows 7, Upgrading the Python version from 3.4 to 3.6 will fix the issue on Windows.

Please note however that we had an issue using Kolibri on Windows 10 with Python 3.6 last year: https://github.com/learningequality/kolibri/issues/5733

I see two approaches to this:

  1. Test if upgrading to Python 3.6 indeed fixes this issue (and the other one too) and make a PR for such. We hope to enter beta testing soon so we can thoroughly test this “upgrade fix” too.
  2. Fix the underlying code as @rtibbles suggested.

Or we can do both 😺

Read more comments on GitHub >

github_iconTop Results From Across the Web

Internal Server Error (500) when loading Course Presentation
Hi,. I tried to upload content from https://h5p.org/node/1135617 as h5p-file to a wordPress site and i got the following error code:.
Read more >
500 Error Trying to Access H5P Libraries in Moodle
Hi Allen, the first thing I would check is if your moodle data folder and the hvp plugin folder has read and write...
Read more >
Unable to interpret response error when upload h5p file to ...
Hi there, The attached image showed the error message "(500) Unable to interpret response" that I ran into when uploading a h5p file...
Read more >
Internal Server Error 500 during node creation with H5P content | H5P
I have Drupal 8 standart installation with H5P field inside one of the drupal content type(For examp. Basic). When I'm trying to add...
Read more >
Internal Server Error (500) - H5P
This error points to possible server error may it be communication with it or its database or it could be another plugin that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found