{"record":{"id":"cfcfbe66a0f40eb8","repo":"apache/beam","slug":"provided-transform-name-mapping-without-setting-the-update","errorCode":null,"errorMessage":"provided transform_name_mapping without setting the --update flag, so the pipeline would not be updated","messagePattern":"provided transform_name_mapping without setting the --update flag, so the pipeline would not be updated","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/dataflow/dataflow.go","lineNumber":313,"sourceCode":"\tif *autoscalingAlgorithm != \"\" {\n\t\tif *autoscalingAlgorithm != \"NONE\" && *autoscalingAlgorithm != \"THROUGHPUT_BASED\" {\n\t\t\treturn nil, errors.New(\"invalid autoscaling algorithm. Use --autoscaling_algorithm=(NONE|THROUGHPUT_BASED)\")\n\t\t}\n\t}\n\n\tif *flexRSGoal != \"\" {\n\t\tswitch *flexRSGoal {\n\t\tcase \"FLEXRS_UNSPECIFIED\", \"FLEXRS_SPEED_OPTIMIZED\", \"FLEXRS_COST_OPTIMIZED\":\n\t\t\t// valid values\n\t\tdefault:\n\t\t\treturn nil, errors.Errorf(\"invalid flex resource scheduling goal. Got %q; Use --flexrs_goal=(FLEXRS_UNSPECIFIED|FLEXRS_SPEED_OPTIMIZED|FLEXRS_COST_OPTIMIZED)\", *flexRSGoal)\n\t\t}\n\t}\n\tif !streaming && *transformMapping != \"\" {\n\t\treturn nil, errors.New(\"provided transform_name_mapping for a batch pipeline, did you mean to construct a streaming pipeline?\")\n\t}\n\tif !*update && *transformMapping != \"\" {\n\t\treturn nil, errors.New(\"provided transform_name_mapping without setting the --update flag, so the pipeline would not be updated\")\n\t}\n\tvar updateTransformMapping map[string]string\n\tif *transformMapping != \"\" {\n\t\tif err := json.Unmarshal([]byte(*transformMapping), &updateTransformMapping); err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"error reading --transform_name_mapping flag as JSON\")\n\t\t}\n\t}\n\tif *usePublicIPs == *noUsePublicIPs {\n\t\tuseSet := isFlagPassed(\"use_public_ips\")\n\t\tnoUseSet := isFlagPassed(\"no_use_public_ips\")\n\t\t// If use_public_ips was explicitly set but no_use_public_ips was not, use that value\n\t\t// We take the explicit value of no_use_public_ips if it was set but use_public_ips was not.\n\t\tif useSet && !noUseSet {\n\t\t\t*noUsePublicIPs = !*usePublicIPs\n\t\t} else if useSet && noUseSet {\n\t\t\treturn nil, errors.New(\"exactly one of usePublicIPs and noUsePublicIPs must be true, please check that only one is true\")\n\t\t}\n\t}","sourceCodeStart":295,"sourceCodeEnd":331,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/dataflow/dataflow.go#L295-L331","documentation":"Setting --transform_name_mapping only has an effect when updating an existing job. getJobOptions rejects a mapping provided without --update, because the mapping would be ignored and the pipeline would run as a new job instead of an update — silently breaking the user's intent.","triggerScenarios":"Passing --transform_name_mapping=<json> without --update on a streaming pipeline.","commonSituations":"Forgetting --update when re-running a job with renamed transforms intending an in-place update; scripts where the update flag is toggled by condition but the mapping flag is always set.","solutions":["Add --update to the pipeline invocation when a transform_name_mapping is supplied","Remove --transform_name_mapping if a fresh job (not an update) was intended","Gate the mapping flag together with the update flag in launch scripts"],"exampleFix":"// before\n--transform_name_mapping='{\"old\":\"new\"}'\n// after\n--update --transform_name_mapping='{\"old\":\"new\"}'","handlingStrategy":"validation","validationCode":"if transformMapping != \"\" && !update {\n    return errors.New(\"--update is required with --transform_name_mapping\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pair --update with --transform_name_mapping","Gate both flags together in launch scripts"],"tags":["go","dataflow","cli-flag","missing-flag"],"backgroundTag":"missing-required-flag","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"}