{"record":{"id":"0d50046dd2ab2525","repo":"hasura/graphql-engine","slug":"serialization-error-0","errorCode":null,"errorMessage":"Serialization error: {0}","messagePattern":"Serialization error: (.+?)","errorType":"exception","errorClass":"BuildRequestError","httpStatus":null,"severity":"error","filePath":"v3/crates/plugins/pre-ndc-request-plugin/src/execute.rs","lineNumber":59,"sourceCode":"    InvalidHeaderName {\n        header_name: String,\n        #[source]\n        error: InvalidHeaderName,\n    },\n    #[error(\"Invalid header value for header {header_name}: {error}\")]\n    InvalidHeaderValue {\n        header_name: HeaderName,\n        #[source]\n        error: InvalidHeaderValue,\n    },\n    #[error(\"Failed to convert session: {0}\")]\n    SessionConversionError(String),\n    #[error(\"Failed to convert session variable '{variable_name}': {error}\")]\n    SessionVariableConversionError {\n        variable_name: SessionVariableName,\n        error: serde_json::Error,\n    },\n    #[error(\"Serialization error: {0}\")]\n    SerializationError(#[from] serde_json::Error),\n}\n\nimpl TraceableError for Error {\n    fn visibility(&self) -> ErrorVisibility {\n        match self {\n            Error::BuildRequestError(_, _) => ErrorVisibility::Internal,\n            Error::PluginUserError { .. }\n            | Error::ReqwestError(_)\n            | Error::PluginRequestParseError(_)\n            | Error::ErrorWhileMakingHTTPRequestToTheHook(_, _)\n            | Error::UnexpectedStatusCode(_)\n            | Error::PluginInternalError { .. } => ErrorVisibility::User,\n        }\n    }\n}\n\n#[derive(Deserialize, Debug, Clone)]","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/plugins/pre-ndc-request-plugin/src/execute.rs#L41-L77","documentation":"A generic serde_json failure raised while serializing the request payload for the pre-NDC-request plugin (this variant is #[from] serde_json::Error). It means the request struct could not be turned into JSON at all — typically a non-string map key or a type that serde_json cannot represent. Distinct from PluginRequestParseError, which is about parsing the response.","triggerScenarios":"serde_json::to_value / to_string on the outgoing request fails inside build_request, e.g. a serialized map with a non-string key or a Serialize impl that errors.","commonSituations":"Custom connector or plugin code adding non-JSON-representable values to the request; engine/plugin version skew changing request types; bugs in a custom Serialize implementation.","solutions":["Enable debug logging of the outgoing request to find which field fails to serialize","Ensure any custom map keys are strings and values are JSON-representable","Align engine and plugin crate versions so the request struct serializes cleanly","Simplify the request (remove custom extensions) to isolate the failing field"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"let probe = serde_json::to_value(&sample_request)?; // catches bad Serialize early in tests","typeGuard":null,"tryCatchPattern":"match serde_json::to_value(&req) {\n    Ok(v) => v,\n    Err(e) => return Err(Error::SerializationError(e)),\n}","preventionTips":["Unit-test serialization of all request types","Keep engine and plugin crate versions aligned"],"tags":["rust","serde","serialization","plugin","json"],"backgroundTag":"json-serialization-failed","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}