{"record":{"id":"a05ce0ee92db24aa","repo":"apache/beam","slug":"no-google-cloud-region-specified-use-region-region-see-https","errorCode":null,"errorMessage":"no Google Cloud region specified. Use --region=<region>. See https://cloud.google.com/dataflow/docs/concepts/regional-endpoints","messagePattern":"no Google Cloud region specified\\. Use --region=<region>\\. See https://cloud\\.google\\.com/dataflow/docs/concepts/regional-endpoints","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/dataflow/dataflow.go","lineNumber":276,"sourceCode":"\nfunc isFlagPassed(name string) bool {\n\tfound := false\n\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","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/dataflow/dataflow.go#L258-L294","documentation":"The Dataflow runner requires a Google Cloud region because Dataflow is a regional service. getJobOptions calls gcpopts.GetRegion(ctx) and returns this error when neither the --region flag nor its environment fallback is set, linking to the regional-endpoints documentation.","triggerScenarios":"Executing a Dataflow pipeline without --region=<region> and without the environment/attribute fallback for region (e.g. GOOGLE_CLOUD_REGION or pipeline option) being set.","commonSituations":"Old scripts written before region became mandatory; multi-region orgs where the default region assumption no longer applies; CI environments missing the region variable.","solutions":["Pass --region=<region> (e.g. us-central1) to the pipeline","Export GOOGLE_CLOUD_REGION or set the region via gcpopts before Execute","Pick a region co-located with your GCS staging bucket to avoid cross-region costs"],"exampleFix":"// before\n--runner=dataflow --project=p --staging_location=gs://b/s\n// after\n--runner=dataflow --project=p --region=us-central1 --staging_location=gs://b/s","handlingStrategy":"validation","validationCode":"if region == \"\" {\n    return errors.New(\"set --region (e.g. us-central1)\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --region for Dataflow jobs","Keep region and staging bucket in the same region","Add region to CI variable templates"],"tags":["go","dataflow","gcp","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"}