kubernetes/kops · error
failed to get info for load balancer %q: %w
Error message
failed to get info for load balancer %q: %w
What it means
GetApiIngressStatus looks up the cluster's API load balancer by name ("api.<cluster>") via LoadBalancerClient.GetByName. If that Hetzner API call errors (network, auth, API failure), the error is wrapped with the LB name. This is not the same as the LB not existing — a nil lb with nil error returns gracefully.
Source
Thrown at upup/pkg/fi/cloudup/hetzner/cloud.go:441
// FindVPCInfo is not implemented
func (c *hetznerCloudImplementation) FindVPCInfo(id string) (*fi.VPCInfo, error) {
// TODO(hakman): Implement me
return nil, errors.New("hetzner cloud provider does not implement FindVPCInfo at this time")
}
// FindClusterStatus was used before etcd-manager to check the etcd cluster status and prevent unsupported changes.
func (c *hetznerCloudImplementation) FindClusterStatus(cluster *kops.Cluster) (*kops.ClusterStatus, error) {
return nil, nil
}
func (c *hetznerCloudImplementation) GetApiIngressStatus(cluster *kops.Cluster) ([]fi.ApiIngressStatus, error) {
lbName := "api." + cluster.Name
client := c.LoadBalancerClient()
lb, _, err := client.GetByName(context.TODO(), lbName)
if err != nil {
return nil, fmt.Errorf("failed to get info for load balancer %q: %w", lbName, err)
}
if lb == nil {
return nil, nil
}
if !lb.PublicNet.Enabled {
return nil, fmt.Errorf("load balancer %s(%d) is not public", lb.Name, lb.ID)
}
ingresses := []fi.ApiIngressStatus{
{
IP: lb.PublicNet.IPv4.IP.String(),
},
}
return ingresses, nil
}
View on GitHub (pinned to 4c8573c808)
Solutions
- Check the wrapped error: 401 => fix HCLOUD_TOKEN, timeout => check network/proxy.
- Verify token with `curl -H "Authorization: Bearer $HCLOUD_TOKEN" https://api.hetzner.cloud/v1/load_balancers`.
- Retry after transient failures.
- If the LB was intentionally deleted, recreate it via `kops update cluster`.
Defensive patterns
Strategy: retry
Validate before calling
resp, _ := http.Get("https://api.hetzner.cloud/v1") // plus token auth check before running
if resp.StatusCode == 401 { /* fix token first */ } Try / catch
lb, _, err := client.GetByName(ctx, lbName)
if err != nil {
var hErr *hcloud.ErrorResponse
if errors.As(err, &hErr) && hErr.Code == "rate_limit_exceeded" {
// back off and retry
}
return nil, fmt.Errorf("failed to get info for load balancer %q: %w", lbName, err)
} Prevention
- Verify HCLOUD_TOKEN validity before API-heavy operations.
- Distinguish "not found" (nil lb, nil err) from transport errors.
- Retry transient Hetzner API failures with exponential backoff.
When it happens
Trigger: The hcloud LoadBalancer GetByName request fails: invalid HCLOUD_TOKEN, network timeout, rate limit, or Hetzner API 5xx.
Common situations: Expired/incorrect API token during `kops rolling-update` or `kops validate`; Hetzner API outage; corporate proxy blocking api.hetzner.cloud.
Related errors
- failed to list load balancers: %w
- failed to list ssh keys: %w
- failed to list networks: %w
- failed to list firewalls: %w
- failed to list servers: %w
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/b4b83a9d727610da.
Report an issue: GitHub.