{"record":{"id":"1ce8803e217c2434","repo":"tursodatabase/turso","slug":"remote-response-type-returned-an-empty-result","errorCode":null,"errorMessage":"Remote response {Type} returned an empty result.","messagePattern":"Remote response (.+?) returned an empty result\\.","errorType":"exception","errorClass":"TursoException","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/src/Turso.Data/TursoRemoteClient.cs","lineNumber":555,"sourceCode":"}\n\ninternal sealed class RemoteStreamResponse\n{\n    [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);","sourceCodeStart":537,"sourceCodeEnd":573,"githubUrl":"https://github.com/tursodatabase/turso/blob/244cde92a7df7f9b8b8b7a4075c35a12977e303e/bindings/dotnet/src/Turso.Data/TursoRemoteClient.cs#L537-L573","documentation":"A defensive guard in DeserializeResult: the result payload was present and non-null as JSON, but deserializing it into the target type returned null. For the reference types used here (RemoteStatementResult, RemoteBatchResult) that combination is effectively unreachable -- treat it as a binding or server bug rather than a configuration problem.","triggerScenarios":"Remote execute or batch execution where Result.Deserialize<T>() yields null despite a non-null JsonElement; only producible by pathological payloads (for example interning/custom converter behavior) or a bug in the bindings themselves.","commonSituations":"Almost never seen in practice; if it appears, it accompanies exotic JSON shapes from custom servers or nonstandard serialization middleware.","solutions":["Capture the full raw response body for the failing request.","Reproduce the statement against a stock (cloud) instance to rule out a custom server.","Update to the latest Turso.Data bindings in case the guard logic changed.","File an issue with the raw payload -- this path indicates a defect, not misuse."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { return await cmd.ExecuteReaderAsync(cancellationToken); }\ncatch (TursoException ex) when (ex.Message.Contains(\"returned an empty result\"))\n{\n    logger.LogError(ex, \"Binding/server defect suspected; capture the raw envelope and report\");\n    throw;\n}","preventionTips":["Treat this guard as a defect indicator: capture the full raw response body when it fires.","Keep bindings updated; guard logic evolves with releases.","Verify against a stock cloud instance to rule out custom-server payloads.","Include the payload in any issue you file."],"tags":["turso","dotnet","remote","json","deserialization"],"backgroundTag":"null-deserialization-result","analyzedSha":"244cde92a7df7f9b8b8b7a4075c35a12977e303e","analyzedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}