{"record":{"id":"02e1200a16c03943","repo":"kubernetes/kops","slug":"failed-to-find-floatingip-subnet-v-02e120","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/router.go","lineNumber":114,"sourceCode":"\t\tklog.V(2).Infof(\"Creating Router with name:%q\", fi.ValueOf(e.Name))\n\n\t\topt := routers.CreateOpts{\n\t\t\tName:                  fi.ValueOf(e.Name),\n\t\t\tAdminStateUp:          new(true),\n\t\t\tAvailabilityZoneHints: fi.StringSliceValue(e.AvailabilityZoneHints),\n\t\t}\n\t\tfloatingNet, err := t.Cloud.GetExternalNetwork()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error creating router.  Could not list external networks for gateway: %v\", err)\n\t\t}\n\n\t\topt.GatewayInfo = &routers.GatewayInfo{\n\t\t\tNetworkID: floatingNet.ID,\n\t\t}\n\n\t\trouterFloatingSubnet, err := t.Cloud.GetExternalSubnet()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to find floatingip subnet: %v\", err)\n\t\t}\n\t\tif routerFloatingSubnet != nil {\n\t\t\topt.GatewayInfo.ExternalFixedIPs = []routers.ExternalFixedIP{\n\t\t\t\t{\n\t\t\t\t\tSubnetID: routerFloatingSubnet.ID,\n\t\t\t\t},\n\t\t\t}\n\t\t}\n\n\t\tv, err := t.Cloud.CreateRouter(opt)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error creating router: %v\", err)\n\t\t}\n\t\te.ID = new(v.ID)\n\t\tklog.V(2).Infof(\"Creating a new Openstack router, id=%s\", v.ID)\n\t\treturn nil\n\t}\n\te.ID = a.ID","sourceCodeStart":96,"sourceCodeEnd":132,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstacktasks/router.go#L96-L132","documentation":"This error is raised in the Openstack Router task's RenderOpenstack (router.go:114) while building the gateway options for a new Neutron router. After resolving the external network, kOps calls Cloud.GetExternalSubnet() to discover the floating-IP subnet to pin the router's external gateway to; if that lookup fails for any reason, the underlying error is wrapped with this message and cluster creation is aborted.","triggerScenarios":"Cloud.GetExternalSubnet() returns an error during `kops update cluster` on OpenStack — typically the Neutron subnet-list API call fails, the external (floating) network has no visible subnets due to policy/ACL restrictions, or the external network configuration in the cloud is missing/misconfigured so the lookup can't resolve a subnet.","commonSituations":"Operator hasn't created a subnet on the external network, the credentials/project used by kOps lack permission to list subnets on the external network, a typo'd or stale --os-* env/cluster config points at a project that can't see the floating network, or a Neutron outage/timeout occurs mid-apply.","solutions":["Verify the external network has at least one subnet: `openstack network show <ext-net>` and `openstack subnet list --network <ext-net>`; create one if missing","Check Neutron RBAC/policy so the kOps project can list subnets on the external network (admin or shared network RBAC)","Re-run with klog -v=2 / check the wrapped inner error to identify whether it's auth, timeout, or empty-result related","Retry the apply after resolving transient Neutron API issues"],"exampleFix":"// before: floating subnet missing on external network\n$ openstack subnet list --network public\n(empty)\n// after\n$ openstack subnet create --network public --subnet-range 203.0.113.0/24 public-subnet","handlingStrategy":"validation","validationCode":"// before applying, verify external network/subnet visibility\nsubnets, err := netClient.ListSubnets(subnets.ListOpts{NetworkID: extNetID}).AllPages()\nif err != nil { return fmt.Errorf(\"cannot list subnets on external network %s: %w\", extNetID, err) }\nif len(subnets) == 0 { return fmt.Errorf(\"external network %s has no subnets; create one before kops update\", extNetID) }","typeGuard":null,"tryCatchPattern":"// wrap the apply and surface the inner cause\nif err := kopsUpdate(); err != nil {\n    var gerr gophercloud.ErrUnexpectedResponseCode\n    if errors.As(err, &gerr) && gerr.Actual == http.StatusForbidden {\n        log.Printf(\"check Neutron RBAC: cannot list subnets on external network: %v\", gerr)\n    }\n    return err\n}","preventionTips":["Ensure the external network has a subnet before running kops","Grant the kOps project RBAC access to the shared/external network","Use klog -v=2 to surface wrapped Neutron errors early","Validate OS_* credentials with `openstack subnet list` before applying"],"tags":["openstack","networking","router","neutron"],"backgroundTag":"external-subnet-not-found","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"}