Discovery New Courses is not showing courses

I have recently upgraded my tutor version 18.1.3 to tutor 20.0.3. Then I ran the command

python manage.py cms reindex_studio --experimental

Counting libraries…
Counting courses…
Found 78 courses, 0 libraries.
Checking index…
Creating new index…
Indexing libraries…
Indexing courses…
2025-12-30 12:07:00,985 WARNING 843 [py.warnings] [user None] [ip None] warnings.py:110 - /openedx/edx-platform/openedx/core/djangoapps/content/search/api.py:575: UnorderedObjectListWarning: Pagination may yield inconsistent results with an unordered object_list: <class ‘openedx.core.djangoapps.content.course_overviews.models.CourseOverview’> QuerySet.
paginator = Paginator(CourseOverview.objects.only(‘id’, ‘display_name’), 1000)

1/78. Now indexing course Customer and Sales Quotation Creation (course-v1:ERManager+ER-001+2024-001)
2/78. Now indexing course ERAcademix (course-v1:ERManager+ER-002+2024-002)
3/78. Now indexing course ERTickApp (course-v1:ERManager+ER-003+2024-003)

………
77/78. Now indexing course SOP for Work from Home (course-v1:Talent_Management+HR-014+2024-014)
78/78. Now indexing course SOP for Resource Augmentation (course-v1:Talent_Management+HR-015+2024-015)
Swapping index…
Deleting old index…
Done! 4086 blocks indexed across 78 courses, collections and libraries.

it successfully indexed 78 courses but when I check discovery new tab, No course is shown.

While meilisearch is showing successfully task completion:
edxdev@srv607708:~/.local/share$ tutor local logs meilisearch --tail=50
docker compose -f /home/edxdev/.local/share/tutor/env/local/docker-compose.yml -f /home/edxdev/.local/share/tutor/env/local/docker-compose.prod.yml --project-name tutor_local logs --tail 50 meilisearch
meilisearch-1 | 2025-12-30T12:08:05.252012Z INFO index_scheduler: A batch of tasks was successfully completed with 1 successful tasks and 0 failed tasks.
meilisearch-1 | 2025-12-30T12:08:05.557375Z INFO HTTP request{method=GET host=“meilisearch:7700” route=/tasks/1679 query_parameters= user_agent=Meilisearch Python (v0.34.1) status_code=200}: meilisearch: close time.busy=157µs time.idle=168µs
meilisearch-1 | 2025-12-30T12:08:05.560814Z INFO HTTP request{method=GET host=“meilisearch:7700” route=/indexes/tutor_studio_content query_parameters= user_agent=Meilisearch Python (v0.34.1) status_code=200}: meilisearch: close time.busy=139µs time.idle=170µs
meilisearch-1 | 2025-12-30T12:08:05.565774Z INFO HTTP request{method=POST host=“meilisearch:7700” route=/swap-indexes query_parameters= user_agent=Meilisearch Python (v0.34.1) status_code=202}: meilisearch: close time.busy=153µs time.idle=1.67ms
meilisearch-1 | 2025-12-30T12:08:05.578537Z INFO index_scheduler: A batch of tasks was successfully completed with 1 successful tasks and 0 failed tasks.
meilisearch-1 | 2025-12-30T12:08:06.569731Z INFO HTTP request{method=GET host=“meilisearch:7700” route=/indexes/tutor_studio_content query_parameters= user_agent=Meilisearch Python (v0.34.1) status_code=200}: meilisearch: close time.busy=102µs time.idle=141µs
meilisearch-1 | 2025-12-30T12:08:06.573534Z INFO HTTP request{method=DELETE host=“meilisearch:7700” route=/indexes/tutor_studio_content_new query_parameters= user_agent=Meilisearch Python (v0.34.1) status_code=202}: meilisearch: close time.busy=108µs time.idle=1.42ms
meilisearch-1 | 2025-12-30T12:08:06.575885Z INFO HTTP request{method=GET host=“meilisearch:7700” route=/tasks/1681 query_parameters= user_agent=Meilisearch Python (v0.34.1) status_code=200}: meilisearch: close time.busy=113µs time.idle=126µs
meilisearch-1 | 2025-12-30T12:08:06.606747Z INFO index_scheduler: A batch of tasks was successfully completed with 1 successful tasks and 0 failed tasks.
meilisearch-1 | 2025-12-30T12:08:07.079773Z INFO HTTP request{method=GET host=“meilisearch:7700” route=/tasks/1681 query_parameters= user_agent=Meilisearch Python (v0.34.1) status_code=200}: meilisearch: close time.busy=158µs time.idle=195µs
edxdev@srv607708:~/.local/share$

but when I click on Reindex button in one of my course it show successfully reindexed but when I check meilisearch logs I see that the task has failed:

