kubernetes/kops · error
failed to create cloud group instance for server %s(%d): %w
Error message
failed to create cloud group instance for server %s(%d): %w
What it means
buildCloudInstanceGroup calls NewCloudInstance, which rejects duplicate instance IDs within a group. This error wraps that failure for a Hetzner server, meaning two servers mapped to the same cloud instance group carry the same numeric ID (or the group state is inconsistent).
Source
Thrown at upup/pkg/fi/cloudup/hetzner/cloud.go:384
cloudInstanceGroup := &cloudinstances.CloudInstanceGroup{
HumanName: ig.Name,
InstanceGroup: ig,
Raw: sg,
MinSize: int(fi.ValueOf(ig.Spec.MinSize)),
TargetSize: int(fi.ValueOf(ig.Spec.MinSize)),
MaxSize: int(fi.ValueOf(ig.Spec.MaxSize)),
}
for _, server := range sg {
status := cloudinstances.CloudInstanceStatusUpToDate
if _, ok := server.Labels[TagKubernetesInstanceNeedsUpdate]; ok {
status = cloudinstances.CloudInstanceStatusNeedsUpdate
}
id := strconv.FormatInt(server.ID, 10)
cloudInstance, err := cloudInstanceGroup.NewCloudInstance(id, status, nodeMap[id])
if err != nil {
return nil, fmt.Errorf("failed to create cloud group instance for server %s(%d): %w", server.Name, server.ID, err)
}
// Add additional instance info
cloudInstance.State = cloudinstances.State(server.Status)
if role, ok := server.Labels[TagKubernetesInstanceRole]; ok {
cloudInstance.Roles = append(cloudInstance.Roles, role)
}
if server.ServerType != nil {
cloudInstance.MachineType = server.ServerType.Name
}
if len(server.PrivateNet) > 0 {
cloudInstance.PrivateIP = server.PrivateNet[0].IP.String()
}
}
return cloudInstanceGroup, nil
}
View on GitHub (pinned to 4c8573c808)
Solutions
- Inspect the server name/ID in the message and look for duplicate Hetzner servers with the same kops instance-group label.
- Delete any manually created duplicate servers so each ID is unique per group.
- Re-run `kops get instancegroups` / rolling-update to refresh group state.
- If caused by an interrupted operation, wait for reconciliation or run a rolling update to converge state.
Defensive patterns
Strategy: validation
Validate before calling
seen := map[int64]bool{}
for _, s := range servers {
if seen[s.ID] { return fmt.Errorf("duplicate server ID %d in group %s", s.ID, groupName) }
seen[s.ID] = true
} Prevention
- Never hand-create Hetzner servers with kops instance-group labels; use kOps-managed instance groups.
- Deduplicate server lists by ID before building groups.
- Reconcile cloud state with `kops update cluster` after manual console changes.
When it happens
Trigger: A server with an ID already present in the CloudInstanceGroup is processed again, e.g. duplicate servers listed or a server added twice to Ready/NeedUpdate sets.
Common situations: Corrupted cloud state after an interrupted scaling operation; manually duplicated Hetzner servers sharing the kops instance-group label; a kOps bug reprocessing the same server list entry.
Related errors
- failed to list servers: %w
- failed to get private networks from hetzner cloud metadata:
- failed to convert private networks to object: %w
- %s is required
- providerID not set for node %s
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/3df160c88f0d898d.
Report an issue: GitHub.