{"record":{"id":"7b6cab4fd62250cb","repo":"apache/beam","slug":"may-only-have-a-single-timer-provider-parameter-and-it-must","errorCode":null,"errorMessage":"may only have a single timer.Provider parameter and it must precede the main input parameter","messagePattern":"may only have a single timer\\.Provider parameter and it must precede the main input parameter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/funcx/fn.go","lineNumber":538,"sourceCode":"\tfor i, r := range u.Ret {\n\t\tif retState, err = nextRetState(retState, r.Kind); err != nil {\n\t\t\treturn errors.WithContextf(err, \"validating return value %d for %s\", i, u.Fn.Name())\n\t\t}\n\t}\n\treturn nil\n}\n\nvar (\n\terrContextParam                      = errors.New(\"may only have a single context.Context parameter and it must be the first parameter\")\n\terrPaneParamPrecedence               = errors.New(\"may only have a single PaneInfo parameter and it must precede the WindowParam, EventTime and main input parameter\")\n\terrWindowParamPrecedence             = errors.New(\"may only have a single Window parameter and it must precede the EventTime and main input parameter\")\n\terrEventTimeParamPrecedence          = errors.New(\"may only have a single beam.EventTime parameter and it must precede the main input parameter\")\n\terrWatermarkEstimatorParamPrecedence = errors.New(\"may only have a single sdf.WatermarkEstimator parameter and it must precede the main input parameter\")\n\terrReflectTypePrecedence             = errors.New(\"may only have a single reflect.Type parameter and it must precede the main input parameter\")\n\terrRTrackerPrecedence                = errors.New(\"may only have a single sdf.RTracker parameter and it must precede the main input parameter\")\n\terrBundleFinalizationPrecedence      = errors.New(\"may only have a single BundleFinalization parameter and it must precede the main input parameter\")\n\terrStateProviderPrecedence           = errors.New(\"may only have a single state.Provider parameter and it must precede the main input parameter\")\n\terrTimerProviderPrecedence           = errors.New(\"may only have a single timer.Provider parameter and it must precede the main input parameter\")\n\terrInputPrecedence                   = errors.New(\"inputs parameters must precede emit function parameters\")\n)\n\ntype paramState int\n\nconst (\n\tpsStart paramState = iota\n\tpsContext\n\tpsPane\n\tpsWindow\n\tpsEventTime\n\tpsWatermarkEstimator\n\tpsType\n\tpsInput\n\tpsOutput\n\tpsRTracker\n\tpsBundleFinalization\n\tpsStateProvider","sourceCodeStart":520,"sourceCodeEnd":556,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/funcx/fn.go#L520-L556","documentation":"Sentinel error errTimerProviderPrecedence from the funcx parameter state machine: a timers.Provider parameter occurred after the main input parameter (e.g. func(int, timers.Provider)) or more than once. Timer access must be a single parameter preceding the main element input.","triggerScenarios":"Thrown at sdks/go/pkg/beam/core/funcx/fn.go:538 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reorder timers.Provider to precede the main input parameter","Ensure only one timers.Provider parameter exists"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}