{"record":{"id":"d811377c018502d2","repo":"apache/beam","slug":"invalid-autoscaling-algorithm-use-autoscaling-algorithm-none","errorCode":null,"errorMessage":"invalid autoscaling algorithm. Use --autoscaling_algorithm=(NONE|THROUGHPUT_BASED)","messagePattern":"invalid autoscaling algorithm\\. Use --autoscaling_algorithm=\\(NONE\\|THROUGHPUT_BASED\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/dataflow/dataflow.go","lineNumber":297,"sourceCode":"\t\treturn nil, errors.New(\"no GCS staging location specified. Use --staging_location=gs://<bucket>/<path>\")\n\t}\n\n\tcheckSoftDeletePolicyEnabled(ctx, *stagingLocation, \"staging_location\")\n\n\tvar jobLabels map[string]string\n\tif *labels != \"\" {\n\t\tif err := json.Unmarshal([]byte(*labels), &jobLabels); err != nil {\n\t\t\treturn nil, errors.Wrapf(err, \"error reading --label flag as JSON\")\n\t\t}\n\t}\n\n\tif *cpuProfiling != \"\" {\n\t\tperf.EnableProfCaptureHook(\"gcs_profile_writer\", *cpuProfiling)\n\t}\n\n\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","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/dataflow/dataflow.go#L279-L315","documentation":"The --autoscaling_algorithm flag accepts only the values NONE or THROUGHPUT_BASED, matching Dataflow's AutoscalingAlgorithm enum. getJobOptions rejects any other string with this error before submitting the job.","triggerScenarios":"Setting --autoscaling_algorithm to a typo'd or wrong-cased value such as \"none\", \"throughput_based\", \"BASIC\", or \"automatic\".","commonSituations":"Porting configs from other runners whose autoscaling flags use different value sets; typos and lowercase values; generating the flag from a template with an unset placeholder.","solutions":["Use exactly --autoscaling_algorithm=NONE or --autoscaling_algorithm=THROUGHPUT_BASED","Remove the flag entirely if you want Dataflow's default autoscaling behavior","Add a validation step in launch scripts to whitelist the two values"],"exampleFix":"// before\n--autoscaling_algorithm=throughput_based\n// after\n--autoscaling_algorithm=THROUGHPUT_BASED","handlingStrategy":"validation","validationCode":"if a := autoscalingAlgorithm; a != \"\" && a != \"NONE\" && a != \"THROUGHPUT_BASED\" {\n    return fmt.Errorf(\"invalid --autoscaling_algorithm %q\", a)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only use the exact enum strings NONE and THROUGHPUT_BASED","Centralize the flag value in a typed constant/enum in your tooling"],"tags":["go","dataflow","cli-flag","invalid-enum"],"backgroundTag":"invalid-enum-value","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"}