Importing Khan Academy from Kolibri Studio

I was trying to import Khan Academy (English - US curriculum) -Version 2 on Windows and the I got the message below.

TypeError: An id must be specified

1 Like

Hello @ibrahimi3 can you provide more details to know exactly in what step of the process and what part of the channel you were trying to import when you got that error? That channel has 9971 resources and it would be hard to know if one of them is corrupted.
Also, it would be good if you can retry it and check if it works now, a temporary network issue might have been the reason for your problem too.

Regards
José

I got this several times right now on the Raspberrry Pi 0.17.5.zip image;

However, it seems to have now resolved itself. Tried several times now and it works. Perhaps it timed out or something as there is a lot of content, and now that the successful content is cached, it worked?

However, when I click Select All, the import button doesn’t enable itself:

However, after a while it does enable:

Hrm, yes - some of the database queries can take particularly long on a raspberry pi - in this case working out how much space the imported channel will take. Khan Academy English is the largest channel in our library by a long way, so these issues tend to be exacerbated for it!

If you are able to share any of the logs from the device following these instructions: Troubleshooting - Kolibri User Guide it may give us some more details on what went wrong for the error screen you saw!

Thanks @richard, had to go into the archive folder:

ERROR 2025-03-04 03:00:00,293 kolibri.core.deviceadmin.tasks Cannot operate on a closed database.
ERROR 2025-03-04 03:00:00,303 kolibri.core.deviceadmin.tasks Vacuum of database /home/pi/.kolibri/db.sqlite3 couldn't be executed. Possible reasons:
  * There is an open transaction in the db.
  * There are one or more active SQL statements.
