{"record":{"id":"10e8826da187dc45","repo":"cloudflare/cloudflared","slug":"rest-request-failed-10e882","errorCode":null,"errorMessage":"REST request failed","messagePattern":"REST request failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cfapi/ip_route.go","lineNumber":149,"sourceCode":"}\n\ntype GetRouteByIpParams struct {\n\tIp net.IP\n\t// Optional field. If unset, backend will assume the default vnet for the account.\n\tVNetID *uuid.UUID\n}\n\n// ListRoutes calls the Tunnelstore GET endpoint for all routes under an account.\n// Due to pagination on the server side it will call the endpoint multiple times if needed.\nfunc (r *RESTClient) ListRoutes(filter *IpRouteFilter) ([]*DetailedRoute, error) {\n\tfetchFn := func(page int) (*http.Response, error) {\n\t\tendpoint := r.baseEndpoints.accountRoutes\n\t\tfilter.Page(page)\n\t\tendpoint.RawQuery = filter.Encode()\n\t\trsp, err := r.sendRequest(\"GET\", endpoint, nil)\n\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"REST request failed\")\n\t\t}\n\t\tif rsp.StatusCode != http.StatusOK {\n\t\t\trsp.Body.Close()\n\t\t\treturn nil, r.statusCodeToError(\"list routes\", rsp)\n\t\t}\n\t\treturn rsp, nil\n\t}\n\treturn fetchExhaustively[DetailedRoute](fetchFn)\n}\n\n// AddRoute calls the Tunnelstore POST endpoint for a given route.\nfunc (r *RESTClient) AddRoute(newRoute NewRoute) (Route, error) {\n\tendpoint := r.baseEndpoints.accountRoutes\n\tendpoint.Path = path.Join(endpoint.Path)\n\tresp, err := r.sendRequest(\"POST\", endpoint, newRoute)\n\tif err != nil {\n\t\treturn Route{}, errors.Wrap(err, \"REST request failed\")\n\t}","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/cfapi/ip_route.go#L131-L167","documentation":"Transport-level wrapper in RESTClient.ListRoutes: the per-page GET request to the account routes endpoint failed (network error) before an HTTP status was obtained. Pagination halts and the wrapped cause is returned to callers listing IP routes.","triggerScenarios":"Thrown at cfapi/ip_route.go:149 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check connectivity to the Cloudflare API endpoint.","Inspect the wrapped cause (timeout, DNS, TLS) and retry transient failures.","If listing with filters, verify the filter flags produce a valid query string."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f","analyzedAt":"2026-09-06T04:14:33.757Z","contentChangedAt":"2026-09-06T04:14:33.757Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}