{"record":{"id":"dd7880541bdb3bfe","repo":"clockworklabs/SpacetimeDB","slug":"e-dd7880","errorCode":null,"errorMessage":"{e}","messagePattern":"\\{e\\}","errorType":"http","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/cli/src/subcommands/call.rs","lineNumber":143,"sourceCode":"                match argument.as_bytes() {\n                    [b'0', b'x', ..] => format!(\"[\\\"{argument}\\\"]\"),\n                    [b'c', b'2', b'0', b'0', ..] => format!(\"[\\\"0x{argument}\\\"]\"),\n                    _ => argument.to_string(),\n                }\n            }\n            AlgebraicType::String if !argument.starts_with('\\\"') || !argument.ends_with('\\\"') => {\n                format!(\"\\\"{argument}\\\"\")\n            }\n            _ => argument.to_string(),\n        });\n\n    let arg_json = format!(\"[{}]\", arguments.format(\", \"));\n    let res = api.call(reducer_procedure_name, arg_json).await?;\n\n    if let Err(e) = res.error_for_status_ref() {\n        let Ok(response_text) = res.text().await else {\n            // Cannot give a better error than this if we don't know what the problem is.\n            bail!(e);\n        };\n\n        let error = Err(e).context(format!(\"Response text: {response_text}\"));\n\n        let error_msg =\n            if response_text.starts_with(\"no such reducer\") || response_text.starts_with(\"no such procedure\") {\n                no_such_reducer_or_procedure(&database_identity, database, reducer_procedure_name, &module_def)\n            } else if response_text.starts_with(\"invalid arguments\") {\n                invalid_arguments(\n                    &database_identity,\n                    database,\n                    &response_text,\n                    owning_def.typespace(),\n                    reducer_procedure_name,\n                    call_def,\n                )\n            } else {\n                return error;","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/6dee26c6efc2856793e12b148a59742964f5d783/crates/cli/src/subcommands/call.rs#L125-L161","documentation":"Surfaced by `spacetime call` when the reducer-invocation HTTP response has an error status AND the attempt to read the response body for a better message itself fails. The CLI can only re-raise the underlying transport error (status/URL, no body context), so what you see means: the call failed at HTTP level and even the error body could not be read.","triggerScenarios":"POST to the call endpoint returns non-2xx and `res.text().await` errors — connection reset mid-body, proxy truncation, TLS interruption, or the server crashing while streaming the error response.","commonSituations":"Flaky networks, corporate proxies, an overloaded or restarting server, or a database publish failure that kills the connection before the error body is flushed.","solutions":["Retry the call — transient transport failure is the usual cause","Check server health and logs: `spacetime logs`, server process status, or a restart","Verify the database and reducer exist (`spacetime describe <db>`, `spacetime describe <db> reducer <name>`) to rule out 404-style causes hidden by the missing body","If behind a proxy, bypass it or raise body-size/timeout limits"],"exampleFix":"# before\nspacetime call my-db add Alice\n# Error: HTTP status client error ... (no response text)\n\n# after\n# 1) confirm the target exists\nspacetime describe my-db reducer add\n# 2) retry; if it persists, inspect the server\nspacetime logs --server local","handlingStrategy":"retry","validationCode":"// fail fast with a readable error before calling\nlet db = api.database(&name).await.map_err(|e| anyhow::anyhow!(\"db lookup failed: {e}\"))?;","typeGuard":null,"tryCatchPattern":"match res.error_for_status_ref() {\n    Ok(_) => {}\n    Err(e) if e.is_connect() || e.is_timeout() || e.is_body() => { /* backoff and retry */ }\n    Err(e) => return Err(e).context(\"reducer call failed\"),\n}","preventionTips":["Health-check the host before scripted `spacetime call` batches","Wrap call scripts in bounded retry loops for transient transport errors","Keep proxies from truncating response bodies (raise limits, bypass for the API host)"],"tags":["cli","http","reducer-call","network","transport"],"backgroundTag":"http-error-response","analyzedSha":"6dee26c6efc2856793e12b148a59742964f5d783","analyzedAt":"2026-08-20T06:08:37.179Z","contentChangedAt":"2026-08-20T06:08:37.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}