{"record":{"id":"efaf2a0c69648bf6","repo":"kubernetes/kops","slug":"compute-project-q-did-not-have-defaultserviceacco","errorCode":null,"errorMessage":"compute project %q did not have DefaultServiceAccount","messagePattern":"compute project %q did not have DefaultServiceAccount","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/gce/gce_cloud.go","lineNumber":257,"sourceCode":"func (c *gceCloudImplementation) Project() string {\n\treturn c.project\n}\n\n// ServiceAccount returns the email address for the service account that the instances will run under.\nfunc (c *gceCloudImplementation) ServiceAccount() (string, error) {\n\tif c.projectInfo == nil {\n\t\t// Find the project info from the compute API, which includes the default service account\n\t\tklog.V(2).Infof(\"fetching project %q from compute API\", c.project)\n\t\tp, err := c.compute.Projects().Get(c.project)\n\t\tif err != nil {\n\t\t\treturn \"\", fmt.Errorf(\"error fetching info for project %q: %v\", c.project, err)\n\t\t}\n\n\t\tc.projectInfo = p\n\t}\n\n\tif c.projectInfo.DefaultServiceAccount == \"\" {\n\t\treturn \"\", fmt.Errorf(\"compute project %q did not have DefaultServiceAccount\", c.project)\n\t}\n\n\treturn c.projectInfo.DefaultServiceAccount, nil\n}\n\nfunc (c *gceCloudImplementation) DNS() (dnsprovider.Interface, error) {\n\tprovider, err := clouddns.CreateInterface(c.project, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error building (k8s) DNS provider: %v\", err)\n\t}\n\treturn provider, nil\n}\n\nfunc (c *gceCloudImplementation) FindVPCInfo(id string) (*fi.VPCInfo, error) {\n\tklog.Warningf(\"FindVPCInfo not (yet) implemented on GCE\")\n\treturn nil, nil\n}\n","sourceCodeStart":239,"sourceCodeEnd":275,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/gce/gce_cloud.go#L239-L275","documentation":"Validation guard in ServiceAccount: the project info was fetched successfully but DefaultServiceAccount is empty, meaning the GCE project has no default compute service account (e.g. it was disabled or the project uses only user-managed service accounts).","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/gce/gce_cloud.go:257 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Enable/recreate the default Compute Engine service account for the project","Or configure instances to use an explicit service account in the cluster spec"],"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"}