{"record":{"id":"8e6b69d790cdc8d3","repo":"DioxusLabs/dioxus","slug":"backend-not-ready-after-max-wait-e","errorCode":null,"errorMessage":"Backend not ready after {max_wait:?}: {e}","messagePattern":"Backend not ready after (.+?): (.+?)","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"packages/cli/src/serve/proxy.rs","lineNumber":42,"sourceCode":"    url: &Uri,\n    req: Request<MyBody>,\n    handle_error: fn(Error) -> Response<Body>,\n) -> std::result::Result<Response<hyper::body::Incoming>, Response<Body>> {\n    let host = url.host().unwrap_or(\"127.0.0.1\");\n    let port = url.port_u16().unwrap_or(80);\n    let addr = format!(\"{host}:{port}\");\n\n    let mut backoff = std::time::Duration::from_millis(100);\n    let max_wait = std::time::Duration::from_secs(30);\n    let start = std::time::Instant::now();\n\n    // Retry TCP connect until backend is ready\n    let stream = loop {\n        match TcpStream::connect(&addr).await {\n            Ok(stream) => break stream,\n            Err(e) => {\n                if start.elapsed() >= max_wait {\n                    return Err(handle_error(anyhow::anyhow!(\n                        \"Backend not ready after {max_wait:?}: {e}\"\n                    )));\n                }\n                tracing::debug!(\"Backend not ready, retrying in {backoff:?}...\");\n                tokio::time::sleep(backoff).await;\n                backoff = (backoff * 2).min(std::time::Duration::from_secs(2));\n            }\n        }\n    };\n\n    // Wrap the TCP stream for hyper\n    let io = TokioIo::new(stream);\n\n    // Perform HTTP/1.1 handshake on the same connection\n    let (mut sender, conn) = http1::handshake(io)\n        .await\n        .map_err(|e| handle_error(anyhow::anyhow!(\"HTTP handshake failed: {e}\")))?;\n","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/fda3dc9c2b10ddf4417edcbb98caa9613ac92d26/packages/cli/src/serve/proxy.rs#L24-L60","documentation":"Retry exhaustion in send_with_retry (called from proxy_to): the proxy loop retried TcpStream::connect to the configured backend host:port with exponential backoff (100ms doubling, capped at 2s) until the 30-second max_wait elapsed without a successful connection. This means the proxied backend never came up — the inputs at fault are the backend address and the last connection error shown.","triggerScenarios":"Thrown at packages/cli/src/serve/proxy.rs:42 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The backend did not become ready in time. Ensure the backend server starts cleanly; fix its startup errors."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fda3dc9c2b10ddf4417edcbb98caa9613ac92d26","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}