{"record":{"id":"a978f11fd9618631","repo":"apache/beam","slug":"unsupported-environment-v","errorCode":null,"errorMessage":"Unsupported environment %v","messagePattern":"Unsupported environment (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/dataflow/dataflow.go","lineNumber":475,"sourceCode":"\t\t\t}\n\t\t\treturn *workerHarnessImage\n\t\t}\n\t\tif *image != \"\" {\n\t\t\treturn *image\n\t\t}\n\t\tenvConfig := jobopts.GetEnvironmentConfig(ctx)\n\t\tif envConfig == core.DefaultDockerImage {\n\t\t\t// It's possible the user set the image exactly manually, but unlikely.\n\t\t\t// Prefer using the gcr.io image by default.\n\t\t\t// Note: This doesn't change the dev experience, which requires a user\n\t\t\t// to have a dev image.\n\t\t\t// However, RC versions should automatically be picked up, since\n\t\t\t// they are never tagged the RC number, just the main version.\n\t\t\treturn \"gcr.io/cloud-dataflow/v1beta3/beam_go_sdk:\" + core.SdkVersion\n\t\t}\n\t\treturn envConfig\n\t}\n\tpanic(fmt.Sprintf(\"Unsupported environment %v\", urn))\n}\n\nfunc checkSoftDeletePolicyEnabled(ctx context.Context, bucketName string, locationName string) {\n\tbucket, _, err := gcsx.ParseObject(bucketName)\n\tif err != nil {\n\t\tlog.Warnf(ctx, \"Error parsing bucket name: %v\", err)\n\t\treturn\n\t}\n\tclient, err := storage.NewClient(ctx)\n\tif err != nil {\n\t\tlog.Warnf(ctx, \"Error creating GCS client: %v\", err)\n\t\treturn\n\t}\n\tdefer client.Close()\n\n\tif enabled, errMsg := gcsx.SoftDeletePolicyEnabled(ctx, client, bucket); errMsg != nil {\n\t\tlog.Warnf(ctx, \"Error checking SoftDeletePolicy: %v\", errMsg)\n\t} else if enabled {","sourceCodeStart":457,"sourceCodeEnd":493,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/dataflow/dataflow.go#L457-L493","documentation":"getContainerImage only understands the Docker environment URN (beam:env:docker:v1) or an empty URN. If the pipeline's environment specifies any other URN, the Dataflow runner cannot map it to a container image and panics with the unsupported environment.","triggerScenarios":"Running a pipeline whose environment URN (from jobopts.GetEnvironmentUrn) is set to something other than \"\" or \"beam:env:docker:v1\", e.g. an external/process environment URN carried over from a portable pipeline.","commonSituations":"Cross-runner pipeline construction where the environment was configured for a portable runner (Flink/Spark URNs) and then submitted to Dataflow, or custom environments set programmatically via jobopts.","solutions":["Ensure the pipeline uses the default Docker environment for Dataflow (don't set a custom environment URN)","Clear or override the environment URN option before submitting to Dataflow","Only submit portable-environment pipelines to runners that support that URN","If a custom image is needed, use --sdk_container_image instead of a custom environment URN"],"exampleFix":"// before\nctx = beamjobopts.WithEnvironmentUrn(ctx, \"beam:env:process:v1\")\n// after\n// omit the custom URN so Dataflow defaults to beam:env:docker:v1","handlingStrategy":"validation","validationCode":"urn := jobopts.GetEnvironmentUrn(ctx)\nif urn != \"\" && urn != \"beam:env:docker:v1\" {\n    return fmt.Errorf(\"dataflow runner does not support environment %q\", urn)\n}","typeGuard":null,"tryCatchPattern":"func submitToDataflow(ctx context.Context, p *beam.Pipeline) (pr beam.PipelineResult, err error) {\n    defer func() { if r := recover(); r != nil { err = fmt.Errorf(\"unsupported environment: %v\", r) } }()\n    return dataflow.Execute(ctx, p)\n}","preventionTips":["Only set custom environment URNs for portable runners that support them","Use --sdk_container_image for custom images on Dataflow","Validate the environment URN before choosing a runner","Keep pipeline construction runner-agnostic and set the environment per-runner"],"tags":["dataflow","environment","unsupported"],"backgroundTag":"unsupported-enum-value","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"}