{"record":{"id":"492944a56146c02b","repo":"kubernetes/kops","slug":"did-not-find-floatingsubnet-for-external-router","errorCode":null,"errorMessage":"did not find floatingsubnet for external router","messagePattern":"did not find floatingsubnet for external router","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstack/subnet.go","lineNumber":148,"sourceCode":"\treturn getExternalSubnet(c, c.extSubnetName)\n}\n\nfunc getExternalSubnet(c OpenstackCloud, subnetName *string) (subnet *subnets.Subnet, err error) {\n\tif subnetName == nil {\n\t\treturn nil, nil\n\t}\n\n\tsubnets, err := c.ListSubnets(subnets.ListOpts{\n\t\tName: fi.ValueOf(subnetName),\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(subnets) == 1 {\n\t\treturn &subnets[0], nil\n\t}\n\treturn nil, fmt.Errorf(\"did not find floatingsubnet for external router\")\n}\n\nfunc (c *openstackCloud) GetLBFloatingSubnet() (subnet *subnets.Subnet, err error) {\n\treturn getLBFloatingSubnet(c, c.floatingSubnet)\n}\n\nfunc getLBFloatingSubnet(c OpenstackCloud, floatingSubnet *string) (subnet *subnets.Subnet, err error) {\n\tif floatingSubnet == nil {\n\t\treturn nil, nil\n\t}\n\n\tsubnets, err := c.ListSubnets(subnets.ListOpts{\n\t\tName: fi.ValueOf(floatingSubnet),\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstack/subnet.go#L130-L166","documentation":"getExternalSubnet resolves the floating-IP subnet associated with the external router. It lists candidate subnets and requires exactly one match; if zero or more than one subnet is found, it returns the literal error \"did not find floatingsubnet for external router\". This is a configuration-ambiguity error, not an API failure.","triggerScenarios":"The external network has zero subnets, or multiple subnets match the configured filter, so len(subnets) != 1.","commonSituations":"Operator did not set the floating subnet in the cluster spec and the external network has several subnets; or the external network has no subnet at all; config key for the external router typo'd so filters match nothing.","solutions":["Explicitly configure the floating subnet in the cluster spec (extFloatingSubnet/floating subnet fields) so only one matches","Ensure the external network has exactly one subnet, or narrow the filter via cluster config","Run `openstack network show <extnet>` / `openstack subnet list --network <extnet>` to inspect candidates","Update the cluster spec and re-run kops"],"exampleFix":"// before (cluster.yaml)\nspec:\n  network:\n    externalNetwork: public\n// after: pin the exact floating subnet\nspec:\n  network:\n    externalNetwork: public\n    extFloatingSubnet: public-subnet-1","handlingStrategy":"validation","validationCode":"// Require exactly one floating subnet match before invoking kops\nsubnets, err := execCmdJSON(\"openstack\", \"subnet\", \"list\", \"--network\", extNetworkID)\nif err != nil || len(subnets) != 1 {\n\tlog.Fatalf(\"external network %s must have exactly one subnet, got %d\", extNetworkID, len(subnets))\n}","typeGuard":null,"tryCatchPattern":"sub, err := GetExternalSubnet(cloud)\nif err != nil {\n\tif strings.Contains(err.Error(), \"did not find floatingsubnet for external router\") {\n\t\t// fall back to explicit config in cluster spec\n\t}\n\treturn err\n}","preventionTips":["Always pin the external floating subnet explicitly in the cluster spec","Verify external network subnet count before cluster creation","Avoid relying on implicit discovery with multi-subnet external networks","Re-validate config after network topology changes"],"tags":["openstack","neutron","subnet","floating-ip","config"],"backgroundTag":"ambiguous-subnet-config","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"}