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

Spanish KA exercise does not render #8358

Closed
tim-moody opened this issue Mar 24, 2020 · 23 comments · Fixed by #8366
Closed

Spanish KA exercise does not render #8358

tim-moody opened this issue Mar 24, 2020 · 23 comments · Fixed by #8366

Comments

@tim-moody
Copy link

Observed behavior

Khan Academy (Español)Matemáticas3.er gradoSumas y restasSumar números del 1 al 1000 con reagrupación

image

Expected behavior

Should load and run interactive app, but stays on this screen.

Errors and logs

this is in the js console:

Failed to load resource: the server responded with a status of 404 (Not Found)
/kolibri/en/learn/#/topics/c/6815f2269a9e5bbd8f2a48ee317c49d1:1 Uncaught (in promise) Event
/kolibri/en/learn/#/topics/c/900744a85c405893ae0d66ef8eadf170:1 Uncaught (in promise) Event
vue.runtime.esm.js:1888 TypeError: Cannot read property 'length' of undefined
    at Sub.currentInteractions (index.vue:183)
    at Sub.res.<computed> (vuex.esm.js:836)
    at Watcher.get (vue.runtime.esm.js:4473)
    at Watcher.evaluate (vue.runtime.esm.js:4578)
    at Sub.currentInteractions (vue.runtime.esm.js:4830)
    at Sub.beforeDestroy (index.vue:282)
    at invokeWithErrorHandling (vue.runtime.esm.js:1854)
    at callHook (vue.runtime.esm.js:4213)
    at Sub.Vue.$destroy (vue.runtime.esm.js:3972)
    at destroy (vue.runtime.esm.js:3159)
logError @ vue.runtime.esm.js:1888
/kolibri/en/learn/#/topics/c/d7e020de49255edda36fe86a6baa4877:1 Uncaught (in promise) EventisTrusted: truetype: "error"target: scriptcurrentTarget: nulleventPhase: 0bubbles: falsecancelable: falsedefaultPrevented: falsecomposed: falsetimeStamp: 87483.69499994442srcElement: scriptreturnValue: truecancelBubble: falsepath: (5) [script, body.language-english_like, html.full-fonts-loaded, document, Window]__proto__: Event
[...]
Show 13 more frames

Steps to reproduce

Without logging in navigate to page and click exercise

This exercise works in kalite

Context

Win 10 client with chrome browser
server is rpi 4
kolibri 0.13.1

@tim-moody
Copy link
Author

tried three other exercises. all have the same behavior

@avni
Copy link

avni commented Mar 25, 2020

I can replicate the behavior reported.
Have the same issue on: OSX client with Chrome and Safari. Server is RPI4. Kolibri 0.13.1.

Get a 404 on this resource: /static/mathjax/2.1/MathJax.js?config=KAthJax-730d56e87e9c926b91584f6030314815.js

@holta
Copy link

holta commented Mar 26, 2020

@jamalex & all:

  • Internet-in-a-Box communities are accustomed to exercises accompanying KA Lite, but these apparently aren't working within Kolibri, so KA Lite appears to be a better solution than Kolibri overall at this time.

  • Can you help us shed light on the situation and/or recommend any short-term workarounds until this is fixed?

Thanks!

@ivanistheone
Copy link
Contributor

ivanistheone commented Mar 26, 2020

I just tried and I can't reproduce on a linux server.

Direct link to exercise in Kolibri 0.13.1 in an online demo server: https://kolibridemo.learningequality.org/en/learn/#/topics/c/6815f2269a9e5bbd8f2a48ee317c49d1

@tim-moody Am-I looking at the right exercise?

Also can you confirm you have version 10 of the KA (Espanol) channel imported, you can see the version from the device/content page:
Screen Shot 2020-03-26 at 3 33 56 PM

@radinamatic
Copy link
Member

Not able to replicate this on Ubuntu 18.04, exercises in Spanish render correctly in both Chrome and Firefox.

2020-03-26_19-36-24

I'll fire up a Windows VM and retry.

@tim-moody
Copy link
Author

My server is raspbian-lite of feb 13 on rpi 4 as said.

I don't see any version number for ES KA

image

@tim-moody
Copy link
Author

tim-moody commented Mar 26, 2020

Also, it occurs to me that I only have the math portion of ES KA, and I imported it rather than downloaded it if that makes any difference. Did I not get mathjax as a result?

@tim-moody
Copy link
Author

tim-moody commented Mar 26, 2020

The link to Mathjax.js is http://rpi-devel/static/mathjax/2.1/MathJax.js?config=KAthJax-730d56e87e9c926b91584f6030314815.js

but it should be http://rpi-devel/kolibri/static/mathjax/2.1/MathJax.js?config=KAthJax-730d56e87e9c926b91584f6030314815.js (the static directory is there and contains Mathjax.js)

this could be an nginx config problem, so to my chagrin this could indeed be related to iiab/iiab#1646

@tim-moody
Copy link
Author

actually we had the same problem with kiwix. you get to a page with the prefix (/kolibri/), but the links on the page (or via ajax) do not have the prefix in them.

@tim-moody
Copy link
Author

