{"record":{"id":"11248227a11e1bf1","repo":"kubernetes/kops","slug":"found-more-than-one-port-for-instance-v","errorCode":null,"errorMessage":"found more than one port for instance %v","messagePattern":"found more than one port for instance (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstacktasks/instance.go","lineNumber":225,"sourceCode":"\tports, err := cloud.ListPorts(ports.ListOpts{\n\t\tDeviceID: server.ID,\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to fetch port for instance %v: %v\", server.ID, err)\n\t}\n\n\tports = filterInstancePorts(ports, fi.ValueOf(e.ServerGroup.ClusterName))\n\n\tif len(ports) == 1 {\n\t\tport := ports[0]\n\t\tporttask, err := newPortTaskFromCloud(cloud, e.Lifecycle, &port, nil)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to fetch port for instance %v: %v\", server.ID, err)\n\t\t}\n\t\tactual.Port = porttask\n\n\t} else if len(ports) > 1 {\n\t\treturn nil, fmt.Errorf(\"found more than one port for instance %v\", server.ID)\n\t}\n\n\tif e.FloatingIP != nil && e.Port != nil {\n\t\tfips, err := cloud.ListL3FloatingIPs(l3floatingip.ListOpts{\n\t\t\tPortID: fi.ValueOf(e.Port.ID),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to fetch floating ips for instance %v: %v\", server.ID, err)\n\t\t}\n\n\t\tif len(fips) == 1 {\n\t\t\tfip := fips[0]\n\t\t\tfipTask := &FloatingIP{\n\t\t\t\tID:   new(fip.ID),\n\t\t\t\tName: new(fip.Description),\n\t\t\t}\n\n\t\t\tactual.FloatingIP = fipTask","sourceCodeStart":207,"sourceCodeEnd":243,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstacktasks/instance.go#L207-L243","documentation":"More than one port remained after filtering the instance's ports by cluster tags. kops expects exactly one cluster-managed port per instance; multiple matches indicate leftover ports or misapplied kops tags, making port selection ambiguous.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/openstacktasks/instance.go:225 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["List ports for the instance and inspect their tags/description","Delete stale duplicate cluster-tagged ports","Re-run discovery once a single port matches"],"exampleFix":null,"handlingStrategy":"validation","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"}