{"record":{"id":"01930b76a7a03a47","repo":"influxdata/influxdb","slug":"serde-json-error-0-persister","errorCode":null,"errorMessage":"serde_json error: {0}","messagePattern":"serde_json error: (.+?)","errorType":"error_code","errorClass":"PersisterError","httpStatus":null,"severity":"error","filePath":"influxdb3_write/src/persister.rs","lineNumber":53,"sourceCode":"use influxdb3_wal::SnapshotSequenceNumber;\nuse iox_time::TimeProvider;\nuse object_store::path::Path as ObjPath;\nuse object_store::{ObjectMeta, ObjectStore};\nuse object_store_utils::{AdaptiveGetExt, AdaptivePutExt};\nuse observability_deps::tracing::{debug, error, info, trace, warn};\nuse parking_lot::RwLock;\nuse parquet::arrow::ArrowWriter;\nuse parquet::basic::Compression;\nuse parquet::file::metadata::ParquetMetaData;\nuse parquet::file::properties::WriterProperties;\nuse tokio::sync::Semaphore;\n\n#[derive(Debug, thiserror::Error)]\npub enum PersisterError {\n    #[error(\"datafusion error: {0}\")]\n    DataFusion(#[from] DataFusionError),\n\n    #[error(\"serde_json error: {0}\")]\n    SerdeJson(#[from] serde_json::Error),\n\n    #[error(\"object_store error: {0}\")]\n    ObjectStore(#[from] object_store::Error),\n\n    #[error(\"parquet error: {0}\")]\n    ParquetError(#[from] parquet::errors::ParquetError),\n\n    #[error(\"tried to serialize a parquet file with no rows\")]\n    NoRows,\n\n    #[error(\"parse int error: {0}\")]\n    ParseInt(#[from] std::num::ParseIntError),\n\n    #[error(\"unexpected persister error: {0:?}\")]\n    Unexpected(#[from] anyhow::Error),\n\n    #[error(\"table snapshot persistence task panicked: {0}\")]","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_write/src/persister.rs#L35-L71","documentation":"PersisterError::SerdeJson wraps a serde_json::Error from serializing or deserializing JSON inside the Persister. With `#[from]`, any `?`-propagated serde_json failure — e.g. encoding table definitions or decoding persisted JSON manifests — becomes this variant.","triggerScenarios":"Persister calls `serde_json::to_*`/`from_*` when writing or reading JSON payloads to/from the object store (e.g. database/table definitions, snapshot manifests) and serialization fails due to malformed input or unsupported types.","commonSituations":"A JSON manifest in object storage was corrupted or hand-edited; struct definitions changed between versions making old persisted JSON incompatible; NaN/unsupported values passed to serialization.","solutions":["Inspect the inner serde_json message for the exact offset/reason of the parse or serialize failure.","Validate/repair the JSON object in the object store or delete it so it can be re-created.","Check for version skew: JSON persisted by an older influxdb3 may not deserialize with current structs.","Ensure values being serialized are JSON-compatible (no NaN/f64::INFINITY)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"serde_json::to_value(&payload).map_err(|e| e)?; // fails early with a clear reason","typeGuard":"fn is_serde_error(e: &PersisterError) -> bool {\n    matches!(e, PersisterError::SerdeJson(_))\n}","tryCatchPattern":"match persister.persist(...).await {\n    Err(PersisterError::SerdeJson(e)) => eprintln!(\"json failure at {}: {e}\", e.line()),\n    Err(e) => return Err(e.into()),\n    Ok(v) => v,\n}","preventionTips":["Round-trip payloads through serde_json::to_string/from_str in tests before writing to storage.","Never hand-edit JSON manifests in object storage.","Keep struct/field compatibility in mind when upgrading versions that persist JSON."],"tags":["serde","json","serialization","rust","wrapper-error"],"backgroundTag":"json-parse-error","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}