{"record":{"id":"911cce3dc7d9bbb7","repo":"kubernetes/kops","slug":"error-deleting-instance-w","errorCode":null,"errorMessage":"error deleting instance: %w","messagePattern":"error deleting instance: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scalewaytasks/instance.go","lineNumber":292,"sourceCode":"\t\t\treturn fmt.Errorf(\"error powering on instance %s of group %q: %w\", srv.Server.ID, fi.ValueOf(expected.Name), err)\n\t\t}\n\n\t\t// We wait for the instance to be ready\n\t\t_, err = instanceService.WaitForServer(&instance.WaitForServerRequest{\n\t\t\tServerID: srv.Server.ID,\n\t\t\tZone:     zone,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error waiting for instance %s of group %q: %w\", srv.Server.ID, fi.ValueOf(expected.Name), err)\n\t\t}\n\t}\n\n\t// If newInstanceCount < 0, we need to delete instances of this group\n\tif newInstanceCount < 0 {\n\n\t\tigInstances, err := t.Cloud.GetClusterServers(t.Cloud.ClusterName(actual.Tags), actual.Name)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error deleting instance: %w\", err)\n\t\t}\n\n\t\tfor i := 0; i > newInstanceCount; i-- {\n\t\t\ttoDelete := igInstances[i*-1]\n\t\t\terr = t.Cloud.DeleteServer(toDelete)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"error deleting instance of group %s: %w\", toDelete.Name, err)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}\n\ntype terraformInstanceIP struct {\n\tTags []string `cty:\"tags\"`\n}\n","sourceCodeStart":274,"sourceCodeEnd":310,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scalewaytasks/instance.go#L274-L310","documentation":"In RenderScw's scale-down path, GetClusterServers failed to list the instance group's servers before deleting the surplus instances. No deletion has occurred; the wrapped error is the ListServers SDK failure for the cluster/instance-group tag filter.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/scalewaytasks/instance.go:292 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error for the listing failure","Verify cluster tags and credentials","Retry the apply operation"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}