{"record":{"id":"3723fbb47dcf457e","repo":"influxdata/influxdb","slug":"serde-error-0","errorCode":null,"errorMessage":"serde error: {0}","messagePattern":"serde error: (.+?)","errorType":"http","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"influxdb3_server/src/http.rs","lineNumber":283,"sourceCode":"    MissingDeleteDatabaseParams,\n\n    /// Missing parameters for query\n    #[error(\"missing query parameters 'db' and 'q'\")]\n    MissingQueryParams,\n\n    /// Missing the `q` parameter in the v1 /query API\n    #[error(\"missing query parameter 'q'\")]\n    MissingQueryV1Params,\n\n    /// MIssing parameters for write\n    #[error(\"missing query parameter 'db'\")]\n    MissingWriteParams,\n\n    #[error(\"the mime type specified was not valid UTF8: {0}\")]\n    NonUtf8MimeType(#[from] FromUtf8Error),\n\n    /// Serde decode error\n    #[error(\"serde error: {0}\")]\n    SerdeUrlDecoding(#[from] serde_urlencoded::de::Error),\n\n    /// Arrow error\n    #[error(\"arrow error: {0}\")]\n    Arrow(#[from] arrow::error::ArrowError),\n\n    /// Hyper error\n    #[error(\"hyper http error: {0}\")]\n    Hyper(#[from] hyper::http::Error),\n\n    /// WriteBuffer error\n    #[error(\"write buffer error: {0}\")]\n    WriteBuffer(#[from] influxdb3_write::write_buffer::Error),\n\n    /// Persister error\n    #[error(\"persister error: {0}\")]\n    Persister(#[from] influxdb3_write::persister::PersisterError),\n","sourceCodeStart":265,"sourceCodeEnd":301,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_server/src/http.rs#L265-L301","documentation":"Occurs when the server fails to URL-decode query string parameters (e.g. db, q, precision) using serde_urlencoded. The de::Error is wrapped by #[from], so any malformed form/query payload that cannot deserialize into the endpoint's parameter struct surfaces as this error.","triggerScenarios":"GET/POST requests whose query string or x-www-form-urlencoded body contains values that fail deserialization (wrong types, unparseable numeric params like epoch/precision, malformed percent-encoding).","commonSituations":"Hand-crafted URLs with special characters not percent-encoded; passing strings where an integer is expected; double-encoding a parameter.","solutions":["Percent-encode query parameter values (spaces as %20, etc.)","Check each parameter's expected type (e.g. epoch/precision must be a known string) and pass a valid value","Remove or fix duplicated parameters and stray '&' or '=' characters in the query string","Use the official InfluxDB client library instead of hand-building URLs"],"exampleFix":"// before\nGET /query?db=my db&q=SELECT 1   (unencoded space)\n// after\nGET /query?db=my%20db&q=SELECT%201","handlingStrategy":"validation","validationCode":"const qs = new URLSearchParams();\nqs.set(\"db\", db);\nqs.set(\"q\", query);\nconst url = base + \"?\" + qs.toString(); // guarantees valid encoding","typeGuard":"function isSafeParam(v) { return typeof v === \"string\" && v.length > 0 && !/[^\\w\\- .,:*()=@%]/.test(v); }","tryCatchPattern":"try { const r = await fetch(url); } catch (e) {\n  if (String(e).includes(\"serde error\")) {\n    // rebuild query string with URLSearchParams and retry\n  }\n}","preventionTips":["Always percent-encode query parameters (URLSearchParams/encodeURIComponent)","Never hand-build query strings from user input","Verify numeric params (epoch, precision) have expected types","Add a unit test for URL construction with special characters"],"tags":["http","urlencoding","serde","query-parameter"],"backgroundTag":"invalid-query-parameter","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"}