{"record":{"id":"bc7cc5c0173ad971","repo":"kubernetes/kops","slug":"vpc-not-yet-created","errorCode":null,"errorMessage":"vpc not yet created..","messagePattern":"vpc not yet created\\.\\.","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/do/cloud.go","lineNumber":258,"sourceCode":"\treturn nil, errors.New(\"not implemented\")\n}\n\nfunc (c *doCloudImplementation) GetVPCUUID(networkCIDR string, vpcName string) (string, error) {\n\tvpcUUID := \"\"\n\tdone, err := vfs.RetryWithBackoff(readBackoff, func() (bool, error) {\n\t\tvpcs, err := c.GetAllVPCs()\n\t\tif err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\tfor _, vpc := range vpcs {\n\t\t\tif vpc.IPRange == networkCIDR && vpc.Name == vpcName {\n\t\t\t\tvpcUUID = vpc.ID\n\t\t\t\treturn true, nil\n\t\t\t}\n\t\t}\n\n\t\treturn false, fmt.Errorf(\"vpc not yet created..\")\n\t})\n\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif done {\n\t\treturn vpcUUID, nil\n\t} else {\n\t\treturn \"\", wait.ErrWaitTimeout\n\t}\n}\n\nfunc (c *doCloudImplementation) GetApiIngressStatus(cluster *kops.Cluster) ([]fi.ApiIngressStatus, error) {\n\tvar ingresses []fi.ApiIngressStatus\n\tdone, err := vfs.RetryWithBackoff(readBackoff, func() (bool, error) {\n\t\t// Note that this must match Digital Ocean's lb name\n\t\tklog.V(2).Infof(\"Querying DO to find Loadbalancers for API (%q)\", cluster.Name)","sourceCodeStart":240,"sourceCodeEnd":276,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/do/cloud.go#L240-L276","documentation":"GetVPCUUID polls (via vfs.RetryWithBackoff) the list of DigitalOcean VPCs looking for one whose IP range equals the cluster networkCIDR and whose name equals vpcName. Each time no match is found, the retry closure returns this sentinel error so the backoff loop retries; if the VPC never appears, the error surfaces to the caller after retries are exhausted.","triggerScenarios":"GetVPCUUID(networkCIDR, vpcName) is called during cluster creation and no existing VPC matches both the exact CIDR and the exact name — typically because the VPC has not been created yet, or the name/CIDR don't match what DO returned.","commonSituations":"Cluster creation racing VPC provisioning; a pre-created VPC whose name or CIDR differs from the cluster spec (e.g. default VPC with 10.10.0.0/16 vs cluster CIDR 10.0.0.0/16); region mismatch so the VPC list doesn't include the target VPC.","solutions":["Verify the VPC name and network CIDR in the cluster spec exactly match an existing VPC in the target DO region (`doctl vpc list`).","If kOps is supposed to create the VPC, wait for/re-run the create — the retry loop will succeed once the VPC exists.","Check the region configured for the cluster matches the region the VPC was created in.","If the VPC will never match (wrong spec), fix cluster.spec's networkCIDR or the VPC name and re-run."],"exampleFix":"null","handlingStrategy":"retry","validationCode":"// verify the VPC exists before calling GetVPCUUID\nvpcs, _ := cloud.VPCsService().List(context.TODO(), &godo.ListOptions{})\nfor _, v := range vpcs {\n    if v.Name == vpcName && v.IPRange == networkCIDR { /* ready */ }\n}","typeGuard":null,"tryCatchPattern":"uuid, err := cloud.GetVPCUUID(cidr, name)\nif err != nil {\n    if strings.Contains(err.Error(), \"vpc not yet created\") {\n        return createVPCAndWait(cidr, name) // or keep polling\n    }\n    return err\n}","preventionTips":["Create the VPC before cluster creation, or let kOps create it and don't reference a mismatching one.","Match name and CIDR exactly against the cluster spec networkCIDR.","Confirm the VPC exists in the same DO region as the cluster.","Use `doctl vpc list` to pre-validate name/CIDR pairs."],"tags":["digitalocean","vpc","retry","cluster-creation"],"backgroundTag":"resource-not-yet-created","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"}