{"record":{"id":"899af0a700e4e78a","repo":"apache/beam","slug":"too-many-parameters-v","errorCode":null,"errorMessage":"too many parameters: %v","messagePattern":"too many parameters: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/funcx/signature.go","lineNumber":137,"sourceCode":"\tdefault:\n\t\tvalue := reflect.ValueOf(fn)\n\t\tif value.Kind() != reflect.Func {\n\t\t\treturn errors.Errorf(\"not a function: %v\", value)\n\t\t}\n\t\ttyp = value.Type()\n\t}\n\tfor i := 0; i < typ.NumIn(); i++ {\n\t\tin = append(in, typ.In(i))\n\t}\n\tfor i := 0; i < typ.NumOut(); i++ {\n\t\tout = append(out, typ.Out(i))\n\t}\n\tif len(in) < len(sig.Args) || len(out) < len(sig.Return) {\n\t\treturn errors.Errorf(\"not enough required parameters: %v\", typ)\n\t}\n\n\tif len(in) > len(sig.Args)+len(sig.OptArgs) || len(out) > len(sig.Return)+len(sig.OptReturn) {\n\t\treturn errors.Errorf(\"too many parameters: %v\", typ)\n\t}\n\n\t// (1) Create generic binding. If inconsistent, reject fn. We do not allow\n\t// optional parameters to be _defining_ generic to avoid ambiguity here.\n\n\tm := make(map[string]reflect.Type)\n\toff := len(in) - len(sig.Args)\n\tif err := bind(in[off:], sig.Args, m); err != nil {\n\t\treturn err\n\t}\n\tif err := bind(out[:len(sig.Return)], sig.Return, m); err != nil {\n\t\treturn err\n\t}\n\n\t// (2) Check satisfiability under binding.\n\n\tif err := matchReq(in[off:], sig.Args); err != nil {\n\t\treturn err","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/funcx/signature.go#L119-L155","documentation":"Satisfy returns this error when a function has more input parameters than sig.Args plus sig.OptArgs, or more return values than sig.Return plus sig.OptReturn. The signature model only allows optional parameters up to a declared maximum; anything beyond that cannot be bound and the function is rejected.","triggerScenarios":"Calling Satisfy/MustSatisfy with a function that has extra parameters or extra return values beyond what the Signature declares (required + optional), e.g. a 3-return function validated against a 2-return signature with no OptReturn.","commonSituations":"Adding a debug/logging parameter or an extra return value to a DoFn method without updating the Signature; using a generic wrapper function with more outs than the framework expects; copy-pasting a function from a different signature context.","solutions":["Remove the surplus parameters or return values from the function.","Extend the Signature: add OptArgs/OptReturn entries (or additional required Args) to cover the extra parameters.","Choose a different predefined Signature that matches the function's actual arity."],"exampleFix":"// before\nfunc fmt(x int) (int, error, string) { return x, nil, \"\" } // 3 returns, signature allows 2\n// after\nfunc fmt(x int) (int, error) { return x, nil }","handlingStrategy":"validation","validationCode":"t := reflect.TypeOf(fn)\nif t.NumIn() > len(sig.Args)+len(sig.OptArgs) || t.NumOut() > len(sig.Return)+len(sig.OptReturn) {\n    return fmt.Errorf(\"fn %v exceeds sig %v arity\", t, sig)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never add ad-hoc parameters or return values to DoFn methods without updating the Signature.","Move auxiliary values into structs instead of extra returns.","Review function signatures when upgrading Beam versions."],"tags":["go","beam","signature-validation","reflection"],"backgroundTag":"invalid-argument-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}