{"record":{"id":"85e3a3395bf7c564","repo":"kubernetes/kops","slug":"failed-to-find-floatingip-subnet-v","errorCode":null,"errorMessage":"Failed to find floatingip subnet: %v","messagePattern":"Failed to find floatingip subnet: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstacktasks/floatingip.go","lineNumber":249,"sourceCode":"\tif a == nil {\n\t\texternal, err := cloud.GetExternalNetwork()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to find external network: %v\", err)\n\t\t}\n\n\t\topts := l3floatingip.CreateOpts{\n\t\t\tFloatingNetworkID: external.ID,\n\t\t\tDescription:       fi.ValueOf(e.Name),\n\t\t}\n\n\t\tif e.LB != nil {\n\t\t\topts.PortID = fi.ValueOf(e.LB.PortID)\n\t\t}\n\n\t\t// instance floatingips comes from the same subnet as the kubernetes API floatingip\n\t\tlbSubnet, err := cloud.GetLBFloatingSubnet()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to find floatingip subnet: %v\", err)\n\t\t}\n\t\tif lbSubnet != nil {\n\t\t\topts.SubnetID = lbSubnet.ID\n\t\t}\n\t\tfip, err := cloud.CreateL3FloatingIP(opts)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to create floating IP: %v\", err)\n\t\t}\n\n\t\te.ID = new(fip.ID)\n\t\te.IP = new(fip.FloatingIP)\n\n\t\treturn nil\n\t}\n\tif changes.Name != nil {\n\t\t_, err := l3floatingip.Update(context.TODO(), cloud.NetworkingClient(), fi.ValueOf(a.ID), l3floatingip.UpdateOpts{\n\t\t\tDescription: e.Name,\n\t\t}).Extract()","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstacktasks/floatingip.go#L231-L267","documentation":"RenderOpenstack in floatingip.go:249 wraps an error from cloud.GetLBFloatingSubnet() while creating a floating IP. kops tries to allocate the FIP from the same subnet configured as the LB floating subnet; a failure resolving that subnet aborts FIP creation.","triggerScenarios":"GetLBFloatingSubnet errors when the configured floating subnet name/tag doesn't resolve in Neutron or the underlying subnet-list API call fails (auth/5xx).","commonSituations":"`kops set cluster` cloudConfig subnet/floatingSubnet names not matching real Neutron subnets; subnet renamed or deleted; permission issues listing subnets in the external network's project.","solutions":["Check the wrapped error; for API errors fix auth/permissions or Neutron health and rerun.","Verify the configured LB floating subnet exists: `openstack subnet list` and correct the cluster spec (e.g. api.floating / cloudConfig subnet settings).","If no dedicated floating subnet is wanted, remove the config so lbSubnet is nil and the FIP allocates from the default pool.","Rerun `kops update cluster --yes` after the config fix."],"exampleFix":"// before (cluster spec)\ncloudConfig:\n  floatingSubnet: \"lb-float-net\"  # renamed in OpenStack\n// after\ncloudConfig:\n  floatingSubnet: \"floating-net\"  # matches `openstack subnet list`","handlingStrategy":"validation","validationCode":"// ensure the configured floating subnet exists before creating FIPs\nsubnets, err := cloud.ListSubnets(subnets.ListOpts{Name: cfgFloatingSubnet})\nif err != nil || len(subnets) == 0 {\n    return fmt.Errorf(\"floating subnet %q not found in project\", cfgFloatingSubnet)\n}","typeGuard":"func subnetExists(subnets []subnets.Subnet, name string) bool {\n    for _, s := range subnets {\n        if s.Name == name {\n            return true\n        }\n    }\n    return false\n}","tryCatchPattern":"err := f.RenderOpenstack(target, a, e, changes)\nif err != nil && strings.Contains(err.Error(), \"Failed to find floatingip subnet\") {\n    // correct cloudConfig floatingSubnet or unset it to use defaults\n}","preventionTips":["Match the floatingSubnet config against `openstack subnet list` exactly","Update the cluster spec promptly after renaming OpenStack subnets","Grant the project rights to list subnets in the external network","Dry-run `kops update cluster` to catch subnet resolution errors early"],"tags":["openstack","neutron","floating-ip","subnet","config"],"backgroundTag":"missing-floating-subnet","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"}