{"record":{"id":"1335d20274071c8b","repo":"kubernetes/kops","slug":"found-multiple-routers-with-name-s","errorCode":null,"errorMessage":"found multiple routers with name: %s","messagePattern":"found multiple routers with name: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstacktasks/router.go","lineNumber":69,"sourceCode":"\t\tfind.ID = actual.ID\n\t}\n\treturn actual, nil\n}\n\nfunc (n *Router) Find(context *fi.CloudupContext) (*Router, error) {\n\tcloud := context.T.Cloud.(openstack.OpenstackCloud)\n\topt := routers.ListOpts{\n\t\tName: fi.ValueOf(n.Name),\n\t\tID:   fi.ValueOf(n.ID),\n\t}\n\trs, err := cloud.ListRouters(opt)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif rs == nil {\n\t\treturn nil, nil\n\t} else if len(rs) != 1 {\n\t\treturn nil, fmt.Errorf(\"found multiple routers with name: %s\", fi.ValueOf(n.Name))\n\t}\n\treturn NewRouterTaskFromCloud(cloud, n.Lifecycle, &rs[0], n)\n}\n\nfunc (c *Router) Run(context *fi.CloudupContext) error {\n\treturn fi.CloudupDefaultDeltaRunMethod(c, context)\n}\n\nfunc (_ *Router) CheckChanges(a, e, changes *Router) error {\n\tif a == nil {\n\t\tif e.Name == nil {\n\t\t\treturn fi.RequiredField(\"Name\")\n\t\t}\n\t} else {\n\t\tif changes.Name != nil {\n\t\t\treturn fi.CannotChangeField(\"Name\")\n\t\t}\n\t\tif changes.AvailabilityZoneHints != nil {","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstacktasks/router.go#L51-L87","documentation":"Router.Find discovers the existing Neutron router by name and, like the other Openstack Find methods, requires exactly one match. When the routers list returns more than one router with the task's name, it returns this error rather than picking one arbitrarily.","triggerScenarios":"len(rs) != 1 in the routers list filtered by the Router task name during reconciliation — i.e. two or more Neutron routers share the name in the project.","commonSituations":"Duplicate router left over from an earlier failed kops run; a manually created router with a colliding name; routers from a previous cluster reuse in the same project.","solutions":["Run `openstack router list --name <name>` to find duplicates","Delete or rename the stale duplicate router","Re-run kops once exactly one router with that name remains","Scope clusters to separate Openstack projects to avoid name collisions"],"exampleFix":"null","handlingStrategy":"validation","validationCode":"routers, err := cloud.ListRouters(routers.ListOpts{Name: routerName})\nif err != nil { return err }\nif len(routers) > 1 {\n    return fmt.Errorf(\"found multiple routers with name: %s — remove duplicates\", routerName)\n}","typeGuard":null,"tryCatchPattern":"if err := task.Find(cloud); err != nil {\n    if strings.Contains(err.Error(), \"found multiple routers\") {\n        // remediate: `openstack router list --name <n>`, delete stale duplicate, retry\n    }\n}","preventionTips":["Clean up routers from aborted runs before re-applying","Don't create routers manually with kops-managed names","Isolate clusters in separate Openstack projects"],"tags":["openstack","neutron","router"],"backgroundTag":"duplicate-resource-name","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"}