Import course stuck on "Uploading"

Hello,

I am having a problem uploading a course from another platform and it gets stuck on “uploading” right at the start. Most courses work but I am having a problem with thi

I have investigated in the debug and found where it fails but I am not sure where to go next from here.

cms-worker-1   | [(<function handle_course_discussion_config_update at 0x7f7ca54f8680>, None)]                                                              cms-worker-1   | [2025-04-25 15:12:53,518: INFO/ForkPoolWorker-6] Task openedx.core.djangoapps.discussions.tasks.update_discussions_settings_from_course_task[5341384e-e2b1-4ae5-ae26-e7bdfbfb7e1e] succeeded in 0.03336540700001933s: None                                                                             lms-worker-1   | 2025-04-25 15:12:53,561 WARNING 15 [edx_toggles.toggles.internal.waffle.flag] [user None] [ip None] flag.py:79 - Flag 'teams.content_groups_for_teams' accessed without a request, which is likely in the context of a celery task.                                                                    lms-worker-1   | 2025-04-25 15:12:53,568 INFO 15 [openedx.core.djangoapps.content.block_structure.store] [user None] [ip None] store.py:165 - BlockStructure: Added to cache; block-v1:organization+ORG3+2025_2+type@course+block@course, size: 1288                                                                  lms-worker-1   | 2025-04-25 15:12:53,571 INFO 15 [celery.app.trace] [user None] [ip None] trace.py:128 - Task openedx.core.djangoapps.content.block_structure.tasks.update_course_in_cache_v2[d8d1c721-f071-4266-9e1f-2ff1ec816633] succeeded in 0.05093894499987073s: None                                             cms-worker-1   | [2025-04-25 15:12:53,594: INFO/ForkPoolWorker-6] Task lms.djangoapps.discussion.tasks.update_discussions_map[5a54cfe3-2622-41fe-93dc-b0324f001c52] succeeded in 0.018656248999832314s: None                                                                                                            lms-worker-1   | 2025-04-25 15:13:16,371 ERROR 15 [edx.celery.task] [user None] [ip None] tasks.py:118 - update_course_in_cache_v2 encountered expected error, retrying.                                                                                                                                                lms-worker-1   | Traceback (most recent call last):                      
lms-worker-1   |   File "/openedx/edx-platform/openedx/core/djangoapps/content/block_structure/tasks.py", line 107, in _call_and_retry_if_needed            lms-worker-1   |     api_method(course_key)                                                                                                                 lms-worker-1   |   File "/openedx/edx-platform/openedx/core/djangoapps/content/block_structure/api.py", line 32, in update_course_in_cache                  lms-worker-1   |     return get_block_structure_manager(course_key).update_collected_if_needed()
lms-worker-1   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                            lms-worker-1   |   File "/openedx/edx-platform/openedx/core/djangoapps/content/block_structure/manager.py", line 128, in update_collected_if_needed         lms-worker-1   |     self._update_collected()                                                                                                               lms-worker-1   |   File "/openedx/edx-platform/openedx/core/djangoapps/content/block_structure/manager.py", line 136, in _update_collected                  lms-worker-1   |     block_structure = BlockStructureFactory.create_from_modulestore(
lms-worker-1   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                       lms-worker-1   |   File "/openedx/edx-platform/openedx/core/djangoapps/content/block_structure/factory.py", line 56, in create_from_modulestore             lms-worker-1   |     root_xblock = modulestore.get_item(root_block_usage_key, depth=None, lazy=False)
lms-worker-1   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-worker-1   |   File "/openedx/edx-platform/xmodule/modulestore/mixed.py", line 90, in inner
lms-worker-1   |     retval = func(field_decorator=strip_key_collection, *args, **kwargs)
lms-worker-1   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-worker-1   |   File "/openedx/edx-platform/xmodule/modulestore/mixed.py", line 257, in get_item
lms-worker-1   |     return store.get_item(usage_key, depth, **kwargs)
lms-worker-1   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-worker-1   |   File "/openedx/edx-platform/xmodule/modulestore/split_mongo/split_draft.py", line 283, in get_item
lms-worker-1   |     return super().get_item(usage_key, depth=depth, **kwargs)
lms-worker-1   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-worker-1   |   File "/openedx/edx-platform/xmodule/modulestore/split_mongo/split.py", line 1182, in get_item
lms-worker-1   |     course = self._lookup_course(usage_key.course_key)
lms-worker-1   |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lms-worker-1   |   File "/openedx/edx-platform/xmodule/modulestore/split_mongo/split.py", line 842, in _lookup_course
lms-worker-1   |     raise ItemNotFoundError(course_key)
lms-worker-1   | xmodule.modulestore.exceptions.ItemNotFoundError: course-v1:organization+ORG1+2025_2+branch@published-branch
lms-worker-1   | 2025-04-25 15:13:16,380 INFO 1 [celery.worker.strategy] [user None] [ip None] strategy.py:161 - Task openedx.core.djangoapps.content.block_structure.tasks.update_course_in_cache_v2[9bb19c84-bdd8-49d9-9105-e06a970a6363] received                                                                    lms-worker-1   | 2025-04-25 15:13:16,384 INFO 15 [celery.app.trace] [user None] [ip None] trace.py:128 - Task openedx.core.djangoapps.content.block_structure.tasks.update_course_in_cache_v2[9bb19c84-bdd8-49d9-9105-e06a970a6363] retry: Retry in 30s: ItemNotFoundError(CourseLocator('organization', 'ORG1', '2025_2', 'published-branch', None)) 

I noticed that the course number is different before and after the traceback (ORG3 and ORG1). Not sure if related but I did try to keep everything the same when importing the course. I have tried it quite a few times now.

For now I am uploading this course through command line but it would be great to get this working.

If anyone has any suggestions I would appreciate it.

@dave any advice on import issue?

@tech_mil: Please go to your Django admin at:

http://local.openedx.io:8000/admin/split_modulestore_django/splitmodulestorecourseindex/

Find the entry for this course and click it. Can you please put the detail view here? It should look something like:

Thank you.

Sorry for not replying earlier.

Here is the image of the course that I was able to upload using command line. I can upload the one that got stuck later.

I had to redact some stuff but where it is supposed to contain organization, it is correct and can be assumed to be “organization” like previously and the same for course number being ORG1

Please try looking up this course key (the “course-v1:…” piece) in the course_overviews_courseoverview table (as id) and in the split_modulestore_django_splitmodulestorecourseindex table (as course_id). Are there entries that differ only by capitalization, e.g. (“course-v1:my_org+my_course+run1” vs. “course-v1:My_org+My_course+Run1”)?

The course overviews table is case insensitive, while the split_modulestore table (and MongoDB) are case sensitive by default. This sometimes causes weird lookup issues when entries differ only by case.

I did not find any difference in those tables however we looked deeper in the course zip file strucutre and found that some files has differences which could be the problem if you could confirm?

The left file is the version that was successfully imported and then exported from the website and the right is the original course to be imported. We found that a lot of the course files had differences like this.

Something else to add, I tested the import on my local machine instead of on the server and I was able to get it to upload! Bu this was on a local instance of the platform.

Also, would an edx version difference have any affect? Our platform is on latest version of tutor and edx however the platform that the course came from may be one or two versions behind.