{"record":{"id":"5618bb837a2de53d","repo":"apache/beam","slug":"translation-failed","errorCode":null,"errorMessage":"translation failed","messagePattern":"translation failed","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/direct/direct.go","lineNumber":69,"sourceCode":"\tlog.Info(ctx, \"Pipeline:\")\n\tlog.Info(ctx, p)\n\tctx = metrics.SetBundleID(ctx, \"direct\") // Ensure a metrics.Store exists.\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\tedges, _, err := p.Build()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"invalid pipeline\")\n\t}\n\tplan, err := Compile(edges)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"translation failed\")\n\t}\n\tbeam.PipelineOptions.LoadOptionsFromFlags(nil)\n\tlog.Info(ctx, plan)\n\n\tif err = plan.Execute(ctx, \"\", exec.DataContext{}); err != nil {\n\t\tplan.Down(ctx) // ignore any teardown errors\n\t\treturn nil, err\n\t}\n\tif err = plan.Down(ctx); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn newDirectPipelineResult(ctx)\n}\n\ntype directPipelineResult struct {\n\tjobID   string\n\tmetrics *metrics.Results","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/direct/direct.go#L51-L87","documentation":"Once the graph builds, Execute compiles it into an executable plan via Compile(edges). Failures during translation (unsupported transform combination, missing coders, expansion failure of a unit) are wrapped as 'translation failed'. This sits between graph construction and actual execution.","triggerScenarios":"beam.Run on the direct runner where Compile(edges) cannot translate a built edge graph — e.g. an unsupported windowing/coder combination or a transform whose translation unit cannot be constructed.","commonSituations":"Using unusual windowing strategies or custom coders not supported by the direct runner; cross-language transforms reaching translation; pipelines built by graph manipulation APIs with inconsistent metadata; version mismatches between beam core packages.","solutions":["Read the inner error from Compile to see which edge/unit failed translation.","Check for unsupported features in the pipeline (custom windowing, external transforms, exotic coders) and simplify or switch runners.","Upgrade or align Apache Beam Go SDK versions so graph and runner packages match.","Reproduce with a minimal pipeline adding one transform at a time to isolate the offending construct."],"exampleFix":"// before\nw := window.NewCustomWindowing(myUnstableFn) // translator unsupported\nout := beam.WindowInto(s, w, col)\n// after\nout := beam.WindowInto(s, window.NewFixedWindows(time.Minute), col)","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if _, err := beam.Run(ctx, runner, p); err != nil && strings.Contains(err.Error(), \"translation failed\") {\n    log.Printf(\"unsupported construct for direct runner, see inner error: %v\", err)\n}","preventionTips":["Stick to standard windowing strategies and built-in coders on the direct runner.","Pin a single Beam SDK version across all go.mod requires.","Isolate new transforms in minimal pipelines first."],"tags":["go","beam","direct-runner","compilation","pipeline"],"backgroundTag":"internal-invariant-violation","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"}