{"record":{"id":"3d34c786e960badc","repo":"clockworklabs/SpacetimeDB","slug":"invalid-http-method-returned-from-host","errorCode":null,"errorMessage":"Invalid HTTP method returned from host","messagePattern":"Invalid HTTP method returned from host","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"crates/bindings-csharp/Runtime/Http.cs","lineNumber":470,"sourceCode":"                Code = response.StatusCode,\n            },\n            response.Body.ToBytes()\n        );\n\n    private static HttpMethod FromWireMethod(HttpMethodWire methodWire) =>\n        methodWire switch\n        {\n            HttpMethodWire.Get => HttpMethod.Get,\n            HttpMethodWire.Head => HttpMethod.Head,\n            HttpMethodWire.Post => HttpMethod.Post,\n            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)","sourceCodeStart":452,"sourceCodeEnd":488,"githubUrl":"https://github.com/clockworklabs/SpacetimeDB/blob/524b4487d949b61a07d4f39c862d1290259dfd20/crates/bindings-csharp/Runtime/Http.cs#L452-L488","documentation":"FromWireMethod maps the HttpMethodWire sum type received from the host onto the SDK's HttpMethod. The switch covers the nine standard methods plus the Extension fallback; reaching the default arm means the decoded value does not correspond to any known tag - realistically only possible when host and SDK disagree on the wire schema. The exception is caught and returned as HttpError rather than crashing the procedure.","triggerScenarios":"A host newer than the SDK sends a HttpMethodWire variant the SDK's BSATN definitions decode into an unmatched value; schema drift in the FFI wire types after a partial upgrade.","commonSituations":"Host upgraded ahead of the module SDK; custom/edge host builds; beta channel versions adding new HTTP method handling.","solutions":["Upgrade the C# SDK NuGet to the version matching the SpacetimeDB host, then rebuild and redeploy the module","Verify spacetimedb CLI, server, and SDK all sit on the same release line","Treat the accompanying HttpError as a deployment/compatibility problem - do not retry the request","Report persistent mismatches with host and SDK version numbers"],"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 method returned from host\") => null, // host/SDK skew\n    onErr: err => throw new InvalidOperationException(err.ToString()));","preventionTips":["Keep host and SDK on the same release line; upgrade atomically","Alert on any 'returned from host' decode errors - they indicate protocol drift, not bad requests","Run integration tests against the exact host version you deploy to"],"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"}