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 |
|
Technical Cause and Resolution
Learners see a maintenance page when accessing courses after enrollment
This ecommerce commit introduced a trailing slash to the enterprise data-sharing consent URL.
The enterprise URLs don’t contain trailing slashes and don’t automatically append them. (Links below if you’re curious about ways to handle this).
Result was that any redirects from the ecom basket page to the enterprise DSC flow encountered a 404 and purchases couldn’t be completed.
One-line fix: https://github.com/openedx/ecommerce/pull/3735
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.