-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GrpcWebSocketBridge: Buffer is not large enough for header #26
Comments
I have come across this issue too, this exception is thrown in the latest version (version 6) I've downgraded to the following version and it works. MagicOnion.Client 5.1.8 |
I have also encountered that issue, but the solution is simple. var channel = GrpcChannel.ForAddress(address, new GrpcChannelOptions()
{
HttpHandler = new GrpcWebSocketBridgeHandler()
}); To: var channel = GrpcChannel.ForAddress(address, new GrpcChannelOptions()
{
HttpHandler = new GrpcWebSocketBridgeHandler(true)
}); |
Thanks it works as expected with the changes. |
While this solve this problem I don't think that issue is fully resolved since this parameter is undocumented. It easy to just follow basic example from Readme without realizing that this is and why it is needed. @mayuki |
Actually, it is partial solution.
The setting won't work in MAUI project.
There were more changes required to make it work on Android.
I will document it here in a while.
Sent from Outlook for Android<https://aka.ms/AAb9ysg>
…________________________________
From: KAW0 ***@***.***>
Sent: Monday, April 8, 2024 3:21:00 PM
To: Cysharp/GrpcWebSocketBridge ***@***.***>
Cc: Sen Gupta ***@***.***>; State change ***@***.***>
Subject: Re: [Cysharp/GrpcWebSocketBridge] GrpcWebSocketBridge: Buffer is not large enough for header (Issue #26)
While this solve this problem I don't think that issue is fully resolved since this parameter is undocumented. It easy to just follow basic example from Readme without realizing that this is and why it is needed. @neuecc<https://github.com/neuecc>
—
Reply to this email directly, view it on GitHub<#26 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AB5R3ZWK6EAVHY7MTUOLNKLY4JSAJAVCNFSM6AAAAABC7ZHVM2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBSGMZDKMJRGY>.
You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
We just released version 1.3.0. |
Here is my test results. Environment: Windows 11. (All nugets latest, magiconion and grpcwebsocketbridge. Connection from Windows: Successful with new upgrade. Case 1: Connecting from Windows MAUI App to MagicOnionGrpcServerChannel Configuration code:
Results: Working as expected. Case 2: Connecting from Android MAUI App to MagicOnionGrpcServer (Same App but running Android Build)
Result: Does not work on MAUI Android App. with above configuration. Workaround/Perhaps right way to create channel specific to MAUIAfter a little research and guidance from a reply of @JamesNK, I figured out that correct way to create a channel on MAUI app should be.
I belive current build 1.3 has fixed the existing issues and the issue specific to MAUI relates to the way we need to provision the channel is specific to Android. Thanks for such great tools and libraries. Love from New Delhi! |
I have forwarded it to a separate Issue because it is a different problem than this one that has been reported. |
Hello Team
The issue still occurs.
Environment: .Net 8, MagicOnion 6.0, GrpcWebSocketBridge 6.0
Network: Client->Cloudflare-Firewall->Proxy-Gprc
Observations: We see MagicOnion returning a success message
Request finished HTTP/2 POST https://www.fixme.com/IPortfoliosGrpcService/GetAllEntitiesAsync - 200 null application/grpc 20.9603ms
The grpc websocket bridge seems to be broken at the hightlighted code below.
ExceptionDetail.InnerException.Message
Buffer is not large enough for header
ExceptionDetail.InnerException.Source
GrpcWebSocketBridge.Client
ExceptionDetail.InnerException.TargetSite
Void MoveNext()
ExceptionDetail.InnerException.Type
System.InvalidOperationException
ExceptionDetail.Message
Status(StatusCode="Internal", Detail="Error starting gRPC call. InvalidOperationException: Buffer is not large enough for header", DebugException="System.InvalidOperationException: Buffer is not large enough for header")
ExceptionDetail.Source
System.Private.CoreLib
ExceptionDetail.Status._typeTag
Status
ExceptionDetail.Status.DebugException._typeTag
InvalidOperationException
ExceptionDetail.Status.DebugException.Data
[]
ExceptionDetail.Status.DebugException.HelpLink
ExceptionDetail.Status.DebugException.HResult
-2146233079
ExceptionDetail.Status.DebugException.InnerException
ExceptionDetail.Status.DebugException.Message
Buffer is not large enough for header
ExceptionDetail.Status.DebugException.Source
GrpcWebSocketBridge.Client
ExceptionDetail.Status.DebugException.StackTrace
at Grpc.Net.Client.Web.Internal.GrpcWebResponseStream.ReadAsync(Memory
1 data, CancellationToken cancellationToken) at Grpc.Net.Client.Internal.StreamExtensions.ReadMessageAsync[TResponse](Stream responseStream, GrpcCall call, Func
2 deserializer, String grpcEncoding, Boolean singleMessage, CancellationToken cancellationToken)at Grpc.Net.Client.Internal.GrpcCall
2.ReadMessageAsync(Stream responseStream, String grpcEncoding, Boolean singleMessage, CancellationToken cancellationToken) at Grpc.Net.Client.Internal.GrpcCall
2.RunCall(HttpRequestMessage request, Nullable`1 timeout)ExceptionDetail.Status.DebugException.TargetSite
Void MoveNext()
ExceptionDetail.Status.Detail
Error starting gRPC call. InvalidOperationException: Buffer is not large enough for header
ExceptionDetail.Status.StatusCode
Internal
ExceptionDetail.StatusCode
Internal
ExceptionDetail.TargetSite
Void Throw()
ExceptionDetail.Trailers
[]
The text was updated successfully, but these errors were encountered: