{"record":{"id":"7e015ad320f1072b","repo":"Significant-Gravitas/AutoGPT","slug":"unable-to-update-your-subscription-right-now-plea","errorCode":null,"errorMessage":"Unable to update your subscription right now. Please try again or contact support.","messagePattern":"Unable to update your subscription right now\\. Please try again or contact support\\.","errorType":"http","errorClass":"HTTPException","httpStatus":502,"severity":"error","filePath":"autogpt_platform/backend/backend/api/features/v1.py","lineNumber":1276,"sourceCode":"        # \"phases\" or absent on older error shapes — substring fallback keeps\n        # the 422 firing instead of dropping to the generic 502.\n        if e.param == \"currency\" or \"currency\" in msg_lower:\n            logger.warning(\n                \"Currency mismatch on tier change for user %s: %s\", user_id, e\n            )\n            raise HTTPException(\n                status_code=422,\n                detail=(\n                    \"Tier change unavailable for your current billing currency.\"\n                    \" Please contact support — the target tier needs to be\"\n                    \" configured for your currency in Stripe before this\"\n                    \" change can go through.\"\n                ),\n            )\n        logger.exception(\n            \"Stripe error modifying subscription for user %s: %s\", user_id, e\n        )\n        raise HTTPException(\n            status_code=502,\n            detail=(\n                \"Unable to update your subscription right now. \"\n                \"Please try again or contact support.\"\n            ),\n        )\n    except stripe.StripeError as e:\n        logger.exception(\n            \"Stripe error modifying subscription for user %s: %s\", user_id, e\n        )\n        raise HTTPException(\n            status_code=502,\n            detail=(\n                \"Unable to update your subscription right now. \"\n                \"Please try again or contact support.\"\n            ),\n        )\n","sourceCodeStart":1258,"sourceCodeEnd":1294,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/v1.py#L1258-L1294","documentation":"HTTP 502 raised as the terminal handler for any stripe.InvalidRequestError from modify_stripe_subscription_for_tier that matches none of the recognized shapes (no-payment-method, currency mismatch). The exception is logged via logger.exception ('Stripe error modifying subscription') and the client gets a generic retry-or-support message.","triggerScenarios":"A subscription modify that fails with an unclassified Stripe InvalidRequestError - e.g. an unsupported proration parameter, a customer/tax-id constraint, or a shape not covered by the param/substring matchers above.","commonSituations":"New Stripe API error shapes after an API version bump; unusual account configurations (tax settings, blocked charges); malformed internal state passed to Stripe.","solutions":["Check the backend log for the 'Stripe error modifying subscription' traceback - it contains the real Stripe message","Retry once in case it is transient","Report to support with the user ID; the underlying Stripe error is only visible server-side"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { await api.setSubscription(req); }\ncatch (e) { if (e.status === 502) { await backoff(); retryOnce(); } else throw e; }","preventionTips":["One bounded retry for 502s, then stop and surface support","Log the correlation/user ID for support to find the server-side traceback"],"tags":["stripe","subscription","http-502","upstream"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}