{"record":{"id":"37d9e67b833ba8a4","repo":"tursodatabase/turso","slug":"empty-pipeline-response","errorCode":null,"errorMessage":"Empty pipeline response","messagePattern":"Empty pipeline response","errorType":"exception","errorClass":"TursoServerlessException","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/src/Turso.Serverless.Client/HranaHttp.cs","lineNumber":37,"sourceCode":"    internal static async Task<HranaPipelineResponse> ExecutePipelineAsync(\n        HttpClient httpClient,\n        string baseUrl,\n        string? authToken,\n        string? remoteEncryptionKey,\n        HranaPipelineRequest request,\n        CancellationToken cancellationToken)\n    {\n        using var httpRequest = CreateRequest($\"{baseUrl}/v3/pipeline\", authToken, remoteEncryptionKey, request);\n\n        using var response = await httpClient.SendAsync(httpRequest, HttpCompletionOption.ResponseContentRead, cancellationToken).ConfigureAwait(false);\n        if (!response.IsSuccessStatusCode)\n        {\n            throw new TursoServerlessException($\"HTTP error! status: {(int)response.StatusCode}\");\n        }\n\n        var body = await response.Content.ReadAsStringAsync(cancellationToken).ConfigureAwait(false);\n        return JsonSerializer.Deserialize<HranaPipelineResponse>(body, JsonOptions)\n            ?? throw new TursoServerlessException(\"Empty pipeline response\");\n    }\n\n    internal static async Task<(HranaCursorResponse Response, IAsyncEnumerable<HranaCursorEntry> Entries)> ExecuteCursorAsync(\n        HttpClient httpClient,\n        string baseUrl,\n        string? authToken,\n        string? remoteEncryptionKey,\n        HranaCursorRequest request,\n        CancellationToken cancellationToken)\n    {\n        var httpRequest = CreateRequest($\"{baseUrl}/v3/cursor\", authToken, remoteEncryptionKey, request);\n\n        HttpResponseMessage? response = null;\n        StreamReader? reader = null;\n        try\n        {\n            response = await httpClient.SendAsync(httpRequest, HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);\n","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/tursodatabase/turso/blob/244cde92a7df7f9b8b8b7a4075c35a12977e303e/bindings/dotnet/src/Turso.Serverless.Client/HranaHttp.cs#L19-L55","documentation":"After a successful (2xx) pipeline response, the body is deserialized into HranaPipelineResponse; a null result throws TursoServerlessException with this message. A null only arises when the body is empty/whitespace or the literal JSON null — a healthy pipeline endpoint always returns an object with a results array.","triggerScenarios":"A 200 response with an empty body: misrouted baseUrl (static host, wrong port), a proxy or gateway that swallowed the body, health-check responses, or the literal string null from a misbehaving intermediary.","commonSituations":"Corporate proxies or API gateways rewriting responses; baseUrl pointing at a dashboard/static domain instead of the database endpoint; rare server-side incidents returning empty 200s.","solutions":["Confirm the baseUrl actually targets the database's HTTP endpoint (test the same pipeline with curl).","Bypass or configure intermediaries (proxy, gateway) that may strip bodies; check their logs.","Retry once — empty 200s from infrastructure glitches are usually transient.","If reproducible only through your stack, capture the raw response (status, headers, length) to pinpoint which hop emptied it."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// verify the endpoint serves the pipeline protocol before relying on it\nusing var probe = new HttpClient();\nvar resp = await probe.PostAsync(url + \"/v3/pipeline\", new StringContent(\"{\\\"requests\\\":[]}\", Encoding.UTF8, \"application/json\"));\nvar body = await resp.Content.ReadAsStringAsync();\nif (string.IsNullOrWhiteSpace(body)) throw new InvalidOperationException(\"Endpoint returned an empty body; check baseUrl/proxy\");","typeGuard":null,"tryCatchPattern":"catch (TursoServerlessException ex) when (ex.Message == \"Empty pipeline response\")\n{\n    if (attempt < 2) { await Task.Delay(backoff); continue; } // transient empty 200\n    throw; // persistent: wrong endpoint or body-stripping intermediary\n}","preventionTips":["Point baseUrl at the database HTTP endpoint, never a dashboard/static host.","Disable body-rewriting in proxies on this route.","Monitor response content-length in integration checks to catch emptied bodies early."],"tags":["dotnet","http","hrana-protocol","empty-body","deserialization"],"backgroundTag":"empty-response-body","analyzedSha":"244cde92a7df7f9b8b8b7a4075c35a12977e303e","analyzedAt":"2026-08-20T07:02:18.389Z","contentChangedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}