{"record":{"id":"22bbdc4840f2651e","repo":"tursodatabase/turso","slug":"unable-to-parse-remote-type-response-ex-messag","errorCode":null,"errorMessage":"Unable to parse remote {Type} response: {ex.Message}","messagePattern":"Unable to parse remote (.+?) response: (.+?)","errorType":"exception","errorClass":"TursoException","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/src/Turso.Data/TursoRemoteClient.cs","lineNumber":559,"sourceCode":"    [JsonPropertyName(\"type\")]\n    public string Type { get; init; } = \"\";\n\n    [JsonPropertyName(\"result\")]\n    public JsonElement Result { get; init; }\n\n    public T DeserializeResult<T>()\n    {\n        if (Result.ValueKind is JsonValueKind.Undefined or JsonValueKind.Null)\n            throw new TursoException($\"Remote response {Type} did not include a result.\");\n\n        try\n        {\n            return Result.Deserialize<T>()\n                   ?? throw new TursoException($\"Remote response {Type} returned an empty result.\");\n        }\n        catch (JsonException ex)\n        {\n            throw new TursoException($\"Unable to parse remote {Type} response: {ex.Message}\");\n        }\n    }\n}\n\ninternal sealed class RemoteError\n{\n    [JsonPropertyName(\"message\")]\n    public string Message { get; init; } = \"\";\n\n    [JsonPropertyName(\"code\")]\n    public string? Code { get; init; }\n}\n\ninternal sealed class TursoRemoteSqlException(string message) : TursoException(message);\n\ninternal sealed class RemoteBatchResult\n{\n    [JsonPropertyName(\"step_results\")]","sourceCodeStart":541,"sourceCodeEnd":577,"githubUrl":"https://github.com/tursodatabase/turso/blob/244cde92a7df7f9b8b8b7a4075c35a12977e303e/bindings/dotnet/src/Turso.Data/TursoRemoteClient.cs#L541-L577","documentation":"The inner result payload of an execute or batch response did not match the expected CLR shape: deserializing it into RemoteStatementResult or RemoteBatchResult raised a JsonException, rethrown with the parser's message and the response type. Typical causes are field type changes -- cols/rows not being arrays, affected_row_count not numeric, or a last_insert_rowid shape the bindings cannot map.","triggerScenarios":"Remote command or batch execution where the \"result\" JSON exists but its fields violate the expected schema, for example rows entries that are objects instead of arrays, or a string where a number is required.","commonSituations":"Server newer or older than the bindings with schema drift in the result payload; custom /v2/pipeline implementations; middleware mangling nested types; preview server features emitting extra/renamed fields.","solutions":["Read the parser message embedded in the exception -- it names the JSON path and the expected type, which pinpoints the offending field.","Capture the raw envelope and compare the failing field with what the bindings expect.","Align server and Turso.Data package versions; result-schema changes track releases.","Test against a stock instance to rule out a custom server.","Report the raw payload if both sides are current."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { return await cmd.ExecuteReaderAsync(cancellationToken); }\ncatch (TursoException ex) when (ex.Message.StartsWith(\"Unable to parse remote \"))\n{\n    // parser message names the offending JSON path -- log it verbatim\n    logger.LogError(ex, \"Result schema mismatch for {Sql}\", cmd.CommandText);\n    throw;\n}","preventionTips":["Read the embedded parser message first: it pinpoints the field and expected type.","Upgrade server and Turso.Data bindings together; result-schema drift tracks releases.","Regression-test your real workload when either side is upgraded.","Avoid custom /v2/pipeline implementations that improvise field types."],"tags":["turso","dotnet","remote","json","schema","deserialization"],"backgroundTag":"invalid-json-response","analyzedSha":"244cde92a7df7f9b8b8b7a4075c35a12977e303e","analyzedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}