{"record":{"id":"455b1591f2f60253","repo":"kubernetes/kops","slug":"error-finding-instances-w","errorCode":null,"errorMessage":"error finding instances: %w","messagePattern":"error finding instances: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scalewaytasks/instance.go","lineNumber":78,"sourceCode":"\nvar _ fi.CloudupHasDependencies = (*Instance)(nil)\n\nfunc (s *Instance) GetDependencies(tasks map[string]fi.CloudupTask) []fi.CloudupTask {\n\tvar deps []fi.CloudupTask\n\tfor _, task := range tasks {\n\t\tif _, ok := task.(*Volume); ok {\n\t\t\tdeps = append(deps, task)\n\t\t}\n\t}\n\treturn deps\n}\n\nfunc (s *Instance) Find(c *fi.CloudupContext) (*Instance, error) {\n\tcloud := c.T.Cloud.(scaleway.ScwCloud)\n\n\tservers, err := cloud.GetClusterServers(cloud.ClusterName(s.Tags), s.Name)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error finding instances: %w\", err)\n\t}\n\tif len(servers) == 0 {\n\t\treturn nil, nil\n\t}\n\n\t// Check if servers updates are needed\n\tvar needsUpdate []string\n\tfor _, server := range servers {\n\n\t\t// Check if server is already marked as needing update\n\t\talreadyTagged := false\n\t\tfor _, tag := range server.Tags {\n\t\t\tif tag == scaleway.TagNeedsUpdate {\n\t\t\t\talreadyTagged = true\n\t\t\t}\n\t\t}\n\t\tif alreadyTagged {\n\t\t\tcontinue","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scalewaytasks/instance.go#L60-L96","documentation":"Instance.Find locates existing cluster servers by listing servers tagged with the cluster name and matching the instance name. Any failure from cloud.GetClusterServers (itself a ListServers call) is wrapped in this error, aborting the reconciliation for that instance.","triggerScenarios":"cloud.GetClusterServers fails — typically a Scaleway ListServers API error: invalid credentials, permission denied, bad zone/project scope, rate limiting, or network failure.","commonSituations":"Expired or revoked Scaleway API key on the machine running kops, IAM policy without instance list permission, kops run in a zone/project different from the cluster's, or transient API outage/rate limit during kops update/rolling-update.","solutions":["Check Scaleway credentials are valid: scw instance server list zone=<zone>","Grant IAM permission to list instances in the cluster's project","Verify SCW_DEFAULT_ZONE/SCW_DEFAULT_REGION (or cluster config) point at the cluster's zone","Retry after transient failures or rate limits"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// preflight credential/permission check before Find\nclient, err := scw.NewClient(scw.WithProfile(profile))\nif err != nil { return err }\nif _, err := instance.NewAPI(client).ListServers(&instance.ListServersRequest{Zone: zone, Limit: 1}, scw.WithContext(ctx)); err != nil {\n\treturn fmt.Errorf(\"scaleway API preflight failed (check credentials/IAM): %w\", err)\n}","typeGuard":"func isTransient(err error) bool {\n\tvar rerr *scw.ResponseError\n\treturn errors.As(err, &rerr) && (rerr.StatusCode == 429 || rerr.StatusCode >= 500)\n}","tryCatchPattern":"err := retry.Do(func() error {\n\tservers, err := cloud.GetClusterServers(clusterName, s.Name)\n\tif err != nil && isTransient(err) { return retry.RetryableError(err) }\n\tif err != nil { return err }\n\treturn nil\n}, retry.Attempts(3), retry.Delay(time.Second))\nif err != nil { return fmt.Errorf(\"error finding instances: %w\", err) }","preventionTips":["Run kops updates from a machine with valid, non-expired Scaleway credentials","Set SCW_DEFAULT_ZONE/SCW_DEFAULT_REGION (or cluster config) to the cluster's zone","Retry on 429/5xx with exponential backoff during rolling updates"],"tags":["scaleway","instance","api","reconciliation"],"backgroundTag":"cloud-list-instances-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"}