{"record":{"id":"952fd8a6b35d2166","repo":"cloudflare/cloudflared","slug":"failed-to-request-quick-tunnel","errorCode":null,"errorMessage":"failed to request quick Tunnel","messagePattern":"failed to request quick Tunnel","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/cloudflared/tunnel/quick_tunnel.go","lineNumber":73,"sourceCode":"\t\t},\n\t\tTimeout: httpTimeout,\n\t}\n\n\treqBody, err := buildQuickTunnelRequestBody(isProtected)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to build quick tunnel request body\")\n\t}\n\n\treq, err := http.NewRequest(http.MethodPost, fmt.Sprintf(\"%s/tunnel\", sc.c.String(\"quick-service\")), bytes.NewReader(reqBody))\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"failed to build quick tunnel request\")\n\t}\n\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","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/cloudflare/cloudflared/blob/2253eeeb25a44a713a4b60b8ba1e1b3f377d1a0f/cmd/cloudflared/tunnel/quick_tunnel.go#L55-L91","documentation":"The HTTP request that provisions a quick (trycloudflare) tunnel failed at the transport level — cloudflared could not complete the POST to the quick-tunnel API. errors.Wrap attaches the underlying net/http error (DNS, TLS, timeout, connection refused).","triggerScenarios":"client.Do(req) returns a non-nil error when POSTing to `<quick-service>/tunnel` during `cloudflared tunnel --url ...` quick-tunnel setup.","commonSituations":"No internet access or blocked outbound HTTPS; corporate proxy/firewall dropping the request; DNS failures resolving the quick-service host; TLS interception appliances; transient network outage.","solutions":["Verify outbound network connectivity (e.g. `curl -v https://api.trycloudflare.com/tunnel`)","Check proxy/firewall rules and set HTTPS_PROXY if a proxy is required","Retry after transient network issues; cloudflared retries connections but provisioning is a single request","Inspect the wrapped error for DNS vs TLS vs timeout to pinpoint the cause"],"exampleFix":"// before\n$ cloudflared tunnel --url http://localhost:8080   # on airgapped host\n// after\n$ export HTTPS_PROXY=http://corp-proxy:3128\n$ cloudflared tunnel --url http://localhost:8080","handlingStrategy":"retry","validationCode":"// preflight\nif _, err := net.LookupHost(\"api.trycloudflare.com\"); err != nil {\n    return fmt.Errorf(\"cannot resolve quick-tunnel API host: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"if err := runQuickTunnel(ctx, ...); err != nil {\n    var nerr net.Error\n    if errors.As(err, &nerr) && nerr.Timeout() {\n        // backoff and retry provisioning\n    }\n    return err\n}","preventionTips":["Ensure outbound HTTPS (443) is allowed","Configure HTTPS_PROXY in corporate networks","Check DNS resolution before running headless jobs"],"tags":["go","network","http","cli"],"backgroundTag":"api-request-failed","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"}