{"record":{"id":"af01033f4ec01e03","repo":"tursodatabase/turso","slug":"zstd-encoding-is-not-supported","errorCode":null,"errorMessage":"Zstd encoding is not supported","messagePattern":"Zstd encoding is not supported","errorType":"http","errorClass":null,"httpStatus":500,"severity":"error","filePath":"cli/sync_server.rs","lineNumber":499,"sourceCode":"                query_duration_ms: 0.0,\n            })\n        }\n    }\n\n    fn handle_pull_updates(&self, body: &[u8]) -> Result<HttpResponse> {\n        let req = <PullUpdatesReqProtoBody as Message>::decode(body)\n            .map_err(|e| anyhow!(\"Failed to decode PullUpdatesRequest: {}\", e))?;\n\n        debug!(\n            \"Pull updates request: server_revision={}, client_revision={}\",\n            req.server_revision, req.client_revision\n        );\n\n        let encoding =\n            PageUpdatesEncodingReq::try_from(req.encoding).unwrap_or(PageUpdatesEncodingReq::Raw);\n\n        if encoding == PageUpdatesEncodingReq::Zstd {\n            return Err(anyhow!(\"Zstd encoding is not supported\"));\n        }\n\n        if PullUpdatesStreamKind::try_from(req.stream_kind).unwrap_or(PullUpdatesStreamKind::Pages)\n            == PullUpdatesStreamKind::MvccLogicalLog\n        {\n            return self.handle_logical_pull_updates(&req);\n        }\n\n        self.handle_page_pull_updates(&req, PullUpdatesApplyMode::Incremental)\n    }\n\n    fn handle_page_pull_updates(\n        &self,\n        req: &PullUpdatesReqProtoBody,\n        apply_mode: PullUpdatesApplyMode,\n    ) -> Result<HttpResponse> {\n        let conn = self.conn.lock().unwrap();\n","sourceCodeStart":481,"sourceCodeEnd":517,"githubUrl":"https://github.com/tursodatabase/turso/blob/bad083fafbefdeae9a42ec19bdaaad8918dcf411/cli/sync_server.rs#L481-L517","documentation":"The `encoding` field of PullUpdatesReqProtoBody selects how page payloads are compressed. This test server implements only the Raw encoding and refuses an explicit Zstd request with HTTP 500 rather than silently returning an unexpected format. Unknown enum values are quietly coerced to Raw (try_from(...).unwrap_or(Raw)), so this fires only on a genuine Zstd request.","triggerScenarios":"A /pull-updates request with encoding = PageUpdatesEncodingReq::Zstd, typically from a client SDK configured for compressed sync.","commonSituations":"Enabling zstd on mobile or bandwidth-limited clients and then testing against the local tursodb sync server; copying production client configuration into a local test setup.","solutions":["Set encoding to Raw (0) or omit the field when talking to this server.","Point the zstd-configured client at a production sync endpoint that supports it.","If you own both ends, implement zstd encode/decode in the server's page response path and the client apply path."],"exampleFix":"// before\nlet req = PullUpdatesReqProtoBody { encoding: PageUpdatesEncodingReq::Zstd as i32, ..req.clone() };\n\n// after\nlet req = PullUpdatesReqProtoBody { encoding: PageUpdatesEncodingReq::Raw as i32, ..req.clone() };","handlingStrategy":"validation","validationCode":"if PageUpdatesEncodingReq::try_from(req.encoding) != Ok(PageUpdatesEncodingReq::Raw) {\n    // local sync server supports Raw only\n    req.encoding = PageUpdatesEncodingReq::Raw as i32;\n}","typeGuard":null,"tryCatchPattern":"On 500 'Zstd encoding is not supported', re-issue the pull with encoding=Raw (0) instead of retrying unchanged.","preventionTips":["Check which encodings an endpoint supports before enabling compression on the client.","Gate zstd behind a server capability flag, not a client-only config option."],"tags":["sync","compression","zstd","pull-updates","protocol"],"backgroundTag":"unsupported-encoding","analyzedSha":"bad083fafbefdeae9a42ec19bdaaad8918dcf411","analyzedAt":"2026-08-16T23:12:11.798Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}