{"record":{"id":"2b700c259e01ef24","repo":"apache/beam","slug":"no-gcs-staging-location-specified-use-staging-location-gs","errorCode":null,"errorMessage":"no GCS staging location specified. Use --staging_location=gs://<bucket>/<path>","messagePattern":"no GCS staging location specified\\. Use --staging_location=gs://<bucket>/<path>","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/dataflow/dataflow.go","lineNumber":279,"sourceCode":"\tflag.Visit(func(f *flag.Flag) {\n\t\tif f.Name == name {\n\t\t\tfound = true\n\t\t}\n\t})\n\treturn found\n}\n\nfunc getJobOptions(ctx context.Context, streaming bool) (*dataflowlib.JobOptions, error) {\n\tproject := gcpopts.GetProjectFromFlagOrEnvironment(ctx)\n\tif project == \"\" {\n\t\treturn nil, errors.New(\"no Google Cloud project specified. Use --project=<project>\")\n\t}\n\tregion := gcpopts.GetRegion(ctx)\n\tif region == \"\" {\n\t\treturn nil, errors.New(\"no Google Cloud region specified. Use --region=<region>. See https://cloud.google.com/dataflow/docs/concepts/regional-endpoints\")\n\t}\n\tif *stagingLocation == \"\" {\n\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)\")","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/dataflow/dataflow.go#L261-L297","documentation":"The Dataflow runner needs a GCS staging location (a gs:// bucket/path) to stage binaries, temp files, and job artifacts. getJobOptions returns this error when the --staging_location flag is empty. GCS is mandatory because Dataflow jobs run on Google-managed workers that read staged artifacts from the bucket.","triggerScenarios":"Executing a Dataflow pipeline without --staging_location=gs://<bucket>/<path> (the flag left at its default empty string).","commonSituations":"New pipelines where the developer set project/region but forgot staging; copying example commands that omit the flag; buckets existing but the flag never wired through in the launch script.","solutions":["Pass --staging_location=gs://<bucket>/<path> to the pipeline","Create the bucket first (gsutil mb gs://<bucket>) if it does not exist","Set the flag programmatically in the runner options before Execute"],"exampleFix":"// before\n--runner=dataflow --project=p --region=us-central1\n// after\n--runner=dataflow --project=p --region=us-central1 --staging_location=gs://my-bucket/staging","handlingStrategy":"validation","validationCode":"if !strings.HasPrefix(stagingLocation, \"gs://\") {\n    return errors.New(\"--staging_location must be gs://<bucket>/<path>\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Create and share the staging bucket before first deploy","Validate the gs:// prefix in launch scripts","Set staging location centrally in your pipeline options struct"],"tags":["go","dataflow","gcs","missing-config"],"backgroundTag":"missing-required-config-field","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"}