HTML5 file upload issues

Operating System (e.g. Windows, MacOS, Linux):Windows

Browser (e.g. Chrome, Firefox, Safari): Chrome

Channel (Name of the channel you were working on):Physics 9

Description of problem: When I upload new html5 files, the old files show up in Kolibri Studio. For example, I uploaded file ‘introduction-to-physics-ver-1’, but the file I see in the studio is ‘introduction-to-physics-rev-5’, which is an older revision/version. The issue is not consistent, I have loaded 5 file, the 3 files are ok with the right version, but the two are the older incorrect files.

Hi @k2edutech,

Thanks for reporting this - when you have issues, do you see any errors in the developer console in your browser? This can usually be opened by pressing F12 or going to the menu and selecting Developer Tools → Console or something similar.

If you see any errors there, that might give us more of a lead.

If you would like to share the URL of the channel on Studio with me, I’d be happy to take a look at it, but would not want to be uploading files to your channel, ofc!

Kind Regards,
Richard

Here is the URL for Physics 9 channel in Kolibri Studio. Please go to Chapter 1, Introduction to Physics. In the preview, it has file ‘introduction-to-physics-rev-5’. It should have been ‘introduction-to-physics-ver-1’ as included in the Sushichef script:

https://studio.learningequality.org/en/channels/0dd1b20d2fe356bc92ef177d06895c4c/#/221befc27ddc47e0816a60c1fb3e6eb6

Regards,
Iqbal Chaudhry

And I do see the following errors:
image.png

Also, this channel seems no longer to exist when I try to navigate to it.

The errors you are seeing in the console there seem to be a result of a CSP we are not including ourselves, are you running any addons that would be doing the blocking? Either way, not running these scripts wouldn’t break core functionality.

Sushichef script

Was this upload via the interface or via ricecooker? If the latter, then we’d need to see your sushi chef script to understand what might be happening here.

Hi Richard,
I’m using VSCode and Sushichef script to upload HTML5 files to Kolibri Studio. The html5 files are in a folder html5 in the path shown below.
The issue was that the script was uploading a different/older version of file (i.e. “introduction-to-physics-rev-5”) instead of what was the in the current script (i.e. “introduction-to-physics-ver-1”). The “introduction-to-physics-rev-5” was not even present in html5 folder. It seems that the Studio was picking up this file from its server.

When I changed the path in the following lines by just removing the ‘html5’ folder

Create html5 files

htmlzip_file1 = HTMLZipFile(path=“C:/Users/micha/KolibriStudioUpload/html5/introduction-to-physics-ver-1.zip”)
html1 = HTML5AppNode(title=“Introduction to Physics”, source_id=“html5-1”, files=[htmlzip_file1], license=get_license(licenses.PUBLIC_DOMAIN))

to

Create html5 files

htmlzip_file1 = HTMLZipFile(path=“C:/Users/micha/KolibriStudioUpload/introduction-to-physics-ver-1.zip”)
html1 = HTML5AppNode(title=“Introduction to Physics”, source_id=“html5-1”, files=[htmlzip_file1], license=get_license(licenses.PUBLIC_DOMAIN))

The uploaded files were correct. (Note: I placed a copy of file “introduction-to-physics-ver-1” into ‘KolibriStudioUpload’ folder, so that the script can find the file).

Although, my current issue is resolved, but I have two questions that would help me in the future.

  1. How just by changing the folder would solve this issue?
  2. I understand that Kolibri Studio keeps the older files on the server. How can we purge those file so that the Studio does not pick up the older unwanted files?

Regards,
Iqbal Chaudhry
K2EduTech.org

It seems like this might be an issue with file caching within ricecooker. Could I ask you to fill out an issue on the ricecooker repository describing this? https://github.com/learningequality/ricecooker/issues/new

Alternatively, if you can tell me these three things:

* ricecooker version:
* Python version:
* Operating System:

I can fill out the issue using your description above.

Kind Regards,
Richard

Hi Richard,
The issue has occurred again. Here is the URL of the channel:
https://studio.learningequality.org/en/channels/0dd1b20d2fe356bc92ef177d06895c4c/#/26e0750a1f30434bb16e96c77cc3e371/8d07db2b494e4003b09dded038e3e2dd

This time I’m uploading ‘introduction-to-physics-ver-2’, but the studio still shows the older version of the file ‘introduction-to-physics-ver-1’.
And the developer console shows the following errors. I’m using:
Ricecooker version: v0.6.43
Python version: 3.7.9 (64 bit)
Operating system: Windows 10 Home

Regards,
Iqbal Chaudhry

During the run of the script is there any indication that this file has not been uploaded? How many files does the script say it has uploaded when you upload with just the new version?