Significant-Gravitas/AutoGPT · error · HTTPException

Unable to update your subscription right now. Please try aga

Error message

Unable to update your subscription right now. Please try again or contact support.

What it means

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.

Source

Thrown at autogpt_platform/backend/backend/api/features/v1.py:1276

        # "phases" or absent on older error shapes — substring fallback keeps
        # the 422 firing instead of dropping to the generic 502.
        if e.param == "currency" or "currency" in msg_lower:
            logger.warning(
                "Currency mismatch on tier change for user %s: %s", user_id, e
            )
            raise HTTPException(
                status_code=422,
                detail=(
                    "Tier change unavailable for your current billing currency."
                    " Please contact support — the target tier needs to be"
                    " configured for your currency in Stripe before this"
                    " change can go through."
                ),
            )
        logger.exception(
            "Stripe error modifying subscription for user %s: %s", user_id, e
        )
        raise HTTPException(
            status_code=502,
            detail=(
                "Unable to update your subscription right now. "
                "Please try again or contact support."
            ),
        )
    except stripe.StripeError as e:
        logger.exception(
            "Stripe error modifying subscription for user %s: %s", user_id, e
        )
        raise HTTPException(
            status_code=502,
            detail=(
                "Unable to update your subscription right now. "
                "Please try again or contact support."
            ),
        )

View on GitHub (pinned to 9c8bb5550f)

Solutions

  1. Check the backend log for the 'Stripe error modifying subscription' traceback - it contains the real Stripe message
  2. Retry once in case it is transient
  3. Report to support with the user ID; the underlying Stripe error is only visible server-side
Defensive patterns

Strategy: retry

Try / catch

try { await api.setSubscription(req); }
catch (e) { if (e.status === 502) { await backoff(); retryOnce(); } else throw e; }

Prevention

When it happens

Trigger: 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.

Common situations: New Stripe API error shapes after an API version bump; unusual account configurations (tax settings, blocked charges); malformed internal state passed to Stripe.

Related errors


AI-assisted analysis of Significant-Gravitas/AutoGPT@9c8bb5550f (2026-08-14). Data as JSON: /api/errors/7e015ad320f1072b. Report an issue: GitHub.