{"record":{"id":"efde1ac9d9341c00","repo":"tursodatabase/turso","slug":"unexpected-describe-response-efde1a","errorCode":null,"errorMessage":"Unexpected describe response","messagePattern":"Unexpected describe response","errorType":"exception","errorClass":"TursoServerlessException","httpStatus":null,"severity":"error","filePath":"bindings/dotnet/src/Turso.Serverless.Client/TursoSession.cs","lineNumber":72,"sourceCode":"                throw new TursoServerlessException(result.Error?.Message ?? \"Describe execution failed\", result.Error?.Code);\n            }\n\n            if (result.Response is { Type: \"describe\", Result: { } resultElement })\n            {\n                var describe = resultElement.Deserialize<HranaDescribeResult>(new JsonSerializerOptions(JsonSerializerDefaults.Web));\n                if (describe is not null)\n                {\n                    return new TursoStatementDescription(\n                        parameterNames: describe.Params?.Select(static p => p.Name ?? \"\").ToArray() ?? [],\n                        columns: describe.Cols?.Select(static c => c.Name ?? \"\").ToArray() ?? [],\n                        columnTypes: describe.Cols?.Select(static c => c.Decltype ?? \"\").ToArray() ?? [],\n                        isExplain: describe.IsExplain,\n                        isReadonly: describe.IsReadonly);\n                }\n            }\n        }\n\n        throw new TursoServerlessException(\"Unexpected describe response\");\n    }\n\n    internal async Task<TursoResultSet> ExecuteAsync(string sql, HranaStatement statement, TimeSpan? queryTimeout, CancellationToken cancellationToken)\n    {\n        var request = new HranaCursorRequest\n        {\n            Baton = _baton,\n            Batch = new HranaBatch { Steps = [new HranaBatchStep { Statement = statement }] },\n        };\n\n        var entries = await RunCursorAsync(request, queryTimeout, cancellationToken).ConfigureAwait(false);\n\n        var columns = new List<string>();\n        var columnTypes = new List<string>();\n        var rows = new List<TursoRow>();\n        var rowsAffected = 0L;\n        long? lastInsertRowid = null;\n        IReadOnlyList<string>? rowColumns = null;","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/tursodatabase/turso/blob/244cde92a7df7f9b8b8b7a4075c35a12977e303e/bindings/dotnet/src/Turso.Serverless.Client/TursoSession.cs#L54-L90","documentation":"After a describe pipeline round-trip, the client expects the first result to carry a nested response.Result of type describe. When the response shape does not match — no nested result element, or an unrecognized type — it throws 'Unexpected describe response'. This is a protocol-shape mismatch, not a SQL error.","triggerScenarios":"options.Url pointing at a plain HTTP/JSON endpoint (REST API, health check route, HTML error page) instead of the Hrana endpoint; an intermediate gateway returning a differently-shaped body; a server build whose pipeline response format predates or postdates the client's expectations.","commonSituations":"Using the database URL from the Turso platform dashboard but with the wrong scheme/path; pointing at a local mock server during testing; corporate proxies injecting responses; major version mismatch between client package and server.","solutions":["Confirm the URL is the database's Hrana endpoint (libsql://...turso.io or its https/wss equivalent), not a dashboard or REST URL","Bypass proxies/gateways temporarily to see if the shape normalizes","Update Turso.Serverless.Client to the latest version to match current server protocol","Log the raw pipeline response body to identify what actually came back"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"var parsed = new Uri(opts.Url); // throws early for malformed URLs\nif (parsed.Scheme is not (\"libsql\" or \"https\" or \"wss\" or \"http\" or \"ws\")) throw new InvalidOperationException($\"Unexpected scheme {parsed.Scheme}\");","typeGuard":null,"tryCatchPattern":"try { var desc = await session.PrepareAsync(sql, ct); } catch (TursoServerlessException ex) when (ex.Message == \"Unexpected describe response\") { throw new InvalidOperationException($\"{opts.Url} is not speaking the Hrana protocol; check the endpoint and client/server versions\", ex); }","preventionTips":["Validate the endpoint with a curl of a minimal pipeline request during setup","Avoid proxies that rewrite bodies on the database route","Pin client and server versions together in deployment manifests"],"tags":["csharp","dotnet","hrana-protocol","protocol-mismatch"],"backgroundTag":"protocol-response-shape-unexpected","analyzedSha":"244cde92a7df7f9b8b8b7a4075c35a12977e303e","analyzedAt":"2026-08-20T07:02:18.389Z","contentChangedAt":"2026-08-20T07:02:18.389Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}