Trailing slash problems in edx-enteprise and ecommerce

Date

Jun 16, 2022

Team(s)

Enterprise (Titans), Revenue, Arch/DEPR

Summary

An extraneous and missing trailing slash in enterprise and ecommerce URLs, respectively, led to maintenance pages and failed manual subscription enrollments

Impact

Enterprise learners blocked from accessing course content, enterprise licensed enrollments not created for pending learners.

Publicly-sharable lessons learned

  • We have no consistent guidelines for how Django service API endpoints are defined, particularly with regards to trailing slashes. More generally, we lack consistent guidelines for defining Django settings patterns across all our Django services.

  • Getting the owning teams of these DEPR/refactoring PRs time and resources to do more robust manual testing is very difficult.

    • Teams are already swamped with work., with many priorities to juggle. This change (the DEPR ticket) came lower down on the priority list.

Technical Cause and Resolution

Learners see a maintenance page when accessing courses after enrollment

Enterprise learners had failed manual enrollments (extraneous trailing slash)

  • Similar problem as above, except it’s a flow where enterprise is redirecting to ecommerce in an earlier step and there’s an extraneous slash when enterprise calls ecomm.

  • FWIW The erroneous change was deployed quite a while ago (early May??)

  • Why did the 405 happen? Conjecture:

    • There’s an endpoint that handles only POST requests in ecommerce like /api/v2/thing/

    • There’s also a related endpoints for GETs like /api/v2/thing

    • The modified enterprise code started making GET requests to /api/v2/thing/, but GET is not an allowed method for that particular URL/viewset.