kubernetes/kops · error

unexpected format for server id %s

Error message

unexpected format for server id %s

What it means

getServer parses the node name/id, which kOps expects in the form <provider>/<zone>/<server-id> (3 slash-separated parts). If the id does not split into exactly 3 segments, the zone and server UUID cannot be extracted, so this error is thrown.

Source

Thrown at pkg/nodeidentity/scaleway/identify.go:143

			klog.Warningf("Failed to add node identity info to cache: %v", err)
		}
	}

	return info, nil
}

// stringKeyFunc is a string as cache key function
func stringKeyFunc(obj interface{}) (string, error) {
	key := obj.(*nodeidentity.Info).InstanceID
	return key, nil
}

// getServer queries Scaleway for the server with the specified ID, returning an error if not found
func (i *nodeIdentifier) getServer(ctx context.Context, id string) (*instance.Server, error) {
	api := instance.NewAPI(i.client)
	uuid := strings.Split(id, "/")
	if len(uuid) != 3 {
		return nil, fmt.Errorf("unexpected format for server id %s", id)
	}
	server, err := api.GetServer(&instance.GetServerRequest{
		ServerID: uuid[2],
		Zone:     scw.Zone(uuid[1]),
	}, scw.WithContext(ctx))
	if err != nil || server == nil {
		return nil, fmt.Errorf("failed to get server %s: %w", id, err)
	}

	return server.Server, nil
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Set the node's providerID/spec.ProviderID to the full 3-part format: '<region>/<zone>/<server-uuid>' (e.g. 'scaleway/fr-par-1/11111111-2222-...')
  2. Verify how the id is derived upstream and fix the format at the source
  3. Log/inspect the offending id to confirm the exact number of segments

Example fix

// before
id := "11111111-2222-3333-4444-555555555555" // 1 segment
// after
id := "fr-par-1/11111111-2222-3333-4444-555555555555" // zone + uuid, 3 segments with provider prefix
Defensive patterns

Strategy: validation

Validate before calling

func validateScalewayProviderID(id string) error {
    parts := strings.Split(id, "/")
    if len(parts) != 3 {
        return fmt.Errorf("provider id must be <provider>/<zone>/<uuid>, got %q", id)
    }
    return nil
}

Type guard

func isThreePartID(id string) bool {
    return len(strings.Split(id, "/")) == 3
}

Prevention

When it happens

Trigger: Calling IdentifyNode with a node name/id that is a bare UUID or a name with fewer/more than 3 '/'-separated segments instead of the full 'fr-par-1/.../<uuid>' style id.

Common situations: Provider id not set on the Node object (node name used instead); scaleway provider-id malformed in the InstanceGroup or cloud config; ids copied from other clouds with different formats.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/b8f8bb6628591675. Report an issue: GitHub.