Closed edavedian closed 4 years ago
@edavedian Thank you for the bug report.
This is very interesting because you are getting the same error "The server returned an invalid or unrecognized response" with two different HTTP stack implementations. Unfortunately, that error message is not descriptive enough to determine the problem.
In order to diagnose this further, we will need additional logs. Can you get a Wireshark trace and/or System.Net logs (.NET Core logs using PerfView)?
For System.Net .NET Core tracing, see this:https://github.com/dotnet/corefx/blob/master/Documentation/debugging/windows-instructions.md#using-perfview
I have sought help from Microsoft support and it is very difficult to get any kind of System.Net based trace in this environment.
Do you currently have an active support case with Microsoft Product Support? If so, you should continue to use that mechanism as well. Please have the support engineer reach out to our team for further coordination.
cc: @karelz
@davidsh Thank you very much. I will ask the Microsoft support engineer to reach out to your team. Since all the communication is over SSL, would a wireshark trace help? I originally thought that this might be the symptom of a random TCP reset but I was able to generate socket resets using tcpkill and the exception was completely different. I will ask the support engineer to see if they can get System.NET tracing using the page you provided. Any idea why I can't capture a crash dump using procdump with arguments -e 1 -f WinHttpException or -e 1 -f HttpRequestException and will that be any helpful if I am able to capture a crash dump?
@davidsh I have to correct myself as this is occurring against 2 types of servers in INT environment and only 1 type of server in PROD environment which leads be to believe that this is a server related issue. We will just build a retry logic around this particular exception.
I've written a post, regarding the troubleshooting I have done with Edwin, at Case study - Intermittent “The server returned an invalid or unrecognized response.” error
@JuntaoZhu We are experiencing a similar issue, and the link to the blog post returns a 404. Is that blog post available elsewhere?
Sorry for the inconvenience. I've fixed it. Please try again. It should be working now. Thanks for reporting it to me.
Thankyou for that blog post @JuntaoZhu, it was helpful.
We are facing exactly the same error in production environment every 10 minutes. There is a schedule job doing several HTTP requests every 15 seconds. Only the first one fails. When retried, it works on the first retry and all the subsequent HTTP are succeeding. The same service is targeted using a Java Jetty HTTP client without any issue. The targeted service is running with latest Jetty HTTP server on Linux REHL 7.
I'm not sure it's helping you but I do think there is something strange in the underlying HTTP (or TCP) client.
Hi guys, just want to mention that, this is currently affecting our production. @davidsh is there going to be a fix in versions 2.x? Thank you very much.
@rui-ktei
Hi guys, just want to mention that, this is currently affecting our production. @davidsh is there going to be a fix in versions 2.x? Thank you very much.
Is there a specific PR that was already fixed in master that you would like to be ported to release/2.1 servicing?
It's not clear your problem is related to this issue. In fact, this issue itself was closed because the original reporter of the issue determined it was a server issue and not a bug in CoreFx.
If you have a repro for your error, please open a new issue with enough information so that it can be diagnosed to determine a possible root cause (perhaps already fixed in .NET Core 3.0 or perhaps something unique).
We are using ASP.NET Core 2.1 deployed on Windows Azure App Service which is intermittently experiencing The server returned an invalid or unrecognized response when using GET and POST. This issue had been happening for a while but since it wasn't reported by any of consuming clients we recently noticed it when browsing the logs. This application communicates with several downstream services and this seems to occur randomly with all of them. The downstream services use Azure App Gateway, Apache HTTPD 2.4.6 and AWS ALB as front end servers. The issue occurs with both RESTful calls and SOAP based calls using WCF. I have sought help from Microsoft support and it is very difficult to get any kind of System.Net based trace in this environment. I also tried the Crash Diagnoser extension and set a first time exception trigger for either HttpRequestException or WinHttpException but somehow the crash dump wasn't generated. It is also very difficult to repro the issue and I have tried everything to repro it but have not been successful.
Here are the stacktraces:
Just to see if there is a difference, I set DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER to false to use the WinHttpHandler instead of SocketsHttpHandler and the issue still occurred but with a slightly different stacktrace:
Your help is greatly appreciated as this is currently a production issue.