kubernetes/kops · error
error initializing hetzner cloud: %s
Error message
error initializing hetzner cloud: %s
What it means
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.
Source
Thrown at upup/pkg/fi/cloudup/utils.go:130
region := cluster.Spec.Networking.Subnets[0].Zone
doCloud, err := do.NewDOCloud(region)
if err != nil {
return nil, fmt.Errorf("error initializing digitalocean cloud: %s", err)
}
cloud = doCloud
}
case kops.CloudProviderHetzner:
{
region, err := hetzner.FindRegion(cluster)
if err != nil {
return nil, err
}
hetznerCloud, err := hetzner.NewHetznerCloud(region)
if err != nil {
return nil, fmt.Errorf("error initializing hetzner cloud: %s", err)
}
cloud = hetznerCloud
}
case kops.CloudProviderOpenstack:
{
osc, err := openstack.NewOpenstackCloud(cluster, "build-cloud")
if err != nil {
return nil, err
}
var zoneNames []string
for _, subnet := range cluster.Spec.Networking.Subnets {
if !fi.ArrayContains(zoneNames, subnet.Zone) {
zoneNames = append(zoneNames, subnet.Zone)
}
}
osc.UseZones(zoneNames)View on GitHub (pinned to 4c8573c808)
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
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at upup/pkg/fi/cloudup/utils.go:130 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/69ef5900bf3b5a73.
Report an issue: GitHub.