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
gRPC-web stops communicating after the first communication of a large string submission #997
Comments
I haven't seen this before. You said it always works on your development machine but fails when deployed to Azure, which tends to indicate it is an issue with the Azure environment. I'm not an Azure expert so I don't know how you would debug from here. |
@JamesNK not sure who is the right person who can look into this problem at Azure team. Bottom line the issue I described is happening. |
@JamesNK I realized the following exceptions on Azure Server after making a slight change in the code. The large string which was a JSON string is now transmitted by a google.protobuf.Struct object.
And this one:
Also this one:
|
This test app is able to successfully call a test gRPC-Web website that is hosted in Azure. I believe it is hosted in Azure Linux so it isn't an exact reproduction. To test whether it is an IIS issue I also ran the app locally calling a gRPC server hosted in IIS Express. That also worked successfully. I don't know what the problem is, but it doesn't seem like an issue in gRPC. |
@JamesNK is your server side using the same dotnet core version as what I outlined before? |
@Arash-Sabet have you tried setting I don't think it should matter as you're below the default 4MB but it's about the only thing that springs to mind at the moment |
I tested with .NET Core 3.1 |
@Harkole I set |
@JamesNK
<PackageReference Include="Grpc.AspNetCore" Version="2.30.0" />
<PackageReference Include="Grpc.AspNetCore.Web" Version="2.30.0" /> |
@Arash-Sabet is it possible that it's a timeout that's occurring when working the data? I can't find the information at the moment but seem to recall there is a default timeout on |
@Harkole I ran the test (client code) that @JamesNK shared and it was fine in my end too. My protobuf file is a bit different from "Greeting application's" and it has a few extra fields but they shouldn't matter. The issue gets more complicated when the development machine exhibits a different behavior from Azure App. The gRPC communication on the development machine gives up after 50+ successful communications but the cloud's fails right after the first one. It will be great if James could tell us a bit about his server's configuration e.g. the exact .net core version, commit#, nuget packages' versions, etc. |
@Arash-Sabet that certainly rules out what I was initially thinking! There was an application I worked on, which when set up which was streaming file data over
Is it possible to test against a Kestrel configuration instead of IIS? The reply from @JamesNK above suggests it probably won't make a difference, however it never hurts to test these things out fully! |
@Harkole Yes, I will give that a try and let you know the results, hopefully by the end of this week or mid next week. |
Sorry I don't know what else to suggest, at this stage it is either the grpc-web has a limitation or bug or that IIS has a configuration issue but I don't know how to test either solution properly. My only thought would be a clean IIS installation with no configuration changes except those required to run this one app? |
If I am correct at the moment iis does not support it => https://docs.microsoft.com/en-us/aspnet/core/grpc/?view=aspnetcore-3.1 |
gRPC-web is supposed to address the problem for time being. @daanflore |
@Arash-Sabet Can you provide a repro app since we can't seem to repro (ConsoleApp51.zip works) |
@BrennanConroy Is the server application serving ConsoleApp51.zip hosted as a Kestrel on a VM? My server application was hosted on Azure App Services and also IIS Express locally that both exhibited the issue. After running the server application as a Kestrel app on a VM, the issue disappeared. |
I couldn't recreate the gRPC-Web issue in either App service, or in Kestrel - #997 (comment) And this issue only shows up in App service, which indicates it isn't a problem with the grpc-dotnet library. I'm going to close this unless there are any other suggestions. |
@JamesNK it only seems to affect IIS, I have seen it on Windows Server 2016 and on Application service plan running Windows as the host Anything using Kestrel is fine as far as I have managed to test Is there something that needs configured under IIS to enable support of the gRPC-web? |
I wasn't able to reproduce it with the greeter client+server modified to send a large string. I tested both with IIS Express on my local machine. Can you create a simple reproduction of this issue? I don't know whether there is a problem specific to these clients/services, or the type of IIS host. |
Sorry @JamesNK was on holiday last week and spending some time with the family I can't share the code for this as it's a unique system for a client but I'll try get a generic system that recreates the issue for you over the next few days if that's OK? |
@JamesNK I have recreated the issue with the I've used the specified versions in the above error logs and not the newer ones just yet, no changes were made to the Server generated host file other than to add in the
Now, I'm not actually getting the exact same error but it's running fine on Kestrel ( The code is actually failing with any string length, the exception is a The client code that failed is as follows:
Let me know if you want more information or if you think a remote session might help |
"Bad gRPC response" doesn't give any information about what is going on in the server. Did the website fail to start? Was there an exception while processing the gRPC call. What is logged in the server? https://docs.microsoft.com/en-us/aspnet/core/grpc/diagnostics?view=aspnetcore-3.1#grpc-services-logging |
In the original client code that this bug was found in, were you using I've found a bug when Fix: #1045 |
Morning @JamesNK I tried both configurations in the Client code, both times it errors in the same location (where the connection is attempted):
I need to look at the host code as it's not generating any logs despite following the instructions linked above but have ran out of time for now so will do this as soon as I can. I did turn the IIS site off and re-ran the test, this resulted in a |
A 503 error indicates the IIS app pool for the website isn't working. I'm pretty sure whatever problem you have is different from what was originally reported. |
@JamesNK I think you may have misread the last post, the 503 error was expected as I tested the application was accepting connections through the IIS configured site. At this stage I'm inclined to believe that IIS is still an issue when trying to host anything reliant on HTTP/2. Is there anywhere we can apply presure to Microsoft to update the |
IIS and HttpSys support enough HTTP/2 for gRPC-Web. Look, if there is an issue here, no progress is going to be made unless you either supply a reproduction of the issue, or you give diagnostics of what is going on. A 503 response code doesn't tell me anything other than the server had an error, not why. I have successfully sent a large string with gRPC-Web in many scenarios:
The only issue I noticed was poor performance when |
I'm going to close this issue. If you have more information it can be reopened later. |
I had the same error in Azure app service a year ago and the nightly builds fixed it. It has now reappeared (works perfectly fine in local machine and payloads upto to 100KB in the server), this is my issue #1320 did u manage to get it working? |
What version of gRPC and what language are you using?
C#
Server's configuration:
Client's configuration:
What operating system (Linux, Windows,...) and version?
Azure App Services (Windows)
Development environment: Windows 10, Visual Studio 2019
What runtime / compiler are you using (e.g. .NET Core SDK version
dotnet --info
).net core info:
C:\Temp>dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.302
Commit: 41faccf259
Runtime Environment:
OS Name: Windows
OS Version: 10.0.17763
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.1.302\
Host (useful for support):
Version: 3.1.6
Commit: 3acd9b0cd1
.NET Core SDKs installed:
3.1.102 [C:\Program Files\dotnet\sdk]
3.1.202 [C:\Program Files\dotnet\sdk]
3.1.302 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.1 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
What did you do?
We followed the same pattern as the Browser App suggests to setup a gRPC-web service. The client code which is a C# code prepares and submits a 2,937,558 bytes string to the gRPC-web application. Submitting the string to the gRPC-web app on development machine is consistently successful. Getting the same string submitted to the same app hosted on Azure results into success ONLY in the first call and all subsequent calls consistently fail. To recover from this situation, we have to restart the App Service on Azure. We also scaled up the service to P3V2 plan but that did not lead to a success.
What did you expect to see?
The gRPC-web app hosted on Azure should not fail in the subsequent calls.
What did you see instead?
Failure and exception in the client application per the following stack trace:
Anything else we should know about your project / environment?
The gRPC-web application was deployed as a self-contained application to Azure. The server does not log any failures or exceptions.
The text was updated successfully, but these errors were encountered: