tursodatabase/turso · error
Zstd encoding is not supported
Error message
Zstd encoding is not supported
What it means
The pull request set the page-updates encoding to Zstd, but this test sync server implements only Raw page encoding and rejects compressed pulls outright. Note that unknown encoding values are mapped to Raw via try_from(...).unwrap_or(Raw), so only an explicit Zstd request produces this error.
Solutions
- Set the client's page-updates encoding to Raw for this server
- Disable page/response compression in the sync client settings
- If compression is required, run a server build that implements Zstd page encoding instead of this test server
Example fix
// before req.encoding = PageUpdatesEncodingReq::Zstd as i32; // after req.encoding = PageUpdatesEncodingReq::Raw as i32;
Defensive patterns
Strategy: fallback
Validate before calling
// client side: only Raw is supported by this server const SUPPORTED_ENCODINGS = new Set(['Raw']); if (!SUPPORTED_ENCODINGS.has(encoding)) encoding = 'Raw';
Try / catch
try {
await client.pull({ encoding: wanted });
} catch (e) {
if (String(e).includes('Zstd encoding is not supported')) {
await client.pull({ encoding: 'Raw' }); // retry uncompressed
} else throw e;
} Prevention
- Default the sync client to Raw against local/test servers
- Check server capability before enabling compression, rather than assuming cloud defaults
When it happens
Trigger: Setting encoding to the Zstd variant in a PullUpdatesRequest against this server; enabling response/page compression in the sync client configuration and issuing a page pull.
Common situations: Copying client configuration from Turso Cloud (which supports compression) to the local test sync server; a newer client defaulting to zstd; testing a compression path against a server that never implemented it.
Related errors
- buffer too short for u32 at offset
- buffer too short for u64 at offset
- database page is missing from replace-base snapshot
- database page number does not fit u32
- Empty request
AI-assisted analysis of tursodatabase/turso@492c4a71cd (2026-08-20).
Data as JSON: /api/errors/af01033f4ec01e03.
Report an issue: GitHub.
Appendix: source
Thrown at cli/sync_server.rs:602
query_duration_ms: 0.0,
})
}
}
fn handle_pull_updates(&self, db: &DbHandle, body: &[u8]) -> Result<HttpResponse> {
let req = <PullUpdatesReqProtoBody as Message>::decode(body)
.map_err(|e| anyhow!("Failed to decode PullUpdatesRequest: {}", e))?;
debug!(
"Pull updates request: server_revision={}, client_revision={}",
req.server_revision, req.client_revision
);
let encoding =
PageUpdatesEncodingReq::try_from(req.encoding).unwrap_or(PageUpdatesEncodingReq::Raw);
if encoding == PageUpdatesEncodingReq::Zstd {
return Err(anyhow!("Zstd encoding is not supported"));
}
if PullUpdatesStreamKind::try_from(req.stream_kind).unwrap_or(PullUpdatesStreamKind::Pages)
== PullUpdatesStreamKind::MvccLogicalLog
{
return self.handle_logical_pull_updates(db, &req);
}
self.handle_page_pull_updates(db, &req, PullUpdatesApplyMode::Incremental)
}
fn handle_page_pull_updates(
&self,
db: &DbHandle,
req: &PullUpdatesReqProtoBody,
apply_mode: PullUpdatesApplyMode,
) -> Result<HttpResponse> {
let conn = db.conn.lock().unwrap();View on GitHub (pinned to 492c4a71cd)