{"record":{"id":"db0f503b43424fa5","repo":"SigNoz/signoz","slug":"codeinvalidinput-db0f50","errorCode":"CodeInvalidInput","errorMessage":"failed to marshal checkout payload","messagePattern":"failed to marshal checkout payload","errorType":"error_code","errorClass":null,"httpStatus":400,"severity":"error","filePath":"ee/licensing/httplicensing/provider.go","lineNumber":198,"sourceCode":"\t\tanalyticstypes.Group{\n\t\t\tUserId:  \"stats_\" + organizationID.String(),\n\t\t\tGroupId: organizationID.String(),\n\t\t\tTraits:  analyticstypes.NewTraitsFromMap(stats),\n\t\t},\n\t)\n\n\treturn nil\n}\n\nfunc (provider *provider) Checkout(ctx context.Context, organizationID valuer.UUID, postableSubscription *licensetypes.PostableSubscription) (*licensetypes.GettableSubscription, error) {\n\tactiveLicense, err := provider.GetActive(ctx, organizationID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbody, err := json.Marshal(postableSubscription)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, errors.TypeInvalidInput, errors.CodeInvalidInput, \"failed to marshal checkout payload\")\n\t}\n\n\tresponse, err := provider.zeus.GetCheckoutURL(ctx, activeLicense.Key, body)\n\tif err != nil {\n\t\tif errors.Ast(err, errors.TypeAlreadyExists) {\n\t\t\treturn nil, errors.WithAdditionalf(err, \"checkout has already been completed for this account. Please click 'Refresh Status' to sync your subscription\")\n\t\t}\n\t\treturn nil, err\n\t}\n\n\treturn &licensetypes.GettableSubscription{RedirectURL: gjson.GetBytes(response, \"url\").String()}, nil\n}\n\nfunc (provider *provider) Portal(ctx context.Context, organizationID valuer.UUID, postableSubscription *licensetypes.PostableSubscription) (*licensetypes.GettableSubscription, error) {\n\tactiveLicense, err := provider.GetActive(ctx, organizationID)\n\tif err != nil {\n\t\treturn nil, err\n\t}","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/ee/licensing/httplicensing/provider.go#L180-L216","documentation":"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).","triggerScenarios":"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.","commonSituations":"Plan fields computed from empty state producing NaN; downstream code inserting func values into the subscription struct; partial upgrade leaving new unsupported field types.","solutions":["Sanitize numeric plan/quota fields (replace NaN/Inf with defaults) before Checkout","Validate the postableSubscription struct contents (no zero NaN floats, no func/chan fields)","Upgrade SigNoz EE if the payload builder is buggy for your plan type","Log the marshal error to identify the offending field via %v of the wrapped cause"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"sanitized := postableSubscription\nfor 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\") } }","typeGuard":null,"tryCatchPattern":"if _, err := licensing.Checkout(ctx, orgID); err != nil { if errors.Ast(err, errors.CodeInvalidInput) { return 400 with guidance } }","preventionTips":["Default unset numeric plan fields instead of leaving NaN","Test checkout flow in staging after upgrades"],"tags":["signoz","licensing","checkout","json-marshal","validation"],"backgroundTag":"serialization-failure","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}