{"record":{"id":"2aaa34407afa35ab","repo":"kubernetes/kops","slug":"error-creating-router-could-not-list-external-ne","errorCode":null,"errorMessage":"Error creating router.  Could not list external networks for gateway: %v","messagePattern":"Error creating router\\.  Could not list external networks for gateway: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstacktasks/router.go","lineNumber":105,"sourceCode":"\t\tif changes.AvailabilityZoneHints != nil {\n\t\t\treturn fi.CannotChangeField(\"AvailabilityZoneHints\")\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (_ *Router) RenderOpenstack(t *openstack.OpenstackAPITarget, a, e, changes *Router) error {\n\tif a == nil {\n\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","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstacktasks/router.go#L87-L123","documentation":"Router.RenderOpenstack, while creating a router, calls t.Cloud.GetExternalNetwork() to determine the floating/external network for the router gateway. If that lookup fails, the error is wrapped with this message, indicating the router could not be configured with an external gateway.","triggerScenarios":"Create path (a==nil) and GetExternalNetwork returns an error — no external network can be listed (none marked router:external, listing API error, or auth failure).","commonSituations":"Openstack deployment has no external network defined (no network with router:external=True); the project lacks visibility of the external network; Neutron API/credential issues; `externalNet` config mismatch in the kops cluster spec.","solutions":["Verify an external network exists: `openstack network list --external` (needs router:external=True)","Create or designate an external/floating network in the Openstack cloud if missing","Check the cluster spec's external network configuration matches the cloud","Grant the project access to the shared external network if visibility is the issue","Inspect the wrapped error for API/auth failures and re-run kops"],"exampleFix":"null","handlingStrategy":"validation","validationCode":"extNets, err := cloud.ListNetworks(networks.ListOpts{\"router:external\": true})\nif err != nil || len(extNets) == 0 {\n    return fmt.Errorf(\"no external network with router:external=True available for router gateway\")\n}","typeGuard":null,"tryCatchPattern":"floatingNet, err := t.Cloud.GetExternalNetwork()\nif err != nil {\n    return fmt.Errorf(\"Error creating router.  Could not list external networks for gateway: %v\", err)\n} // fix cloud config (external network) before retrying","preventionTips":["Confirm `openstack network list --external` returns a network before cluster create","Create/designate a floating IP network in the Openstack cloud","Ensure the project has visibility of the shared external network","Match the kops spec's external network setting to the actual cloud topology"],"tags":["openstack","neutron","router","gateway"],"backgroundTag":"missing-external-network","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"}