cloudflare/cloudflared · error
REST request failed
Error message
REST request failed
What it means
Generic wrapper in the RESTClient's hostname routing path (RouteTunnel): the HTTP request to route a hostname/load-balancer pool for a tunnel failed at the transport level before any API status could be evaluated. The caller (hostname route commands) sees the network cause wrapped under this message.
Source
Thrown at cfapi/hostname.go:183
msg = "Added this tunnel as an origin in pool %[2]s which is already used by load balancer %[1]s"
case "unchanged,unchanged":
msg = "Load balancer %s already uses pool %s which has this tunnel as an origin"
case "unchanged,new":
// this state is not possible
fallthrough
default:
msg = "Something went wrong: failed to modify load balancer %s with pool %s; please check traffic manager configuration in the dashboard"
}
return fmt.Sprintf(msg, res.route.lbName, res.route.lbPool)
}
func (r *RESTClient) RouteTunnel(tunnelID uuid.UUID, route HostnameRoute) (HostnameRouteResult, error) {
endpoint := r.baseEndpoints.zoneLevel
endpoint.Path = path.Join(endpoint.Path, fmt.Sprintf("%v/routes", tunnelID))
resp, err := r.sendRequest("PUT", endpoint, route)
if err != nil {
return nil, errors.Wrap(err, "REST request failed")
}
defer resp.Body.Close()
if resp.StatusCode == http.StatusOK {
return route.UnmarshalResult(resp.Body)
}
return nil, r.statusCodeToError("add route", resp)
}
View on GitHub (pinned to 2253eeeb25)
Solutions
- Check connectivity to the Cloudflare API and any proxy configuration.
- Inspect the wrapped cause to distinguish DNS, TLS, and timeout failures.
- Retry transient transport errors; verify the tunnel ID and route parameters if persistent.
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at cfapi/hostname.go:183 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/eab56a8ac7b076dd.
Report an issue: GitHub.