{"record":{"id":"36cbcaa80759d8dd","repo":"kubernetes/kops","slug":"project-is-required-for-gce-try-gcloud-config-ge","errorCode":null,"errorMessage":"project is required for GCE - try gcloud config get-value project","messagePattern":"project is required for GCE - try gcloud config get-value project","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/utils.go","lineNumber":61,"sourceCode":"\n\tregion := \"\"\n\tproject := \"\"\n\n\tswitch cluster.GetCloudProvider() {\n\tcase kops.CloudProviderGCE:\n\t\t{\n\t\t\tfor _, subnet := range cluster.Spec.Networking.Subnets {\n\t\t\t\tif subnet.Region != \"\" {\n\t\t\t\t\tregion = subnet.Region\n\t\t\t\t}\n\t\t\t}\n\t\t\tif region == \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"on GCE, subnets must include Regions\")\n\t\t\t}\n\n\t\t\tproject = cluster.Spec.CloudProvider.GCE.Project\n\t\t\tif project == \"\" {\n\t\t\t\treturn nil, fmt.Errorf(\"project is required for GCE - try gcloud config get-value project\")\n\t\t\t}\n\n\t\t\tclusterLabel := gce.LabelForCluster(cluster.ObjectMeta.Name)\n\t\t\tlabels := map[string]string{clusterLabel.Key: clusterLabel.Value}\n\n\t\t\tgceCloud, err := gce.NewGCECloud(region, project, labels)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tcloud = gceCloud\n\t\t}\n\n\tcase kops.CloudProviderAWS:\n\t\t{\n\t\t\tregion, err := awsup.FindRegion(cluster)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/utils.go#L43-L79","documentation":"A configuration validation in BuildCloud for GCE clusters: the region was resolved from subnets, but spec.cloudProvider.gce.project is empty, so kOps has no GCP project to target for authentication and resource operations. The message even suggests the gcloud command to find the correct project value.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/utils.go:61 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set spec.cloudProvider.gce.project to your GCP project ID (find it with: gcloud config get-value project)","Re-run the operation after kops edit cluster saves the project","Ensure application-default credentials are initialized too (gcloud auth application-default login)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}