{"record":{"id":"48918351b1fbb5c6","repo":"kubernetes/kops","slug":"error-deleting-instance-of-group-s-w","errorCode":null,"errorMessage":"error deleting instance of group %s: %w","messagePattern":"error deleting instance of group (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/scalewaytasks/instance.go","lineNumber":299,"sourceCode":"\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\ntype terraformInstance struct {\n\tName                *string                             `cty:\"name\"`\n\tIPID                *terraformWriter.Literal            `cty:\"ip_id\"`\n\tType                *string                             `cty:\"type\"`\n\tTags                []string                            `cty:\"tags\"`\n\tImage               *string                             `cty:\"image\"`\n\tUserData            map[string]*terraformWriter.Literal `cty:\"user_data\"`","sourceCodeStart":281,"sourceCodeEnd":317,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/scalewaytasks/instance.go#L281-L317","documentation":"In RenderScw's scale-down loop, DeleteServer failed for one of the surplus instances selected for removal (taken from the head of the group's server list). The instance group name identifies the group; the wrapped error explains the deletion failure (locked server, API error).","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/scalewaytasks/instance.go:299 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error for the delete failure","Verify the server is not locked or in transition","Retry the apply; already-deleted servers are tolerated by DeleteServer's 404 handling"],"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-12T12:17:11.808Z"}