Skip to content

Deleting a course fails to update the meilisearch index #233

Description

@AntonOfTheWoods

Deleting a course via the django command delete_course fails the meili part with:

`Attribute `course` is not filterable. Available filterable attribute patterns are: `catalog_visibility`, `enrollment_end`, `language`, `modes`, `org`.`

The course no longer appears in authoring but does still appear in https://{LMS}/courses.

Adding content to INDEX_FILTERABLES for course_info seems to fix the issue.

The stacktrace:

...
Are you sure you want to delete course course-v1:badorg+badcn+badcr? [y/N] y                                                                     
Are you sure? This action cannot be undone! [y/N] y                                                                                              
2025-10-25 09:38:08,145 INFO 75 [xmodule.modulestore.split_mongo.split] [user None] [ip None] split.py:2610 - deleting course from split-mongo: c
ourse-v1:badorg+badcn+badcr                                                                                                                      
2025-10-25 09:38:08,168 INFO 75 [search.meilisearch] [user None] [ip None] meilisearch.py:195 - Search query: opt_params={'showRankingScore': Tru
e, 'filter': ['course = "course-v1:badorg+badcn+badcr"', 'org = "badorg"']}                                                                      
2025-10-25 09:38:08,190 ERROR 75 [django.dispatch] [user None] [ip None] dispatcher.py:264 - Error calling listen_for_course_delete in Signal.sen
d_robust() (MeilisearchApiError. Error code: invalid_search_filter. Error message: Index `tutor_course_info`: Attribute `course` is not filterable. Available filterable attribute patterns are: `catalog_visibility`, `enrollment_end`, `language`, `modes`, `org`.                              
1:7 course = "course-v1:badorg+badcn+badcr". Hint: It might not be working because you're not up to date with the Meilisearch version that search
 call requires. Error documentation: https://docs.meilisearch.com/errors#invalid_search_filter Error type: invalid_request)                      
Traceback (most recent call last):                                                                                                               
  File "/openedx/venv/lib/python3.11/site-packages/meilisearch/_httprequests.py", line 224, in __validate                                        
    request.raise_for_status()                                                                                                                   
  File "/openedx/venv/lib/python3.11/site-packages/requests/models.py", line 1026, in raise_for_status
    raise HTTPError(http_error_msg, response=self)                                                                                               
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http://meilisearch:7700/indexes/tutor_course_info/search
...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions