kubernetes/kops · error
could not find IP for server %s
Error message
could not find IP for server %s
What it means
Sentinel error returned by GetServerIP when the IPAM ListIPs call succeeds but returns zero IPs for the server. Unlike the wrap errors, this is a domain condition: Scaleway knows the server but has no IP registered for it in IPAM. It means the instance cannot be resolved to an address for deregistration or cloud-group membership.
Source
Thrown at upup/pkg/fi/cloudup/scaleway/cloud.go:516
func (s *scwCloudImplementation) GetServerIP(serverID string, zone scw.Zone) (string, error) {
region, err := zone.Region()
if err != nil {
return "", fmt.Errorf("converting zone %s to region: %w", zone, err)
}
ips, err := s.ipamAPI.ListIPs(&ipam.ListIPsRequest{
Region: region,
IsIPv6: new(false),
ResourceID: &serverID,
Zonal: new(zone.String()),
}, scw.WithAllPages())
if err != nil {
return "", fmt.Errorf("listing IPs for server %s: %w", serverID, err)
}
if len(ips.IPs) < 1 {
return "", fmt.Errorf("could not find IP for server %s", serverID)
}
if len(ips.IPs) > 1 {
klog.V(10).Infof("Found more than 1 IP for server %s, using %s", serverID, ips.IPs[0].Address.IP.String())
}
return ips.IPs[0].Address.IP.String(), nil
}
func (s *scwCloudImplementation) DeleteDNSRecord(record *domain.Record, clusterName string) error {
domainName := strings.SplitN(clusterName, ".", 2)[1]
recordDeleteRequest := &domain.UpdateDNSZoneRecordsRequest{
DNSZone: domainName,
Changes: []*domain.RecordChange{
{
Delete: &domain.RecordChangeDelete{
ID: scw.StringPtr(record.ID),
},
},View on GitHub (pinned to 4c8573c808)
Solutions
- Verify the server is running and has an IP in the Scaleway console or via `scw instance server get <id>`.
- Retry shortly after instance creation — IPs can lag server availability.
- Check whether the cluster is IPv6-only; if so the IsIPv6=false filter must be relaxed.
- Confirm serverID and zone belong to the same project as the credentials.
- If deregistering a just-deleted server, treat this as benign and skip.
Example fix
// before
ip, err := cloud.GetServerIP(serverID, zone)
if err != nil {
return fmt.Errorf("deregistering instance: %w", err)
}
// after
ip, err := cloud.GetServerIP(serverID, zone)
if err != nil {
if strings.Contains(err.Error(), "could not find IP for server") {
klog.V(4).Infof("server %s has no IP (likely already deleted), skipping", serverID)
return nil
}
return fmt.Errorf("deregistering instance: %w", err)
} Defensive patterns
Strategy: fallback
Validate before calling
// check server state before resolving IP
srv, err := instance.NewAPI(client).GetServer(&instance.GetServerRequest{ServerID: serverID, Zone: zone})
if err != nil || srv.Server.State != instance.ServerStateRunning {
// skip IP resolution; server missing or not ready
} Try / catch
ip, err := cloud.GetServerIP(serverID, zone)
if err != nil && strings.Contains(err.Error(), "could not find IP for server") {
// treat as already-deleted / not-ready and skip or retry later
} Prevention
- Add a short delay or state check between instance creation and IP resolution.
- Handle deregistration of terminated instances as a no-op.
- Avoid IPv6-only nodes unless the IP resolution path is updated (IsIPv6 filter).
When it happens
Trigger: Server has no private IP registered in IPAM (server still booting, just created, or terminated); querying a zone where the server has no IP; IsIPv6=false filter excludes servers with only IPv6.
Common situations: DeregisterInstance racing instance termination; newly-joined instance not yet assigned an IP; IPv6-only configuration; server ID from a different project/zone than queried.
Related errors
- listing IPs for server %s: %w
- failed to get server %s: %w
- failed to get IP for server %q: %w
- no IP found for server %q: %w
- error finding instances: %w
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/8ef3bc956dea18ea.
Report an issue: GitHub.