{"record":{"id":"5c21ab06c56220a4","repo":"kubernetes/kops","slug":"listing-ips-for-deletion-w","errorCode":null,"errorMessage":"listing IPs for deletion: %w","messagePattern":"listing IPs for deletion: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/resources/scaleway/resources.go","lineNumber":148,"sourceCode":"\t\t\tType:    resourceTypeServer,\n\t\t\tDeleter: deleteServer,\n\t\t\tObj:     server,\n\t\t}\n\t\tresourceTrackers = append(resourceTrackers, resourceTracker)\n\t}\n\n\treturn resourceTrackers, nil\n}\n\nfunc listServerIPs(cloud fi.Cloud, clusterName string) ([]*resources.Resource, error) {\n\tc := cloud.(scaleway.ScwCloud)\n\n\tips, err := c.InstanceService().ListIPs(&instance.ListIPsRequest{\n\t\tZone: scw.Zone(c.Zone()),\n\t\tTags: []string{fmt.Sprintf(\"%s=%s\", scaleway.TagClusterName, clusterName)},\n\t}, scw.WithAllPages())\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"listing IPs for deletion: %w\", err)\n\t}\n\n\tresourceTrackers := []*resources.Resource(nil)\n\tfor _, ip := range ips.IPs {\n\t\tresourceTracker := &resources.Resource{\n\t\t\tName:    ip.Address.String(),\n\t\t\tID:      ip.ID,\n\t\t\tType:    resourceTypeServerIP,\n\t\t\tDeleter: deleteServerIP,\n\t\t\tObj:     ip,\n\t\t}\n\t\tresourceTrackers = append(resourceTrackers, resourceTracker)\n\t}\n\n\treturn resourceTrackers, nil\n}\n\nfunc listSSHKeys(cloud fi.Cloud, clusterName string) ([]*resources.Resource, error) {","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/resources/scaleway/resources.go#L130-L166","documentation":"listServerIPs collects Scaleway flexible IPs tagged with the cluster tag so they can be deleted with the cluster. When the InstanceService ListIPs API call fails (pagination included via scw.WithAllPages), the error is wrapped with this message and returned, aborting resource listing for Scaleway clusters.","triggerScenarios":"Calling ListResources on a Scaleway cluster where the Instance API ListIPs request (pkg/resources/scaleway/resources.go:148) fails: invalid/expired SCW_ACCESS_KEY or SCW_SECRET_KEY, wrong zone, network outage, or Scaleway API 4xx/5xx.","commonSituations":"Missing or stale Scaleway credentials in the environment; zone mismatch between the cluster config and API scope; Scaleway transient outage or rate limiting; deleted project still referenced by cluster config.","solutions":["Verify SCW_ACCESS_KEY / SCW_SECRET_KEY (or scw config) are valid and have adequate IAM scopes","Check the zone configured for the cluster matches where the IPs live (scw.Zone(c.Zone()))","Retry after confirming Scaleway API status — transient 5xx/429 errors resolve with backoff","Run `scw instance ip list` with the same credentials to reproduce the API error directly"],"exampleFix":"// before\nexport SCW_ACCESS_KEY=old-key\n// after\nscw login\nexport SCW_ACCESS_KEY=$(scw config get access-key)\nexport SCW_SECRET_KEY=$(scw config get secret-key)\nkops delete cluster --name mycluster","handlingStrategy":"validation","validationCode":"// Pre-check Scaleway credentials and reachability before listing\nif os.Getenv(\"SCW_ACCESS_KEY\") == \"\" || os.Getenv(\"SCW_SECRET_KEY\") == \"\" {\n    return fmt.Errorf(\"scaleway credentials missing\")\n}\nif _, err := c.InstanceService().ListIPs(&instance.ListIPsRequest{Zone: scw.Zone(c.Zone())}, scw.WithAllPages()); err != nil {\n    return fmt.Errorf(\"pre-flight IP list failed: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"trackers, err := scaleway.ListResources(cloud, clusterInfo)\nvar apiErr *scw.Error\nif err != nil && errors.As(err, &apiErr) {\n    klog.Errorf(\"scaleway API error %d: %s — check credentials/zone\", apiErr.StatusCode, apiErr.Message)\n    return retryAfterBackoff(err)\n}","preventionTips":["Validate SCW_ACCESS_KEY/SCW_SECRET_KEY before cluster operations","Confirm cluster zone matches the API scope","Check Scaleway status page during outages","Pre-flight `scw instance ip list` with the same credentials"],"tags":["scaleway","api-error","network","credentials"],"backgroundTag":"cloud-api-list-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"}