{"record":{"id":"5248c8dd0f6d8ade","repo":"kubernetes/kops","slug":"error-initializing-digitalocean-cloud-s","errorCode":null,"errorMessage":"error initializing digitalocean cloud: %s","messagePattern":"error initializing digitalocean cloud: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/utils.go","lineNumber":115,"sourceCode":"\t\t\t\tif subnet.Zone != \"\" {\n\t\t\t\t\tzoneNames = append(zoneNames, subnet.Zone)\n\t\t\t\t}\n\t\t\t}\n\t\t\terr = awsup.ValidateZones(zoneNames, awsCloud)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tcloud = awsCloud\n\t\t}\n\tcase kops.CloudProviderDO:\n\t\t{\n\t\t\t// for development purposes we're going to assume\n\t\t\t// single region setups for DO. Reconsider this logic\n\t\t\t// when setting up multi-region kubernetes clusters on DO\n\t\t\tregion := cluster.Spec.Networking.Subnets[0].Zone\n\t\t\tdoCloud, err := do.NewDOCloud(region)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"error initializing digitalocean cloud: %s\", err)\n\t\t\t}\n\n\t\t\tcloud = doCloud\n\t\t}\n\n\tcase kops.CloudProviderHetzner:\n\t\t{\n\t\t\tregion, err := hetzner.FindRegion(cluster)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\thetznerCloud, err := hetzner.NewHetznerCloud(region)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"error initializing hetzner cloud: %s\", err)\n\t\t\t}\n\n\t\t\tcloud = hetznerCloud","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/utils.go#L97-L133","documentation":"Thrown in BuildCloud when do.NewDOCloud fails for the region taken from the first subnet's zone. Initialization usually fails because the DigitalOcean API token is missing from the environment (the cloud implementation reads credentials at construction), or the region string is invalid/empty.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/utils.go:115 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a valid DigitalOcean API token via the environment variable the DO cloud implementation expects (e.g. DIGITALOCEAN_ACCESS_TOKEN)","Check that the first subnet's zone is a real DO region slug (e.g. nyc3) and not empty","Retry after fixing credentials; no cloud resources were created yet"],"exampleFix":null,"handlingStrategy":"try-catch","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"}