{"record":{"id":"9da662dae2d71010","repo":"clockworklabs/SpacetimeDB","slug":"failed-to-serialize-http-response","errorCode":null,"errorMessage":"failed to serialize http response","messagePattern":"failed to serialize http response","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bindings/src/rt.rs","lineNumber":1214,"sourceCode":"    let timestamp = Timestamp::from_micros_since_unix_epoch(timestamp as i64);\n    let mut ctx = HandlerContext::new(timestamp);\n\n    let handlers = HTTP_HANDLERS.get().unwrap();\n    let request = read_bytes_source_as::<spacetimedb_lib::http::Request>(request);\n    // TODO(streaming-http): stop reading the full request body into guest memory once handlers\n    // can consume the body incrementally from the host-provided byte source.\n    let request_body = if request_body == BytesSource::INVALID {\n        bytes::Bytes::new()\n    } else {\n        let mut buf = IterBuf::take();\n        read_bytes_source_into(request_body, &mut buf);\n        buf.clone().into()\n    };\n    let request = http::request_from_wire(request, request_body);\n\n    let response = handlers[id](&mut ctx, request);\n    let (response_meta, response_body_bytes) = http::response_into_wire(response);\n    let bytes = bsatn::to_vec(&response_meta).expect(\"failed to serialize http response\");\n    write_to_sink(response_sink, &bytes);\n    write_to_sink(response_body_sink, &response_body_bytes);\n\n    0\n}\n\n/// Called by the host to execute an anonymous view.\n///\n/// The `args` is a `BytesSource`, registered on the host side,\n/// which can be read with `bytes_source_read`.\n/// The contents of the buffer are the BSATN-encoding of the arguments to the view.\n/// In the case of empty arguments, `args` will be 0, that is, invalid.\n///\n/// The output of the view is written to a `BytesSink`,\n/// registered on the host side, with `bytes_sink_write`.\n///\n/// Note, a previous version of the abi used a different return format for views.\n/// We used to write the return rows of the view directly to the sink.","sourceCodeStart":1196,"sourceCodeEnd":1232,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/bindings/src/rt.rs#L1196-L1232","documentation":"Error \"failed to serialize http response\" thrown in clockworklabs/SpacetimeDB.","triggerScenarios":"Thrown at crates/bindings/src/rt.rs:1214 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}