{"record":{"id":"4b2cce546742dc4b","repo":"cube-js/cube","slug":"method-path-failed-with-status-detail","errorCode":null,"errorMessage":"{method} {path} failed with {status}: {detail}","messagePattern":"(.+?) (.+?) failed with (.+?): (.+?)","errorType":"http","errorClass":"ApiError","httpStatus":null,"severity":"error","filePath":"rust/cube-cli/src/client.rs","lineNumber":409,"sourceCode":"        let (mut status, mut text) = send(build_form(), self.token()).await?;\n        if status == StatusCode::UNAUTHORIZED && self.try_refresh().await? {\n            let (s, t) = send(build_form(), self.token()).await?;\n            status = s;\n            text = t;\n        }\n        self.finish_response(&Method::POST, path, status, text)\n    }\n\n    /// Shared tail of every request: error mapping + JSON/HTML handling.\n    fn finish_response(\n        &self,\n        method: &Method,\n        path: &str,\n        status: StatusCode,\n        text: String,\n    ) -> Result<Value> {\n        if !status.is_success() {\n            return Err(anyhow::Error::new(ApiError {\n                status,\n                method: method.clone(),\n                path: path.to_string(),\n                detail: failure_detail(&text),\n            }));\n        }\n\n        if text.trim().is_empty() {\n            return Ok(Value::Null);\n        }\n        // Cube Cloud serves the web app (200 + HTML) for unknown routes.\n        // Surface that as \"endpoint not available\" instead of returning the\n        // HTML as a JSON string, which downstream renders as an empty table.\n        let trimmed = text.trim_start();\n        let looks_like_html =\n            trimmed.len() >= 2 && trimmed.starts_with('<') && !trimmed.starts_with(\"<?xml\");\n        if looks_like_html {\n            api_bail!(","sourceCodeStart":391,"sourceCodeEnd":427,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/rust/cube-cli/src/client.rs#L391-L427","documentation":"The ApiError tail of every cube-cli HTTP request (finish_response): the server responded with a non-success HTTP status. The placeholders carry the method, path, status code, and the response body detail. This is not a transport failure — the server was reached and deliberately rejected the request, so retrying unchanged will usually fail again.","triggerScenarios":"Thrown at rust/cube-cli/src/client.rs:409 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the {detail} body — it usually names the concrete validation or auth problem","Fix the request payload, path, or credentials based on the status code (401/403 auth, 400 validation, 404 wrong path)","For persistent failures, capture the status and body and report them to the server operators"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}