location    /kolibri/ {
    proxy_set_header        Host            $http_host;
    proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header        X-Scheme        $scheme;
    proxy_set_header        X-Script-Name   /kolibri;
    proxy_pass http://127.0.0.1:8009;
}

@ivanistheone
Copy link
Contributor

@tim-moody No I don't think it's an nginx or kolibri problem. The missing Katex reference looks very much like an issue in an older version of the KA channels we faced and fixes.

Please navigate to the content admin page at http://rpi-devel/kolibri/en/device/#/content

From where you will be able to UPDATE the channel (to pull in the latest version) (choose the Kolibri Studio option). More info here: https://kolibri.readthedocs.io/en/latest/manage/resources.html#update-channels

@ivanistheone
Copy link
Contributor

By the end of this you should have v10 of the channel on your device (which has the fix for the exercise rendering issue).

After that you can then do use the Export to local drive steps so you'll have a up-to-date local copy of the channel for faster imports in the future and other tests.

@tim-moody
Copy link
Author

How recent is v10? I only installed a couple of days ago.

@tim-moody
Copy link
Author

image

there I see version 10

@ivanistheone
Copy link
Contributor

ivanistheone commented Mar 26, 2020

Yep ok you have v10, so it's definitely not a content issue. Sorry for the false direction.

Like you said earlier, this is the problem:

The link to Mathjax.js is http://rpi-devel/static/mathjax/2.1/MathJax.js?config=KAthJax-730d56e87e9c926b91584f6030314815.js
but it should be http://rpi-devel/kolibri/static/mathjax/2.1/MathJax.js?config=KAthJax-730d56e87e9c926b91584f6030314815.js (the static directory is there and contains Mathjax.js)

let me dig a bit to look for solution --- either config settings or otherwise...

@tim-moody
Copy link
Author

same problem on 64 bit ubuntu19.10.1 on rpi4 if it matters

@ivanistheone
Copy link
Contributor

@tim-moody I believe setting the env-var KOLIBRI_URL_PATH_PREFIX to /kolibri should fix the issue (or setting the key URL_PATH_PREFIX in options.ini ).
via https://github.com/learningequality/kolibri/blob/release-v0.13.x/kolibri/utils/options.py#L163-L167

I see this config is already being set in this iiab template:
https://github.com/iiab/iiab/blob/9639f36ba01e4beeed9b47776a6d18f4da7a98d7/roles/kolibri/templates/kolibri.service.j2#L10

can you check for KOLIBRI_URL_PATH_PREFIX value on your system and/or URL_PATH_PREFIX manually set in options.ini?

If both are correclty set to /kolibri the issue could be specific to the exercise renderer and will need a fix on our side.

@tim-moody
Copy link
Author

sorry. not finding options.ini

@tim-moody
Copy link
Author

Is this what you're looking for?

[Service]
Type=forking
RemainAfterExit=yes
Environment=KOLIBRI_USER=kolibri
Environment=KOLIBRI_HOME=/library/kolibri
Environment=KOLIBRI_HTTP_PORT=8009
Environment=KOLIBRI_URL_PATH_PREFIX=/kolibri/

@ivanistheone
Copy link
Contributor

sorry. not finding options.ini

That's OK. The options.ini is another way of passing in config (an alternative to using env vars and command-line args).

Is this what you're looking for?
[...]
Environment=KOLIBRI_URL_PATH_PREFIX=/kolibri/

Yes. It seems it's set correctly on your side and the issue is an edge case in the exercise rendered frontend code that doesn't take into account the URL_PATH_PREFIX setting. I'm working on one a local Kolibri instance to confirm this is the root cause and if this is the case I'll "Transfer" the issue to the correct repo and let you know options for workarounds in the meantime.

Thanks for reporting the issue finding and helping with detailed debug info!

@tim-moody
Copy link
Author

sounds like we're narrowing in on it

@ivanistheone ivanistheone transferred this issue from learningequality/kolibri Mar 26, 2020
@ivanistheone
Copy link
Contributor

I've managed to reproduce the issue here:
http://35.196.82.154/kolibri/en/learn/#/topics/c/6815f2269a9e5bbd8f2a48ee317c49d1
This server is running with export KOLIBRI_URL_PATH_PREFIX="/kolibri" and everything functions correctly if you visit http://35.196.82.154/kolibri/ since the Kolibri app knows to expect the prefix /kolibri and works fine.

However the Kolibir exercise plugin loads certain resources using absolute path, hence the breakage.

I've moved the issue to the right project (kolibri-exercise-perseus-plugin) so it can be tracked and fixed in next release.


@tim-moody As a temporary workaround for this issue, you can add the following lines to your nginx config:

    location /static/mathjax/2.1/ {
        rewrite ^(.*)$ /kolibri$1 permanent;
    }
    location /static/images/spinner.gif {
        rewrite ^(.*)$ /kolibri$1 permanent;
    }

Instead of /kolibri, use the same value as you set for KOLIBRI_URL_PATH_PREFIX but without the trailing slash.

@rtibbles rtibbles transferred this issue from learningequality/kolibri-exercise-perseus-plugin Aug 30, 2021
@rtibbles
Copy link
Member

This has now been fixed in #8366 and will be released in the 0.15.0 release.

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

Successfully merging a pull request may close this issue.

6 participants