The full error: Cannot operate on a closed database.
ERROR 2025-03-04 12:26:15,364 concurrent.futures exception calling callback for <Future at 0x7ffec3fc4e10 state=finished raised JobNotRestartable>
Traceback (most recent call last):
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 340, in _invoke_callbacks
    callback(self)
  File "/usr/lib/python3/dist-packages/kolibri/core/tasks/worker.py", line 112, in handle_finished_future
    future.result()
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kolibri/core/tasks/worker.py", line 48, in execute_job_with_python_worker
    execute_job(
  File "/usr/lib/python3/dist-packages/kolibri/core/tasks/worker.py", line 31, in execute_job
    job.execute()
  File "/usr/lib/python3/dist-packages/kolibri/core/tasks/job.py", line 339, in execute
    self.storage.reschedule_finished_job_if_needed(
  File "/usr/lib/python3/dist-packages/kolibri/core/tasks/storage.py", line 608, in reschedule_finished_job_if_needed
    raise JobNotRestartable(
kolibri.core.tasks.exceptions.JobNotRestartable: Cannot reschedule job with state=QUEUED
INFO 2025-03-04 18:41:44,806 kolibri.core.analytics.utils Ping succeeded! (response: {'id': 9284632, 'messages': []})
INFO 2025-03-04 20:28:28,483 kolibri.core.content.management.commands.importchannel Downloading data for channel id c9d7f950ab6b5a1199e3d6c10d7f0103
ERROR 2025-03-04 20:28:50,680 kolibri.core.tasks.job Job 9c08eb402b4646ccacdcabcc92eb3935 raised an exception: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/kolibri/core/tasks/job.py", line 326, in execute
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kolibri/core/tasks/registry.py", line 237, in __call__
    return self.func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kolibri/core/content/tasks.py", line 223, in remotechannelimport
    call_command(
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/__init__.py", line 181, in call_command
    return command.execute(*args, **defaults)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kolibri/core/tasks/management/commands/base.py", line 28, in handle
    return self.handle_async(*args, **options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kolibri/core/content/management/commands/importchannel.py", line 268, in handle_async
    self.download_channel(
  File "/usr/lib/python3/dist-packages/kolibri/core/content/management/commands/importchannel.py", line 106, in download_channel
    self._transfer(
  File "/usr/lib/python3/dist-packages/kolibri/core/content/management/commands/importchannel.py", line 169, in _transfer
    self._start_file_transfer(
  File "/usr/lib/python3/dist-packages/kolibri/core/content/management/commands/importchannel.py", line 204, in _start_file_transfer
    filetransfer.run(progress_callback)
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 691, in inner
    func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 730, in run
    self.complete_close_and_finalize()
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 503, in complete_close_and_finalize
    self.finalize()
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 670, in finalize
    return super(FileDownload, self).finalize()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 573, in finalize
    self._move_tmp_to_dest()
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 674, in _move_tmp_to_dest
    self.dest_file_obj.finalize_file()
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 374, in finalize_file
    raise ValueError("Cannot combine chunks: Not all chunks are complete")
ValueError: Cannot combine chunks: Not all chunks are complete

INFO 2025-03-04 20:29:03,464 kolibri.core.content.management.commands.importchannel Downloading data for channel id c9d7f950ab6b5a1199e3d6c10d7f0103
ERROR 2025-03-04 20:29:22,575 kolibri.core.tasks.job Job b0448c99f1f14a95a5a2774e9c86eace raised an exception: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/kolibri/core/tasks/job.py", line 326, in execute
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kolibri/core/tasks/registry.py", line 237, in __call__
    return self.func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kolibri/core/content/tasks.py", line 223, in remotechannelimport
    call_command(
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/__init__.py", line 181, in call_command
    return command.execute(*args, **defaults)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kolibri/core/tasks/management/commands/base.py", line 28, in handle
    return self.handle_async(*args, **options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kolibri/core/content/management/commands/importchannel.py", line 268, in handle_async
    self.download_channel(
  File "/usr/lib/python3/dist-packages/kolibri/core/content/management/commands/importchannel.py", line 106, in download_channel
    self._transfer(
  File "/usr/lib/python3/dist-packages/kolibri/core/content/management/commands/importchannel.py", line 169, in _transfer
    self._start_file_transfer(
  File "/usr/lib/python3/dist-packages/kolibri/core/content/management/commands/importchannel.py", line 204, in _start_file_transfer
    filetransfer.run(progress_callback)
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 691, in inner
    func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 730, in run
    self.complete_close_and_finalize()
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 503, in complete_close_and_finalize
    self.finalize()
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 670, in finalize
    return super(FileDownload, self).finalize()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 573, in finalize
    self._move_tmp_to_dest()
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 674, in _move_tmp_to_dest
    self.dest_file_obj.finalize_file()
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 374, in finalize_file
    raise ValueError("Cannot combine chunks: Not all chunks are complete")
ValueError: Cannot combine chunks: Not all chunks are complete

INFO 2025-03-04 20:30:42,657 kolibri.core.content.management.commands.importchannel Downloading data for channel id c9d7f950ab6b5a1199e3d6c10d7f0103
ERROR 2025-03-04 20:31:01,509 kolibri.core.tasks.job Job f89475aafbf24a5db3d78f3ae748cacd raised an exception: Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/kolibri/core/tasks/job.py", line 326, in execute
    result = func(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kolibri/core/tasks/registry.py", line 237, in __call__
    return self.func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kolibri/core/content/tasks.py", line 223, in remotechannelimport
    call_command(
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/__init__.py", line 181, in call_command
    return command.execute(*args, **defaults)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kolibri/dist/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kolibri/core/tasks/management/commands/base.py", line 28, in handle
    return self.handle_async(*args, **options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kolibri/core/content/management/commands/importchannel.py", line 268, in handle_async
    self.download_channel(
  File "/usr/lib/python3/dist-packages/kolibri/core/content/management/commands/importchannel.py", line 106, in download_channel
    self._transfer(
  File "/usr/lib/python3/dist-packages/kolibri/core/content/management/commands/importchannel.py", line 169, in _transfer
    self._start_file_transfer(
  File "/usr/lib/python3/dist-packages/kolibri/core/content/management/commands/importchannel.py", line 204, in _start_file_transfer
    filetransfer.run(progress_callback)
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 691, in inner
    func(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 730, in run
    self.complete_close_and_finalize()
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 503, in complete_close_and_finalize
    self.finalize()
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 670, in finalize
    return super(FileDownload, self).finalize()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 573, in finalize
    self._move_tmp_to_dest()
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 675, in _move_tmp_to_dest
    self.dest_file_obj.delete()
  File "/usr/lib/python3/dist-packages/kolibri/utils/file_transfer.py", line 428, in delete
    shutil.rmtree(self.chunk_dir)
  File "/usr/lib/python3.11/shutil.py", line 738, in rmtree
    onerror(os.rmdir, path, sys.exc_info())
  File "/usr/lib/python3.11/shutil.py", line 736, in rmtree
    os.rmdir(path, dir_fd=dir_fd)
OSError: [Errno 39] Directory not empty: '/KOLIBRI_DATA/content/databases/c9d7f950ab6b5a1199e3d6c10d7f0103.sqlite3.chunks'

INFO 2025-03-04 20:31:21,317 kolibri.core.content.management.commands.importchannel Downloading data for channel id c9d7f950ab6b5a1199e3d6c10d7f0103
INFO 2025-03-04 20:31:34,855 kolibri.core.content.utils.channel_import Importing LocalFile data
INFO 2025-03-04 20:31:35,076 kolibri.core.content.utils.channel_import Importing Language data
INFO 2025-03-04 20:31:35,078 kolibri.core.content.utils.channel_import Importing ContentNode data
INFO 2025-03-04 20:31:39,135 kolibri.core.content.utils.channel_import Importing File data
INFO 2025-03-04 20:31:44,435 kolibri.core.content.utils.channel_import Importing ChannelMetadata data
INFO 2025-03-04 20:31:44,437 kolibri.core.content.utils.channel_import Importing AssessmentMetaData data
INFO 2025-03-04 20:31:44,484 kolibri.core.content.utils.channel_import Importing ContentNode_related data
INFO 2025-03-04 20:31:44,486 kolibri.core.content.utils.channel_import Importing ContentNode_has_prerequisite data
INFO 2025-03-04 20:31:44,487 kolibri.core.content.utils.channel_import Importing ContentTag data
INFO 2025-03-04 20:31:44,489 kolibri.core.content.utils.channel_import Importing ContentNode_tags data
INFO 2025-03-04 20:31:53,204 kolibri.core.content.utils.channel_import Channel c9d7f950ab6b5a1199e3d6c10d7f0103 successfully imported into the database

Thanks - looks like there was a network interruption or write contention during downloading of the metadata file for the channel. We can definitely try to make that a little bit more robust in future.

1 Like

Cool. If it helps, I accessed the web interface via a macbook pro running macos to the kolibri wifi hotspot. The kolibri instance is running on a raspberry pi 5 with a 256GB max endurance sd card, and connected to the internet via an ethernet cable to a 100gbps down / 10 gbps up home network that is a fibre connection in australia.