{"record":{"id":"6a8ee1ed87ae7bba","repo":"kubernetes/kops","slug":"failed-to-retrieve-subnet-s-in-loadbalancer-cre","errorCode":null,"errorMessage":"Failed to retrieve subnet `%s` in loadbalancer creation: %v","messagePattern":"Failed to retrieve subnet `(.+?)` in loadbalancer creation: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"upup/pkg/fi/cloudup/openstacktasks/lb.go","lineNumber":202,"sourceCode":"\t\tif changes.ID != nil {\n\t\t\treturn fi.CannotChangeField(\"ID\")\n\t\t}\n\t\tif changes.Name != nil {\n\t\t\treturn fi.CannotChangeField(\"Name\")\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc (_ *LB) RenderOpenstack(t *openstack.OpenstackAPITarget, a, e, changes *LB) error {\n\tif a == nil {\n\t\tklog.V(2).Infof(\"Creating LB with Name: %q\", fi.ValueOf(e.Name))\n\n\t\tsubnets, err := t.Cloud.ListSubnets(subnets.ListOpts{\n\t\t\tName: fi.ValueOf(e.Subnet),\n\t\t})\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Failed to retrieve subnet `%s` in loadbalancer creation: %v\", fi.ValueOf(e.Subnet), err)\n\t\t}\n\t\tif len(subnets) != 1 {\n\t\t\treturn fmt.Errorf(\"Unexpected desired subnets for `%s`.  Expected 1, got %d\", fi.ValueOf(e.Subnet), len(subnets))\n\t\t}\n\n\t\tlbopts := loadbalancers.CreateOpts{\n\t\t\tName:        fi.ValueOf(e.Name),\n\t\t\tVipSubnetID: subnets[0].ID,\n\t\t}\n\t\tif e.FlavorID != nil {\n\t\t\tlbopts.FlavorID = fi.ValueOf(e.FlavorID)\n\t\t}\n\t\tlb, err := t.Cloud.CreateLB(lbopts)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error creating LB: %v\", err)\n\t\t}\n\t\te.ID = new(lb.ID)\n\t\te.PortID = new(lb.VipPortID)","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/upup/pkg/fi/cloudup/openstacktasks/lb.go#L184-L220","documentation":"Listing Neutron subnets by the configured subnet name failed during load-balancer creation. The wrapped error identifies the API failure; the subnet is needed as the LB's VIP subnet.","triggerScenarios":"Thrown at upup/pkg/fi/cloudup/openstacktasks/lb.go:202 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped Neutron error","Verify the subnet name in the cluster spec exists","Retry after the API failure clears"],"exampleFix":null,"handlingStrategy":"retry","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"}