{"record":{"id":"d60c879c108f2597","repo":"kubernetes/kops","slug":"getting-cluster-servers-for-load-balancer-s-back-e","errorCode":null,"errorMessage":"getting cluster servers for load-balancer's back-end: %w","messagePattern":"getting cluster servers for load-balancer's back-end: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scalewaytasks/lb_backend.go","lineNumber":248,"sourceCode":"\t\tName:            expected.Name,\n\t\tForwardProtocol: expected.ForwardProtocol,\n\t\tForwardPort:     expected.ForwardPort,\n\t\tProxyProtocol:   new(strings.TrimPrefix(*expected.ProxyProtocol, \"proxy_protocol_\")),\n\t\tServerIPs:       serverIPs,\n\t}\n\treturn t.RenderResource(\"scaleway_lb_backend\", fi.ValueOf(expected.Name), tf)\n}\n\nfunc (l *LBBackend) TerraformLink() *terraformWriter.Literal {\n\treturn terraformWriter.LiteralProperty(\"scaleway_lb_backend\", fi.ValueOf(l.Name), \"id\")\n}\n\nfunc getControlPlanesIPs(scwCloud scaleway.ScwCloud, lb *LoadBalancer, zone scw.Zone) ([]string, error) {\n\tvar controlPlanePrivateIPs []string\n\n\tservers, err := scwCloud.GetClusterServers(scwCloud.ClusterName(lb.Tags), nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"getting cluster servers for load-balancer's back-end: %w\", err)\n\t}\n\n\tfor _, server := range servers {\n\t\tif role := scaleway.InstanceRoleFromTags(server.Tags); role == scaleway.TagRoleWorker {\n\t\t\tcontinue\n\t\t}\n\t\tip, err := scwCloud.GetServerIP(server.ID, server.Zone)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"getting IP of server %s for load-balancer's back-end: %w\", server.Name, err)\n\t\t}\n\t\tcontrolPlanePrivateIPs = append(controlPlanePrivateIPs, ip)\n\t}\n\n\treturn controlPlanePrivateIPs, nil\n}\n","sourceCodeStart":230,"sourceCodeEnd":264,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scalewaytasks/lb_backend.go#L230-L264","documentation":"kOps wraps failures from `scwCloud.GetClusterServers`, which lists the cluster's Scaleway instances used to compute back-end server IPs, when building the control-plane IP list for a load-balancer back-end. Thrown from getControlPlanesIPs, called by RenderScw of LoadBalancerBackend.","triggerScenarios":"getControlPlanesIPs calls GetClusterServers(clusterName(lb.Tags), nil); the ListServers API call fails — bad credentials, wrong project/zone scope, API outage, or invalid cluster-name tags.","commonSituations":"Instance API credentials lacking list permission; cluster name tags missing/misconfigured so the lookup query is wrong; Scaleway API outage; instance deleted concurrently.","solutions":["Rerun `kops update cluster` — usually a transient API failure","Verify Scaleway credentials (secret key, project ID) and that instances are visible in the console","Check that cluster-name tags on instances match the LB's tags configuration","Check Scaleway status page for Instance API incidents","Inspect the wrapped scw error for 4xx/5xx to distinguish auth vs server issues"],"exampleFix":"// before: single call, hard fail\nservers, err := scwCloud.GetClusterServers(name, nil)\n// after: retry transient errors\nvar servers []*instance.Server\nfor i := 0; i < 3; i++ {\n    servers, err = scwCloud.GetClusterServers(name, nil)\n    if err == nil { break }\n    time.Sleep(5 * time.Second)\n}","handlingStrategy":"retry","validationCode":"// verify credentials and cluster tag config before listing servers\nif os.Getenv(\"SCW_SECRET_KEY\") == \"\" { return errors.New(\"SCW_SECRET_KEY not set\") }\nif clusterName == \"\" { return errors.New(\"cluster name empty; cannot list cluster servers\") }","typeGuard":null,"tryCatchPattern":"var serr *scw.ResponseError\nif errors.As(err, &serr) {\n    if serr.Status == 403 { return fmt.Errorf(\"check Scaleway credentials/project: %w\", err) }\n    if serr.Status == 429 || serr.Status >= 500 { /* retry with backoff */ }\n}","preventionTips":["Keep instance tags (cluster name) consistent between kOps spec and actual instances","Use service-account keys with instance list permissions","Apply retry/backoff for Instance API calls in large clusters"],"tags":["scaleway","instances","api-error","load-balancer"],"backgroundTag":"instance-listing-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"}