apache/beam · error

may only have a single sdf.WatermarkEstimator parameter and…

Error message

may only have a single sdf.WatermarkEstimator parameter and it must precede the main input parameter

What it means

Sentinel error errWatermarkEstimatorParamPrecedence returned by the funcx parameter-ordering state machine (nextParamState) when validating a DoFn's signature. A sdf.WatermarkEstimator parameter appeared after the main input parameter or more than one was present; Beam requires the watermark estimator (if used) to be a single parameter preceding the main element input.

Solutions

  1. Move the sdf.WatermarkEstimator parameter before the main input parameter in the DoFn method signature
  2. Remove the duplicate watermark estimator parameter so at most one exists
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at sdks/go/pkg/beam/core/funcx/fn.go:533 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/029849e98c9a25f0. Report an issue: GitHub.

Appendix: source

Thrown at sdks/go/pkg/beam/core/funcx/fn.go:533

			return errors.WithContextf(err, "validating parameter %d for %s", i, u.Fn.Name())
		}
	}
	// Validate the return value ordering.
	retState := rsStart
	for i, r := range u.Ret {
		if retState, err = nextRetState(retState, r.Kind); err != nil {
			return errors.WithContextf(err, "validating return value %d for %s", i, u.Fn.Name())
		}
	}
	return nil
}

var (
	errContextParam                      = errors.New("may only have a single context.Context parameter and it must be the first parameter")
	errPaneParamPrecedence               = errors.New("may only have a single PaneInfo parameter and it must precede the WindowParam, EventTime and main input parameter")
	errWindowParamPrecedence             = errors.New("may only have a single Window parameter and it must precede the EventTime and main input parameter")
	errEventTimeParamPrecedence          = errors.New("may only have a single beam.EventTime parameter and it must precede the main input parameter")
	errWatermarkEstimatorParamPrecedence = errors.New("may only have a single sdf.WatermarkEstimator parameter and it must precede the main input parameter")
	errReflectTypePrecedence             = errors.New("may only have a single reflect.Type parameter and it must precede the main input parameter")
	errRTrackerPrecedence                = errors.New("may only have a single sdf.RTracker parameter and it must precede the main input parameter")
	errBundleFinalizationPrecedence      = errors.New("may only have a single BundleFinalization parameter and it must precede the main input parameter")
	errStateProviderPrecedence           = errors.New("may only have a single state.Provider parameter and it must precede the main input parameter")
	errTimerProviderPrecedence           = errors.New("may only have a single timer.Provider parameter and it must precede the main input parameter")
	errInputPrecedence                   = errors.New("inputs parameters must precede emit function parameters")
)

type paramState int

const (
	psStart paramState = iota
	psContext
	psPane
	psWindow
	psEventTime
	psWatermarkEstimator
	psType

View on GitHub (pinned to 12126d8942)