{"record":{"id":"5709c50f8eb5ad5d","repo":"clockworklabs/SpacetimeDB","slug":"invalid-http-version-returned-from-host","errorCode":null,"errorMessage":"Invalid HTTP version returned from host","messagePattern":"Invalid HTTP version returned from host","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"crates/bindings-csharp/Runtime/Http.cs","lineNumber":481,"sourceCode":"            HttpMethodWire.Put => HttpMethod.Put,\n            HttpMethodWire.Delete => HttpMethod.Delete,\n            HttpMethodWire.Connect => HttpMethod.Connect,\n            HttpMethodWire.Options => HttpMethod.Options,\n            HttpMethodWire.Trace => HttpMethod.Trace,\n            HttpMethodWire.Patch => HttpMethod.Patch,\n            HttpMethodWire.Extension(var extension) => new HttpMethod(extension),\n            _ => throw new InvalidOperationException(\"Invalid HTTP method returned from host\"),\n        };\n\n    private static HttpVersion FromWireVersion(HttpVersionWire versionWire) =>\n        versionWire switch\n        {\n            HttpVersionWire.Http09 => HttpVersion.Http09,\n            HttpVersionWire.Http10 => HttpVersion.Http10,\n            HttpVersionWire.Http11 => HttpVersion.Http11,\n            HttpVersionWire.Http2 => HttpVersion.Http2,\n            HttpVersionWire.Http3 => HttpVersion.Http3,\n            _ => throw new InvalidOperationException(\"Invalid HTTP version returned from host\"),\n        };\n\n    private static (\n        ushort statusCode,\n        HttpVersion version,\n        List<HttpHeader> headers\n    ) FromWireResponse(HttpResponseWire responseWire)\n    {\n        var version = FromWireVersion(responseWire.Version);\n\n        var headers = responseWire\n            .Headers.Entries.Select(h => new HttpHeader(h.Name, h.Value, false))\n            .ToList();\n\n        return (responseWire.Code, version, headers);\n    }\n}\n","sourceCodeStart":463,"sourceCodeEnd":499,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/bindings-csharp/Runtime/Http.cs#L463-L499","documentation":"FromWireVersion translates the HttpVersionWire sum from the host (Http09 through Http3) into the SDK's HttpVersion enum. Hitting the default arm means the decoded wire value matched none of the known tags, which in practice indicates host/SDK protocol schema drift rather than any client input problem. As with the other host-decode failures, it is converted to Result.Err(HttpError).","triggerScenarios":"Module SDK older than the host receives a HttpVersionWire encoding it cannot map; partial upgrade where only one side of the FFI contract moved.","commonSituations":"Rolling server upgrades while modules were built with an older SDK; mixing pinned SDK versions across services talking to one host.","solutions":["Match the module SDK NuGet version to the host version and republish the module","Confirm no component (CLI/server/SDK) is on a different major or preview line","Surfacing this as HttpError is expected - handle it as a compatibility failure and stop issuing HTTP calls until redeployed","File an issue with both version strings if alignment does not resolve it"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"var result = http.Send(request);\nreturn result.Match<HttpResponse?>(\n    onOk: resp => resp,\n    onErr: err when err.ToString().Contains(\"Invalid HTTP version returned from host\") => null, // protocol drift\n    onErr: err => throw new InvalidOperationException(err.ToString()));","preventionTips":["Version-lock SDK and host; rebuild modules whenever the host is upgraded","Treat host-decode failures as deployment incidents, not transient errors","Automate a version-compatibility check in the deploy pipeline"],"tags":["csharp","http","ffi","version-mismatch","spacetimedb"],"backgroundTag":"wire-protocol-version-mismatch","analyzedSha":"524b4487d949b61a07d4f39c862d1290259dfd20","analyzedAt":"2026-08-16T23:58:54.611Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}