{"record":{"id":"f3857bce2074c5b4","repo":"cloudflare/cloudflared","slug":"quick-tunnel-provisioning-failed-with-status-d","errorCode":null,"errorMessage":"quick tunnel provisioning failed with status %d: %s","messagePattern":"quick tunnel provisioning failed with status (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cloudflared/tunnel/quick_tunnel.go","lineNumber":86,"sourceCode":"\treq.Header.Add(\"Content-Type\", \"application/json\")\n\treq.Header.Add(\"User-Agent\", buildInfo.UserAgent())\n\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to request quick Tunnel\")\n\t}\n\tdefer func() { _ = resp.Body.Close() }()\n\n\t// This will read the entire response into memory so we can print it in case of error\n\trespBody, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to read quick-tunnel response\")\n\t}\n\n\tif resp.StatusCode < 200 || resp.StatusCode >= 300 {\n\t\tvar data QuickTunnelResponse\n\t\tif err := json.Unmarshal(respBody, &data); err == nil && len(data.Errors) > 0 {\n\t\t\treturn fmt.Errorf(\"quick tunnel provisioning failed with status %d: %s\", resp.StatusCode, formatQuickTunnelErrors(data.Errors))\n\t\t}\n\t\treturn fmt.Errorf(\"quick tunnel provisioning failed with status %d: %s\", resp.StatusCode, string(respBody))\n\t}\n\n\tvar data QuickTunnelResponse\n\tif err := json.Unmarshal(respBody, &data); err != nil {\n\t\trespString := string(respBody)\n\t\tfields := map[string]interface{}{\"status_code\": resp.Status}\n\t\tsc.log.Err(err).Fields(fields).Msgf(\"Error unmarshaling QuickTunnel response: %s\", respString)\n\t\treturn errors.Wrap(err, \"failed to unmarshal quick Tunnel\")\n\t}\n\n\t// TODO(TUN-10791): Add CLI-level coverage that provisioning errors are logged to users.\n\tif len(data.Errors) > 0 {\n\t\treturn fmt.Errorf(\"quick tunnel provisioning failed: %s\", formatQuickTunnelErrors(data.Errors))\n\t}\n\n\tif !data.Success {","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/cmd/cloudflared/tunnel/quick_tunnel.go#L68-L104","documentation":"RunQuickTunnel provisions a free trycloudflare.com quick tunnel via an HTTP API. When the response status code is outside 2xx and the response body parses as a QuickTunnelResponse containing structured errors, cloudflared surfaces the status code plus the formatted API errors. This is the API's structured error path.","triggerScenarios":"The quick-tunnel provisioning endpoint (api.trycloudflare.com) returns a 4xx/5xx with a JSON body whose `errors` array is non-empty — e.g. rate limiting, service outage, or rejected requests.","commonSituations":"Running `cloudflared tunnel --url localhost:8080` behind a corporate proxy that intercepts the request; Cloudflare API incidents; too many quick tunnels from one IP hitting rate limits.","solutions":["Read the formatted API errors in the message and address the specific cause (e.g. wait out a rate limit)","Retry after a short delay — quick-tunnel provisioning is a free shared service and transient 5xx/429s are common","Check the Cloudflare status page for ongoing incidents; use a named tunnel instead if you need guaranteed availability","Verify no corporate proxy/TLS interception is altering the request to the provisioning API"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"resp, err := http.Get(quickTunnelEndpoint)\nif err == nil && resp.StatusCode >= 400 {\n    return fmt.Errorf(\"quick tunnel API unhealthy (status %d); use a named tunnel\", resp.StatusCode)\n}","typeGuard":"func is2xx(code int) bool { return code >= 200 && code < 300 }","tryCatchPattern":"tunnel, err := RunQuickTunnel(c)\nif err != nil {\n    log.Error().Err(err).Msg(\"quick tunnel provisioning failed; retrying with backoff\")\n    // retry with exponential backoff, or fall back to named tunnel\n}","preventionTips":["Monitor the Cloudflare status page before relying on quick tunnels in demos/CI","Use named tunnels for anything production or automated","Set retry with backoff around provisioning in scripts","Avoid networks with TLS interception when using quick tunnels"],"tags":["network","http","quick-tunnel","api"],"backgroundTag":"http-error-response","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"}