{"record":{"id":"f20485b0864b5867","repo":"kubernetes/kops","slug":"failed-to-list-cluster-servers-w","errorCode":null,"errorMessage":"failed to list cluster servers: %w","messagePattern":"failed to list cluster servers: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scaleway/cloud.go","lineNumber":469,"sourceCode":"\treturn lbs.LBs, nil\n}\n\nfunc (s *scwCloudImplementation) GetClusterServers(clusterName string, instanceGroupName *string) ([]*instance.Server, error) {\n\ttags := []string{TagClusterName + \"=\" + clusterName}\n\tif instanceGroupName != nil {\n\t\ttags = append(tags, fmt.Sprintf(\"%s=%s\", TagInstanceGroup, *instanceGroupName))\n\t}\n\trequest := &instance.ListServersRequest{\n\t\tZone: s.zone,\n\t\tName: instanceGroupName,\n\t\tTags: tags,\n\t}\n\tservers, err := s.instanceAPI.ListServers(request, scw.WithAllPages())\n\tif err != nil {\n\t\tif instanceGroupName != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to list cluster servers named %q: %w\", *instanceGroupName, err)\n\t\t}\n\t\treturn nil, fmt.Errorf(\"failed to list cluster servers: %w\", err)\n\t}\n\treturn servers.Servers, nil\n}\n\nfunc (s *scwCloudImplementation) GetClusterSSHKeys(clusterName string) ([]*iam.SSHKey, error) {\n\tclusterSSHKeys := []*iam.SSHKey(nil)\n\tallSSHKeys, err := s.iamAPI.ListSSHKeys(&iam.ListSSHKeysRequest{}, scw.WithAllPages())\n\tfor _, sshkey := range allSSHKeys.SSHKeys {\n\t\tif strings.HasPrefix(sshkey.Name, fmt.Sprintf(\"kubernetes.%s-\", clusterName)) {\n\t\t\tclusterSSHKeys = append(clusterSSHKeys, sshkey)\n\t\t}\n\t}\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to list cluster ssh keys: %w\", err)\n\t}\n\treturn clusterSSHKeys, nil\n}\n","sourceCodeStart":451,"sourceCodeEnd":487,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scaleway/cloud.go#L451-L487","documentation":"Wrap-around error returned by scwCloudImplementation.GetClusterServers when the Scaleway Instance API ListServers call (paginated with scw.WithAllPages) fails. It carries the underlying SDK error via %w so callers can errors.Is/As into scaleway SDK errors. A variant with the instance-group name is used when an instanceGroupName filter was supplied.","triggerScenarios":"Any ListServers API failure: invalid or missing Scaleway credentials (access key/secret key/project ID), wrong or unavailable zone, network failure, Scaleway API outage/429 rate limiting, or an invalid tag filter derived from cluster name.","commonSituations":"Expired or rotated Scaleway credentials in the environment; region/zone misconfiguration in the cluster spec; Scaleway incident causing 5xx; rate limits hit during large cluster operations.","solutions":["Verify Scaleway credentials (SCW_ACCESS_KEY, SCW_SECRET_KEY, SCW_DEFAULT_PROJECT_ID) are valid and unexpired with `scw init` or `scw instance server list`.","Confirm the zone configured for the cluster exists and is up (e.g. fr-par-1) and that the account has quota in it.","Run the ListServers call directly via the scw CLI to see the raw API error (auth 403 vs 404 vs 429 vs 5xx).","If rate-limited (429), retry after backoff or reduce concurrent kops operations.","Check https://status.scaleway.com for ongoing incidents and retry once resolved."],"exampleFix":"// before\nservers, err := s.instanceAPI.ListServers(request, scw.WithAllPages())\nif err != nil {\n  return nil, fmt.Errorf(\"failed to list cluster servers: %w\", err)\n}\n// after\nservers, err := s.instanceAPI.ListServers(request, scw.WithAllPages())\nif err != nil {\n  var sdkErr *scw.Error\n  if errors.As(err, &sdkErr) && sdkErr.StatusCode == http.StatusTooManyRequests {\n    return nil, retryableError(fmt.Errorf(\"failed to list cluster servers: %w\", err))\n  }\n  return nil, fmt.Errorf(\"failed to list cluster servers: %w\", err)\n}","handlingStrategy":"retry","validationCode":"// before calling kops scaleway operations\nimport \"github.com/scaleway/scaleway-sdk-go/scw\"\nclient, err := scw.NewClient(scw.WithEnv())\nif err != nil { return err }\n_, err = client.GetRaw().Do(\"GET\", \"/instance/v1/zones/fr-par-1/servers\", nil, nil, nil)\n// fail fast if credentials/zone are wrong","typeGuard":null,"tryCatchPattern":"err := runKops(); if err != nil {\n  var scwErr *scw.Error\n  if errors.As(err, &scwErr) && scwErr.StatusCode >= 500 || scwErr.StatusCode == 429 {\n    // retry with backoff\n  }\n}","preventionTips":["Run `scw init` / `scw instance server list` before large kops operations to validate credentials and zone.","Pin the Scaleway SDK/kops version to one that supports your target zones.","Respect API rate limits; avoid parallel cluster mutations.","Subscribe to Scaleway status updates for incident awareness."],"tags":["scaleway","api-error","authentication","cloud-provider"],"backgroundTag":"scaleway-api-request-failed","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}