{"record":{"id":"7406886ec87cb019","repo":"apache/beam","slug":"no-google-cloud-project-specified-use-project-project","errorCode":null,"errorMessage":"no Google Cloud project specified. Use --project=<project>","messagePattern":"no Google Cloud project specified\\. Use --project=<project>","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/dataflow/dataflow.go","lineNumber":272,"sourceCode":"\t}\n\n\treturn dataflowlib.Execute(ctx, model, opts, workerURL, modelURL, *endpoint, *jobopts.Async)\n}\n\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","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/dataflow/dataflow.go#L254-L290","documentation":"The Dataflow runner's getJobOptions requires a Google Cloud project to create the job. It first tries gcpopts.GetProjectFromFlagOrEnvironment (the --project flag or GOOGLE_CLOUD_PROJECT env var); when both are empty it returns this error before any API call is made.","triggerScenarios":"Executing a pipeline with runner=dataflow without --project=<project> and with the GOOGLE_CLOUD_PROJECT environment variable unset.","commonSituations":"Local shells or CI containers where GOOGLE_CLOUD_PROJECT is not exported; running the dataflow runner accidentally (misconfigured --runner) without GCP setup.","solutions":["Pass --project=<my-gcp-project> to the pipeline","Export GOOGLE_CLOUD_PROJECT=my-gcp-project in the environment","Verify the runner is really dataflow if you did not intend a GCP submission"],"exampleFix":"// before\ngo run pipeline.go --runner=dataflow --region=us-central1 --staging_location=gs://b/s\n// after\ngo run pipeline.go --runner=dataflow --project=my-gcp-project --region=us-central1 --staging_location=gs://b/s\n# or: export GOOGLE_CLOUD_PROJECT=my-gcp-project","handlingStrategy":"validation","validationCode":"if os.Getenv(\"GOOGLE_CLOUD_PROJECT\") == \"\" && projectFlag == \"\" {\n    return errors.New(\"set --project or GOOGLE_CLOUD_PROJECT\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Export GOOGLE_CLOUD_PROJECT in shells and CI images","Verify --runner=dataflow was intended before adding GCP flags"],"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"}