{"record":{"id":"3290078ab7f9fd53","repo":"clockworklabs/SpacetimeDB","slug":"unknown-http-version","errorCode":null,"errorMessage":"Unknown HTTP version: {:?}","messagePattern":"Unknown HTTP version: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/bindings/src/http.rs","lineNumber":677,"sourceCode":"    http::Request::from_parts(parts, body)\n}\n\n#[cfg(feature = \"unstable\")]\npub(crate) fn response_into_wire(response: http::Response<Body>) -> (st_http::Response, Bytes) {\n    let (parts, body) = response.into_parts();\n    let st_response = st_http::Response {\n        headers: parts\n            .headers\n            .into_iter()\n            .map(|(k, v)| (k.map(|k| k.as_str().into()), v.as_bytes().into()))\n            .collect(),\n        version: match parts.version {\n            http::Version::HTTP_09 => st_http::Version::Http09,\n            http::Version::HTTP_10 => st_http::Version::Http10,\n            http::Version::HTTP_11 => st_http::Version::Http11,\n            http::Version::HTTP_2 => st_http::Version::Http2,\n            http::Version::HTTP_3 => st_http::Version::Http3,\n            _ => unreachable!(\"Unknown HTTP version: {:?}\", parts.version),\n        },\n        code: parts.status.as_u16(),\n    };\n\n    // TODO(streaming-http): stop collecting the whole response body here once handler\n    // responses can write incrementally to a body sink.\n    (st_response, body.into_bytes())\n}\n\n/// Represents the body of an HTTP request or response.\npub struct Body {\n    inner: BodyInner,\n}\n\nimpl Body {\n    /// Treat the body as a sequence of bytes.\n    pub fn into_bytes(self) -> Bytes {\n        match self.inner {","sourceCodeStart":659,"sourceCodeEnd":695,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/6dee26c6efc2856793e12b148a59742964f5d783/crates/bindings/src/http.rs#L659-L695","documentation":"Thrown while converting an `http` crate `Version` into the SpacetimeDB bindings' `st_http::Version`: the value matched none of the mapped arms. The match already covers HTTP/0.9 through HTTP/3, which is every variant of the current `http` enum, so this `unreachable!` is a guard against a future `http` release adding a new variant (e.g. HTTP/4) that this mapping predates. If you hit it, your binary mixes an `http` crate whose enum no longer matches the code compiled against it.","triggerScenarios":"Any path that turns a parsed `http::Response` into `st_http::Response` (response handling in crates/bindings/src/http.rs) after the `http` dependency was upgraded to a version that added a new `Version` variant; the wildcard arm then panics at runtime on responses carrying that version.","commonSituations":"A `cargo update` or transitive `http` upgrade in a workspace using older spacetimedb-bindings; partially recompiled workspaces where bindings were not rebuilt against the new `http`; a hypothetical future HTTP version negotiated by a newer stack.","solutions":["Check Cargo.lock for an unexpected `http` upgrade and pin the previous version: `cargo update -p http --precise <old-version>`","Upgrade spacetimedb / spacetimedb-bindings to a release whose mapping covers the new HTTP version","If you maintain this code, replace the wildcard arm with an explicit mapping or a real error instead of `unreachable!`"],"exampleFix":"// before\nlet version = match parts.version {\n    http::Version::HTTP_09 => st_http::Version::Http09,\n    http::Version::HTTP_10 => st_http::Version::Http10,\n    http::Version::HTTP_11 => st_http::Version::Http11,\n    http::Version::HTTP_2 => st_http::Version::Http2,\n    http::Version::HTTP_3 => st_http::Version::Http3,\n    _ => unreachable!(\"Unknown HTTP version: {:?}\", parts.version),\n};\n\n// after (fail with an error instead of panicking)\nlet version = match parts.version {\n    http::Version::HTTP_09 => st_http::Version::Http09,\n    http::Version::HTTP_10 => st_http::Version::Http10,\n    http::Version::HTTP_11 => st_http::Version::Http11,\n    http::Version::HTTP_2 => st_http::Version::Http2,\n    http::Version::HTTP_3 => st_http::Version::Http3,\n    other => return Err(unsupported_http_version(other)),\n};","handlingStrategy":"validation","validationCode":"# Cargo.toml — keep `http` locked to the version your bindings were built against\n[dependencies]\nhttp = \"=1.2.0\"","typeGuard":"fn is_supported_http_version(v: http::Version) -> bool {\n    matches!(\n        v,\n        http::Version::HTTP_09\n            | http::Version::HTTP_10\n            | http::Version::HTTP_11\n            | http::Version::HTTP_2\n            | http::Version::HTTP_3\n    )\n}","tryCatchPattern":"This is a panic, not a Result. If you call the bindings across an FFI or worker boundary, wrap the conversion in std::panic::catch_unwind and surface a 'rebuild against the current http crate' error instead of crashing the host process.","preventionTips":["Lock the `http` crate version in Cargo.lock when depending on spacetimedb-bindings","Do a full clean rebuild after dependency upgrades so bindings and `http` stay in sync","Check the `http` crate changelog for new Version variants before upgrading"],"tags":["rust","http","panic","version-mismatch","bindings"],"backgroundTag":"unsupported-http-version","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"}