SigNoz/signoz · error

CodeInvalidInput

CodeInvalidInput

Error message

failed to marshal checkout payload

What it means

Checkout() failed to json.Marshal the constructed postableSubscription before requesting a checkout URL from Zeus; wrapped as CodeInvalidInput (marshal failures on this payload indicate invalid field types such as NaN/Inf or unsupported values).

Source

Thrown at ee/licensing/httplicensing/provider.go:198

		analyticstypes.Group{
			UserId:  "stats_" + organizationID.String(),
			GroupId: organizationID.String(),
			Traits:  analyticstypes.NewTraitsFromMap(stats),
		},
	)

	return nil
}

func (provider *provider) Checkout(ctx context.Context, organizationID valuer.UUID, postableSubscription *licensetypes.PostableSubscription) (*licensetypes.GettableSubscription, error) {
	activeLicense, err := provider.GetActive(ctx, organizationID)
	if err != nil {
		return nil, err
	}

	body, err := json.Marshal(postableSubscription)
	if err != nil {
		return nil, errors.Wrapf(err, errors.TypeInvalidInput, errors.CodeInvalidInput, "failed to marshal checkout payload")
	}

	response, err := provider.zeus.GetCheckoutURL(ctx, activeLicense.Key, body)
	if err != nil {
		if errors.Ast(err, errors.TypeAlreadyExists) {
			return nil, errors.WithAdditionalf(err, "checkout has already been completed for this account. Please click 'Refresh Status' to sync your subscription")
		}
		return nil, err
	}

	return &licensetypes.GettableSubscription{RedirectURL: gjson.GetBytes(response, "url").String()}, nil
}

func (provider *provider) Portal(ctx context.Context, organizationID valuer.UUID, postableSubscription *licensetypes.PostableSubscription) (*licensetypes.GettableSubscription, error) {
	activeLicense, err := provider.GetActive(ctx, organizationID)
	if err != nil {
		return nil, err
	}

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Sanitize numeric plan/quota fields (replace NaN/Inf with defaults) before Checkout
  2. Validate the postableSubscription struct contents (no zero NaN floats, no func/chan fields)
  3. Upgrade SigNoz EE if the payload builder is buggy for your plan type
  4. Log the marshal error to identify the offending field via %v of the wrapped cause
Defensive patterns

Strategy: validation

Validate before calling

sanitized := postableSubscription
for k, f := range map[string]float64{"seats": sanitized.Seats} { if math.IsNaN(f) || math.IsInf(f, 0) { return errors.New(k + " must be a finite number") } }

Try / catch

if _, err := licensing.Checkout(ctx, orgID); err != nil { if errors.Ast(err, errors.CodeInvalidInput) { return 400 with guidance } }

Prevention

When it happens

Trigger: Calling licensing Checkout when the subscription payload contains values json.Marshal cannot encode (NaN, +Inf float fields, channels/funcs, cyclic references) — typically from unvalidated quota/plan numbers.

Common situations: Plan fields computed from empty state producing NaN; downstream code inserting func values into the subscription struct; partial upgrade leaving new unsupported field types.

Related errors


AI-assisted analysis of SigNoz/signoz@5069bf80b0 (2026-08-28). Data as JSON: /api/errors/db0f503b43424fa5. Report an issue: GitHub.