cloudflare/cloudflared · error
REST request failed
Error message
REST request failed
What it means
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.
Source
Thrown at cfapi/ip_route.go:149
}
type GetRouteByIpParams struct {
Ip net.IP
// Optional field. If unset, backend will assume the default vnet for the account.
VNetID *uuid.UUID
}
// ListRoutes calls the Tunnelstore GET endpoint for all routes under an account.
// Due to pagination on the server side it will call the endpoint multiple times if needed.
func (r *RESTClient) ListRoutes(filter *IpRouteFilter) ([]*DetailedRoute, error) {
fetchFn := func(page int) (*http.Response, error) {
endpoint := r.baseEndpoints.accountRoutes
filter.Page(page)
endpoint.RawQuery = filter.Encode()
rsp, err := r.sendRequest("GET", endpoint, nil)
if err != nil {
return nil, errors.Wrap(err, "REST request failed")
}
if rsp.StatusCode != http.StatusOK {
rsp.Body.Close()
return nil, r.statusCodeToError("list routes", rsp)
}
return rsp, nil
}
return fetchExhaustively[DetailedRoute](fetchFn)
}
// AddRoute calls the Tunnelstore POST endpoint for a given route.
func (r *RESTClient) AddRoute(newRoute NewRoute) (Route, error) {
endpoint := r.baseEndpoints.accountRoutes
endpoint.Path = path.Join(endpoint.Path)
resp, err := r.sendRequest("POST", endpoint, newRoute)
if err != nil {
return Route{}, errors.Wrap(err, "REST request failed")
}View on GitHub (pinned to 2253eeeb25)
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.
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at cfapi/ip_route.go:149 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of cloudflare/cloudflared@2253eeeb25 (2026-09-06).
Data as JSON: /api/errors/10e8826da187dc45.
Report an issue: GitHub.