{"record":{"id":"c97a1387cc0f85fb","repo":"apache/beam","slug":"fn-does-not-satisfy-signature-v","errorCode":null,"errorMessage":"fn does not satisfy signature %v","messagePattern":"fn does not satisfy signature (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/funcx/signature.go","lineNumber":232,"sourceCode":"\t\t\t\treturn errors.Errorf(\"optional generic parameter not bound %v\", t.Name())\n\t\t\t}\n\t\t\tt = subst\n\t\t}\n\t\tfor i < len(models) && models[i] != t {\n\t\t\ti++\n\t\t}\n\n\t\tif i == len(models) {\n\t\t\treturn errors.Errorf(\"failed to match optional parameter %v\", t)\n\t\t}\n\t}\n\treturn nil\n}\n\n// MustSatisfy panics if the given fn does not satisfy the signature.\nfunc MustSatisfy(fn any, sig *Signature) {\n\tif err := Satisfy(fn, sig); err != nil {\n\t\tpanic(errors.Wrapf(err, \"fn does not satisfy signature %v\", sig))\n\t}\n}\n","sourceCodeStart":214,"sourceCodeEnd":235,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/funcx/signature.go#L214-L235","documentation":"MustSatisfy wraps any error returned by Satisfy in a panic carrying the message 'fn does not satisfy signature %v'. It is the panicking variant used by callers (Partition, Include, Exclude, validate) that treat a signature mismatch as a programmer error rather than a recoverable condition.","triggerScenarios":"Calling MustSatisfy (directly or via beam.Partition/Include/Exclude) with any function that fails arity, generic binding, or optional matching checks - the underlying Satisfy error is wrapped and panicked.","commonSituations":"Using beam.Partition with a partition function of wrong arity or return count; passing a filter function to Include/Exclude with wrong input/output types; programming errors caught at pipeline-construction time.","solutions":["Read the wrapped cause (the Satisfy error) in the panic message and fix the function's parameters/returns accordingly.","Call Satisfy instead of MustSatisfy to get a recoverable error for validation.","Compare the function signature against the required Signature definition for the API being used."],"exampleFix":"// before\nbeam.Partition(s, 3, func(e int) int { return e % 3 }) // ok, but fn missing error return fails MustSatisfy\n// after\nbeam.Partition(s, 3, func(e int) (int, error) { return e % 3, nil })","handlingStrategy":"try-catch","validationCode":"if err := funcx.Satisfy(fn, sig); err != nil {\n    return fmt.Errorf(\"registration would panic: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"defer func() {\n    if r := recover(); r != nil {\n        err = fmt.Errorf(\"MustSatisfy panic: %v\", r)\n    }\n}()","preventionTips":["Prefer Satisfy over MustSatisfy in non-test code to get a recoverable error.","Validate user-supplied functions before calling Partition/Include/Exclude.","Keep a unit test that exercises every registered function through its API entry point."],"tags":["go","beam","panic","signature-validation"],"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-20T03:17:13.778Z"}