apache/beam · error

strictness check failed

Error message

strictness check failed

What it means

When jobopts.Strict is enabled, the universal runner's Execute runs vet.Execute on the pipeline as a pre-flight validation before submitting to the endpoint. If vet returns any error, it is wrapped as 'strictness check failed'. It is a static-analysis gate, not a runtime pipeline failure.

Source

Thrown at sdks/go/pkg/beam/runners/universal/universal.go:54

)

func init() {
	// Note that we also _ import harness/init to setup the remote execution hook.
	beam.RegisterRunner("universal", Execute)
	beam.RegisterRunner("PortableRunner", Execute)
	beam.RegisterRunner("portable", Execute)
}

// Execute executes the pipeline on a universal beam runner.
func Execute(ctx context.Context, p *beam.Pipeline) (beam.PipelineResult, error) {
	if !beam.Initialized() {
		panic("Beam has not been initialized. Call beam.Init() before pipeline construction.")
	}

	if *jobopts.Strict {
		log.Info(ctx, "Strict mode enabled, applying additional validation.")
		if _, err := vet.Execute(ctx, p); err != nil {
			return nil, errors.Wrap(err, "strictness check failed")
		}
		log.Info(ctx, "Strict mode validation passed.")
	}

	endpoint, err := jobopts.GetEndpoint()
	if err != nil {
		return nil, err
	}

	edges, _, err := p.Build()
	if err != nil {
		return nil, err
	}
	envUrn := jobopts.GetEnvironmentUrn(ctx)
	getEnvCfg := jobopts.GetEnvironmentConfig

	if jobopts.IsLoopback() {
		// TODO(BEAM-10610): Allow user configuration of this port, rather than kernel selected.

View on GitHub (pinned to 12126d8942)

Solutions

  1. Read the wrapped underlying vet error to identify the concrete problem and fix it in the pipeline.
  2. Register all DoFns and functions with the beam/register package.
  3. If strict mode was enabled unintentionally, unset the strict job option and relaunch.
  4. Keep the pipeline free of constructs vet flags as non-performant.

Example fix

// before
beam.Init() // strict enabled; pipeline has unregistered DoFn
// after
func init() { register.DoFn2x0[int, func(int)](&myDoFn{}) }
beam.Init()
Defensive patterns

Strategy: validation

Validate before calling

if *jobopts.StrictFlag {
	if _, err := vet.Execute(ctx, p); err != nil {
		log.Printf("strict pre-flight failed: %v", err)
		os.Exit(1)
	}
}

Try / catch

res, err := universal.Execute(ctx, p, opts...)
if err != nil && strings.Contains(err.Error(), "strictness check failed") {
	// inspect wrapped vet cause, fix pipeline, then retry
}

Prevention

When it happens

Trigger: Launching a pipeline with the strict option set (jobopts.Strict=true) while vet.Execute reports a problem, e.g. an unregistered DoFn or non-performant construct detected by vet.

Common situations: CI pipelines enable strict mode to catch reflection-based fallbacks before submission; a newly added DoFn or function was not registered with beam/register, tripping the vet check.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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