mitodl / edx-platform

The Open edX platform, the software that powers edX!
http://open.edx.org/
GNU Affero General Public License v3.0
6 stars 1 forks source link

CourseOverview.DoesNotExist #291

Open sentry-io[bot] opened 2 years ago

sentry-io[bot] commented 2 years ago

A missing CourseOverview should not crash the dashboard page. The error should be clearly logged, but the learner should still be able to load their dashboard.

Sentry Issue: OPENEDX-RESIDENTIAL-44A

CourseOverview.DoesNotExist: 
(14 additional frame(s) were not displayed)
...
  File "main.html.py", line 325, in render_body
    __M_writer(filters.decode.utf8(self.body()))
  File "dashboard.html.py", line 225, in render_body
    course_overview = CourseOverview.get_from_id(enrollment.course_id)
  File "openedx/core/lib/cache_utils.py", line 74, in decorator
    result = wrapped(*args, **kwargs)
  File "openedx/core/djangoapps/content/course_overviews/models.py", line 401, in get_from_id
    return course_overview or cls.load_from_module_store(course_id)
  File "openedx/core/djangoapps/content/course_overviews/models.py", line 343, in load_from_module_store
    raise cls.DoesNotExist()
pdpinch commented 2 years ago

@arslanashraf7 are you already working on this? Will your PR https://github.com/openedx/edx-platform/pull/29834 fix it?

arslanashraf7 commented 2 years ago

@pdpinch It is different than the other issue although in both cases the issue is CourseOverview object not available and the course is also not available in mongo.

In the PR you mentioned we caught and logged this exception inside the credit_service which updates the credits for a course for a student based on proctored exams. Somehow I'm seeing 500 response from Github on my PR file changes you mentioned but you can see the changes in this comparison link

This issue is related to the dashboard when it tried to load the enrolled courses and doesn't find the course. This is where it tries to do it. I also tried to reproduce it but the course just doesn't show on the dashboard locally without this error.

Based on the sentry logs I think the main problem here is the caching of APIs. Can be seen in cache_utils.

Did you happen to notice the steps in which it happens?

pdpinch commented 2 years ago

I couldn't tell you exactly, but it's happened on our Residential LMS. We had users enroll in courses in 2021, and then at the end of the year, we delete some of those courses. When those users return some of them get this error.

Is there a command to clear that cache? Maybe we should run that after the courses are deleted.

asadiqbal08 commented 2 years ago

@arslanashraf7 I was busy in provisioning Devstack, I just saw these comments and thinking as you worked over it earlier so you can either close it if nothing is producible or would you like to guide us about the command for clearing cache ?