{"record":{"id":"2f2554f97b72d279","repo":"apache/beam","slug":"strictness-check-failed-universal","errorCode":null,"errorMessage":"strictness check failed","messagePattern":"strictness check failed","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/universal/universal.go","lineNumber":54,"sourceCode":")\n\nfunc init() {\n\t// Note that we also _ import harness/init to setup the remote execution hook.\n\tbeam.RegisterRunner(\"universal\", Execute)\n\tbeam.RegisterRunner(\"PortableRunner\", Execute)\n\tbeam.RegisterRunner(\"portable\", Execute)\n}\n\n// Execute executes the pipeline on a universal beam runner.\nfunc Execute(ctx context.Context, p *beam.Pipeline) (beam.PipelineResult, error) {\n\tif !beam.Initialized() {\n\t\tpanic(\"Beam has not been initialized. Call beam.Init() before pipeline construction.\")\n\t}\n\n\tif *jobopts.Strict {\n\t\tlog.Info(ctx, \"Strict mode enabled, applying additional validation.\")\n\t\tif _, err := vet.Execute(ctx, p); err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"strictness check failed\")\n\t\t}\n\t\tlog.Info(ctx, \"Strict mode validation passed.\")\n\t}\n\n\tendpoint, err := jobopts.GetEndpoint()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tedges, _, err := p.Build()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tenvUrn := jobopts.GetEnvironmentUrn(ctx)\n\tgetEnvCfg := jobopts.GetEnvironmentConfig\n\n\tif jobopts.IsLoopback() {\n\t\t// TODO(BEAM-10610): Allow user configuration of this port, rather than kernel selected.","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/universal/universal.go#L36-L72","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read the wrapped underlying vet error to identify the concrete problem and fix it in the pipeline.","Register all DoFns and functions with the beam/register package.","If strict mode was enabled unintentionally, unset the strict job option and relaunch.","Keep the pipeline free of constructs vet flags as non-performant."],"exampleFix":"// before\nbeam.Init() // strict enabled; pipeline has unregistered DoFn\n// after\nfunc init() { register.DoFn2x0[int, func(int)](&myDoFn{}) }\nbeam.Init()","handlingStrategy":"validation","validationCode":"if *jobopts.StrictFlag {\n\tif _, err := vet.Execute(ctx, p); err != nil {\n\t\tlog.Printf(\"strict pre-flight failed: %v\", err)\n\t\tos.Exit(1)\n\t}\n}","typeGuard":null,"tryCatchPattern":"res, err := universal.Execute(ctx, p, opts...)\nif err != nil && strings.Contains(err.Error(), \"strictness check failed\") {\n\t// inspect wrapped vet cause, fix pipeline, then retry\n}","preventionTips":["Run vet locally before enabling strict mode in CI.","Register every DoFn/function with beam/register.","Only enable strict mode once the pipeline passes vet locally."],"tags":["go","beam","validation","strict-mode"],"backgroundTag":"schema-validation-failed","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}