{"record":{"id":"69ef5900bf3b5a73","repo":"kubernetes/kops","slug":"error-initializing-hetzner-cloud-s","errorCode":null,"errorMessage":"error initializing hetzner cloud: %s","messagePattern":"error initializing hetzner cloud: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/utils.go","lineNumber":130,"sourceCode":"\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\n\t\t}\n\n\tcase kops.CloudProviderOpenstack:\n\t\t{\n\t\t\tosc, err := openstack.NewOpenstackCloud(cluster, \"build-cloud\")\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tvar zoneNames []string\n\t\t\tfor _, subnet := range cluster.Spec.Networking.Subnets {\n\t\t\t\tif !fi.ArrayContains(zoneNames, subnet.Zone) {\n\t\t\t\t\tzoneNames = append(zoneNames, subnet.Zone)\n\t\t\t\t}\n\t\t\t}\n\t\t\tosc.UseZones(zoneNames)","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/utils.go#L112-L148","documentation":"Thrown in BuildCloud when hetzner.NewHetznerCloud fails after the region was successfully resolved via hetzner.FindRegion. Construction fails primarily when the Hetzner API token is missing or malformed in the environment, or when the cloud client cannot be initialized for the region.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/utils.go:130 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set a valid Hetzner API token in the environment variable the Hetzner cloud implementation expects (e.g. HCLOUD_TOKEN)","Verify the token has read/write permissions for the project","Re-run the operation once credentials are in place"],"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"}