Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EdxApiEnrollErrorException: EdX API error enrolling user in course run 'course-v1:MI... #1768

Closed
sentry-io bot opened this issue Jul 21, 2023 · 4 comments
Assignees

Comments

@sentry-io
Copy link

sentry-io bot commented Jul 21, 2023

This is an unacceptably large number of enrollment errors. What's going on?

Sentry Issue: MITXONLINE-2NR

HTTPError: 400 Client Error: Bad Request for url: https://courses.mitxonline.mit.edu/api/enrollment/v1/enrollment
  File "openedx/api.py", line 684, in enroll_in_edx_course_runs
    enrollment = edx_client.enrollments.create_student_enrollment(

EdxApiEnrollErrorException: EdX API error enrolling user dkamanga ([email protected]) in course run 'course-v1:MITxT+15.671.1x+2T2023'.
Response - code: 400, content: {"message":"The [verified] course mode is expired or otherwise unavailable for course run [course-v1:MITxT+15.671.1x+2T2023].","course_details":{"course_id":"course-v1:MITxT+15.671.1x+2T2023","course_name":"u-lab: Leading From the Emerging Future","enrollment_start":"2023-06-15T15:00:00Z","enrollment_end":"2024-03-16T15:00:00Z","course_start":"2023-08-31T1...
  File "openedx/api.py", line 718, in retry_failed_edx_enrollments
    enroll_in_edx_course_runs(
  File "openedx/api.py", line 692, in enroll_in_edx_course_runs
    raise EdxApiEnrollErrorException(user, course_run, exc) from exc

EdX API error enrolling user dkamanga ([email protected]) in course run 'course-v1:MITxT+15.671.1x+2T2023'.
Response - code: 400, content: {"message":"The [verified] course mode is expired or otherwise unavailable for course run [course-v1:MITxT+15.671.1x+2T2023].","course_details":{"course_id":"course-v1:MITxT+15.671.1x+2T2023","course_name":"u-lab: Leading From the Emerging Future","enrollment_start":"2023-06-15T15:00:00Z","enrollment_end":"2024-03-16T15:00:00Z","course_start":"2023-08-31T1...
@pdpinch pdpinch changed the title EdxApiEnrollErrorException: EdX API error enrolling user dkamanga ([email protected]) in course run 'course-v1:MI... EdxApiEnrollErrorException: EdX API error enrolling user in course run 'course-v1:MI... Jul 21, 2023
@rachellougee rachellougee self-assigned this Aug 28, 2023
@rachellougee
Copy link
Contributor

rachellougee commented Aug 28, 2023

There are 10 enrollment errors EdxApiEnrollErrorException on production (sentry link) , 8 of those are related to course-v1:MITxT+3.034.1x+1T2023 because of no verified course mode for this run on open edx yet (course mode), these learners are upgraded and paid on mitxonline, but we can't enroll them in verified mode on open edx side

@pdpinch How is verified course mode added to open edx? Does someone have to manually add it?

@pdpinch
Copy link
Member

pdpinch commented Aug 28, 2023

How is verified course mode added to open edx? Does someone have to manually add it?

Yes, it has to be added manually. As far as I know, there's no API.

I think this course was created before we enabled ecommerce, so we didn't follow the new course creation process (described here and here).

@rachellougee
Copy link
Contributor

rachellougee commented Aug 28, 2023

The enrollment errors for course-v1:MITxT+3.034.1x+1T2023 are fixed on production

The only error left on production is https://mit-office-of-digital-learning.sentry.io/issues/3990550319/events/be1fa56f02e845b99ed483c812e51c72/?project=5864687, it looks like this user's IP was blocked on open edx, but this user was able to enroll in course-v1:MITxT+8.EFTx+3T2022 from MITx Online on 2023-05-16 because his legal address country isn't listed as blocked country here? @pdpinch How should we fix this? Should I look into this? Beside this error, It should be all set for production

@rachellougee
Copy link
Contributor

I've added 3 failed enrollments for this user on open edx to stop the recurring errors since his other two enrollments were synced fine. The production errors are cleared now.

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

No branches or pull requests

2 participants