{"record":{"id":"eab56a8ac7b076dd","repo":"cloudflare/cloudflared","slug":"rest-request-failed-eab56a","errorCode":null,"errorMessage":"REST request failed","messagePattern":"REST request failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cfapi/hostname.go","lineNumber":183,"sourceCode":"\t\tmsg = \"Added this tunnel as an origin in pool %[2]s which is already used by load balancer %[1]s\"\n\tcase \"unchanged,unchanged\":\n\t\tmsg = \"Load balancer %s already uses pool %s which has this tunnel as an origin\"\n\tcase \"unchanged,new\":\n\t\t// this state is not possible\n\t\tfallthrough\n\tdefault:\n\t\tmsg = \"Something went wrong: failed to modify load balancer %s with pool %s; please check traffic manager configuration in the dashboard\"\n\t}\n\n\treturn fmt.Sprintf(msg, res.route.lbName, res.route.lbPool)\n}\n\nfunc (r *RESTClient) RouteTunnel(tunnelID uuid.UUID, route HostnameRoute) (HostnameRouteResult, error) {\n\tendpoint := r.baseEndpoints.zoneLevel\n\tendpoint.Path = path.Join(endpoint.Path, fmt.Sprintf(\"%v/routes\", tunnelID))\n\tresp, err := r.sendRequest(\"PUT\", endpoint, route)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"REST request failed\")\n\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode == http.StatusOK {\n\t\treturn route.UnmarshalResult(resp.Body)\n\t}\n\n\treturn nil, r.statusCodeToError(\"add route\", resp)\n}\n","sourceCodeStart":165,"sourceCodeEnd":193,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/cfapi/hostname.go#L165-L193","documentation":"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.","triggerScenarios":"Thrown at cfapi/hostname.go:183 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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."],"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"}