Missing courses (the modulestore tree is gone)

I have created two courses in 2022 and updated recently. Couple of days ago, I tried to rebuild tutor mfe, and lost content and outline of the courses from both cms and lms. After googling and asking AI, I found these courses lost structures and got 500 error every time i click links. From hours of debugging and looking database, i got answer:

DagX/AMA01/2022 active_versions: true 
published: exists: false 
draft : exists: false
 DagX/APH01/2022 active_versions: true
 published: exists: false 
draft : exists: false 
the modulestore tree is gone 

I tried to export courses from database but only get Skelton file. Appreciate for any suggestion and help

Hi @hkhanal01 and I’m so sorry that happened. Could you please provide more detail about your system. What do you mean by you “updated recently”? What version was your site on, and what did you upgrade to? What commands did you run, and did you receive any error output when you ran them?

Hi @sarina thank you very much for quick response. I am using Sumac,with following tutor docker version. I am hosting mysql in different computer host and mango db in same host in aws.

verhangio/openedx:19.0.4-indigo 
overhangio/openedx-mfe:19.0.0-indigo
mongo:7.0.7 

I lost those courses ( recenty updated courses) when i tried to rebuild mfe. It took a lot of time and it was stuck couple of times. I increased the memory.

Hmm. I don’t know what might have happened there. @dave or @tutor-maintainers any ideas?

Hi @hkhanal01 , what version were you using before Sumac?

Can you provide the ID of one of the courses, as it appears in the URL bar? Did it look likeDagX/AMA01/2022, or like course-v1:DagX+AMA01+2022 ?

@kmccormick and @sarina . Thanks a lot for your response. Course looks like:

It seems like course structure is broken. I could not figure out where it happened.

cms-1  | 2025-08-27 21:00:16,641 WARNING 10 [xmodule.modulestore.split_mongo.mongo_connection] [user 4]  mongo_connection.py:353 - doc was None when attempting to retrieve structure for item with key 68a43cefbdc4ed315278f05e
cms-1  | 2025-08-27 21:00:16,528 ERROR 11 [django.request] [user 4] [ip 98.10.245.69] log.py:241 - Internal Server Error: /api/courses/v1/validation/course-v1:DagX+AMA01+2022/
cms-1  | Traceback (most recent call last):
cms-1  |   File "/openedx/edx-platform/xmodule/modulestore/__init__.py", line 203, in bulk_operations
cms-1  |     yield
cms-1  |   File "/openedx/edx-platform/xmodule/modulestore/mixed.py", line 1108, in bulk_operations
cms-1  |     yield
cms-1  |   File "/openedx/edx-platform/cms/djangoapps/contentstore/api/views/course_validation.py", line 80, in get
cms-1  |     is_self_paced=course.self_paced,
cms-1  |                   ^^^^^^^^^^^^^^^^^
cms-1  | AttributeError: 'NoneType' object has no attribute 'self_paced'
cms-1  | 
cms-1  | During handling of the above exception, another exception occurred:
cms-1  | 
cms-1  | Traceback (most recent call last):
cms-1  |   File "/openedx/venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 55, in inner
cms-1  |     response = get_response(request)
cms-1  |                ^^^^^^^^^^^^^^^^^^^^^
cms-1  |   File "/openedx/venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 197, in _get_response
cms-1  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
cms-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cms-1  |   File "/opt/pyenv/versions/3.11.8/lib/python3.11/contextlib.py", line 81, in inner
cms-1  |     return func(*args, **kwds)
cms-1  |            ^^^^^^^^^^^^^^^^^^^
cms-1  |   File "/openedx/venv/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
cms-1  |     return view_func(*args, **kwargs)
cms-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^
cms-1  |   File "/openedx/venv/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
cms-1  |     return self.dispatch(request, *args, **kwargs)
cms-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cms-1  |   File "/openedx/venv/lib/python3.11/site-packages/rest_framework/views.py", line 509, in dispatch
cms-1  |     response = self.handle_exception(exc)
cms-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^
cms-1  |   File "/openedx/venv/lib/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch
cms-1  |     response = handler(request, *args, **kwargs)
cms-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cms-1  |   File "/openedx/edx-platform/cms/djangoapps/contentstore/api/views/utils.py", line 136, in _wrapper_view
cms-1  |     return view(self, request, course_key, *args, **kwargs)
cms-1  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cms-1  |   File "/openedx/edx-platform/cms/djangoapps/contentstore/api/views/course_validation.py", line 76, in get
cms-1  |     with store.bulk_operations(course_key):
cms-1  |   File "/opt/pyenv/versions/3.11.8/lib/python3.11/contextlib.py", line 158, in __exit__
cms-1  |     self.gen.throw(typ, value, traceback)
cms-1  |   File "/openedx/edx-platform/xmodule/modulestore/mixed.py", line 1107, in bulk_operations
cms-1  |     with store.bulk_operations(course_id, emit_signals, ignore_case):
cms-1  |   File "/opt/pyenv/versions/3.11.8/lib/python3.11/contextlib.py", line 158, in __exit__
cms-1  |     self.gen.throw(typ, value, traceback)
cms-1  |   File "/openedx/edx-platform/xmodule/modulestore/__init__.py", line 205, in bulk_operations
cms-1  |     self._end_bulk_operation(course_id, emit_signals, ignore_case)
cms-1  |   File "/openedx/edx-platform/xmodule/modulestore/__init__.py", line 301, in _end_bulk_operation
cms-1  |     dirty = self._end_outermost_bulk_operation(bulk_ops_record, structure_key)  # lint-amnesty, pylint: disable=assignment-from-no-return
cms-1  |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cms-1  |   File "/openedx/edx-platform/xmodule/modulestore/split_mongo/split.py", line 263, in _end_outermost_bulk_operation
cms-1  |     self.db_connection.insert_structure(bulk_write_record.structures[_id], bulk_write_record.course_key)
cms-1  |   File "/openedx/edx-platform/xmodule/modulestore/split_mongo/mongo_connection.py", line 409, in insert_structure
cms-1  |     tagger.measure("blocks", len(structure["blocks"]))
cms-1  |                                  ~~~~~~~~~^^^^^^^^^^
cms-1  | TypeError: 'NoneType' object is not subscriptable
cms-1  | 2025-08-27 21:00:16,644 ERROR 10 [root] [user None] [ip None] signals.py:22 - Uncaught exception from None
cms-1  | Traceback (most recent call last):
cms-1  |   File "/openedx/edx-platform/xmodule/modulestore/__init__.py", line 203, in bulk_operations
cms-1  |     yield
cms-1  |   File "/openedx/edx-platform/xmodule/modulestore/mixed.py", line 1108, in bulk_operations
cms-1  |     yield
cms-1  |   File "/openedx/edx-platform/cms/djangoapps/contentstore/api/views/course_quality.py", line 107, in get
cms-1  |     is_self_paced=course.self_paced,
cms-1  |                   ^^^^^^^^^^^^^^^^^
cms-1  | AttributeError: 'NoneType' object has no attribute 'self_paced'
cms-1  | 

What version were you using before Sumac?