meilisearch-1 | 2025-12-30T12:08:06.606747Z INFO index_scheduler: A batch of tasks was successfully completed with 1 successful tasks and 0 failed tasks.
meilisearch-1 | 2025-12-30T12:08:07.079773Z INFO HTTP request{method=GET host=“meilisearch:7700” route=/tasks/1681 query_parameters= user_agent=Meilisearch Python (v0.34.1) status_code=200}: meilisearch: close time.busy=158µs time.idle=195µs
meilisearch-1 | 2025-12-30T12:11:12.930844Z INFO HTTP request{method=POST host=“meilisearch:7700” route=/indexes/tutor_course_info/documents query_parameters= user_agent=Meilisearch Python (v0.34.1) status_code=202}: meilisearch: close time.busy=467µs time.idle=1.74ms
meilisearch-1 | 2025-12-30T12:11:12.931168Z INFO milli::update::index_documents::enrich: Primary key was not specified in index. Inferred to ‘id’
meilisearch-1 | 2025-12-30T12:11:12.932099Z INFO index_scheduler: A batch of tasks was successfully completed with 0 successful tasks and 1 failed tasks.
meilisearch-1 | 2025-12-30T12:11:13.292539Z INFO HTTP request{method=POST host=“meilisearch:7700” route=/indexes/tutor_courseware_content/documents query_parameters= user_agent=Meilisearch Python (v0.34.1) status_code=202}: meilisearch: close time.busy=496µs time.idle=2.58ms
meilisearch-1 | 2025-12-30T12:11:13.293556Z INFO milli::update::index_documents::enrich: Primary key was not specified in index. Inferred to ‘id’
meilisearch-1 | 2025-12-30T12:11:13.295052Z INFO index_scheduler: A batch of tasks was successfully completed with 0 successful tasks and 1 failed tasks.
meilisearch-1 | 2025-12-30T12:11:13.298393Z INFO HTTP request{method=POST host=“meilisearch:7700” route=/indexes/tutor_courseware_content/search query_parameters= user_agent=Meilisearch Python (v0.34.1) status_code=200}: meilisearch: close time.busy=320µs time.idle=965µs

but when I check meilisearch console I see due to id it failed:
/meili_data $ {“results”:[{“uid”:1375,“indexUid”:“tutor_courseware_content”,“status”:“failed”,“type”:“documentAdditionOrUpdate”,“canceledBy”:null,“details”:{“receivedDocuments”:36,“indexedDocuments”:0},“error”:{
“message”:“Document identifier \"block-v1:General_Course+GC-003+2024-003+type@html+block@c2a01b7bda754a3bb774217413f3aec4\" is invalid. A document identifier can be of type integer or string, only composed of
alphanumeric characters (a-z A-Z 0-9), hyphens (-) and underscores ().",“code”:“invalid_document_id”,“type”:“invalid_request”,“link”:“Error codes - Meilisearch Documentation
2493392S”,“enqueuedAt”:“2025-12-30T11:00:29.74973889Z”,“startedAt”:“2025-12-30T11:00:29.751651986Z”,“finishedAt”:“2025-12-30T11:00:29.754145378Z”},{“uid”:1374,“indexUid”:“tutor_course_info”,“status”:“failed”,“ty
pe”:“documentAdditionOrUpdate”,“canceledBy”:null,“details”:{“receivedDocuments”:1,“indexedDocuments”:0},“error”:{“message”:"Document identifier \"course-v1:General_Course+GC-003+2024-003\" is invalid. A docume
nt identifier can be of type integer or string, only composed of alphanumeric characters (a-z A-Z 0-9), hyphens (-) and underscores (
).”,“code”:“invalid_document_id”,“type”:“invalid_request”,},{“uid”:1373,“indexUid”:“tutor_course_info”,“status”:“failed”,“type”:“documentAdditionOrUpdate”,“canceledBy”:null,“details”:{“receivedDocuments”:1,“indexedDocuments”:0},“error”:{“message”:“Document identifier \"course-v1:SAP_S4_HANA_Arabic+SA-007+2025-007\" is invalid. A document identifier can be of type integer or string, only composed of alphanumeric characters (a-z A-Z 0-9), hyphens (-) and underscores (_).”,“co
de”:“invalid_document_id”,“type”:“invalid_request”,“link”:"

/meili_data $ curl -X GET “localhost:7700/indexes/tutor_studio_content/stats” \
{“numberOfDocuments”:4136,“isIndexing”:false,“fieldDistribution”:{“access_id”:4136,“block_id”:4136,“block_type”:4136,“breadcrumbs”:4136,“content”:4136,“context_key”:4136,“description”:1499,“display_name”:4136,“id”:4136,“modified”:4136,“org”:4136,“tags”:4086,“type”:4136,“usage_key”:4136}}/meili_data $ curl -X GET “localhost:7700/indexes/tutor_courseware_content/stats”
{“numberOfDocuments”:0,“isIndexing”:false,“fieldDistribution”:{}}/meili_data $

While course are added to tutor_course_info but are not adding to tutor_courseware_content.

Hi @brunodev , can you try the solution provided by Braden over here:
https://discuss.openedx.org/t/question-regarding-meilisearch-error-after-upgrading-to-sumac/17672/2?
This might resolve your issue.

1 Like

Thanks for sharing the solution, it resolved my issue.

I ran those commands in this order:

tutor local stop

sudo rm -rf “$(tutor config printroot)/data/meilisearch”/*

tutor local start

tutor local exec lms ./manage.py lms shell -c "import search.meilisearch; search.meilisearch.create_indexes()"

tutor local run cms ./manage.py cms reindex_course –all –setup

tutor local run cms ./manage.py cms reindex_studio –experimental
2 Likes