runtime: HttpStress app generating query strings explicitly rejected by Kestrel default limits
C:\git\corefx\src\System.Net.Http\tests\StressTests\HttpStress>dotnet run -n 10 -maxContentLength 4000 -http 2.0 -ops 3 -numParameters 4
.NET Core: 3.0.0-preview7-27902-19
ASP.NET Core: 3.0.0-preview7.19353.9
Tracing: False
ASP.NET Log: False
Concurrency: 10
Content Length: 4000
HTTP Versions: 2.0
Lifetime: (infinite)
Operations: GET Parameters
Random Seed: 1327321578
Query Parameters: 4
All the inputs are valid uris as otherwise the system throws uri is too long exception.
Starting 10 client workers.
Error from iteration 21 (GET Parameters) in task 4 with 150 successes / 8 fails:
System.Net.Http.HttpRequestException: An error occurred while sending the request.
---> System.IO.IOException: The request was aborted.
---> System.Net.Http.Http2ProtocolException: The HTTP/2 request failed with protocol error 'COMPRESSION_ERROR' (0x9).
--- End of inner exception stack trace ---
at System.Net.Http.Http2Connection.Http2Stream.TryEnsureHeaders()
at System.Net.Http.Http2Connection.Http2Stream.ReadResponseHeadersAsync(CancellationToken cancellationToken)
at System.Net.Http.Http2Connection.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at System.Net.Http.Http2Connection.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at Program.<>c__DisplayClass1_0.<<Run>b__5>d.MoveNext() in C:\git\corefx\src\System.Net.Http\tests\StressTests\HttpStress\Program.cs:line 175
--- End of stack trace from previous location where exception was thrown ---
at Program.<>c__DisplayClass1_4.<<Run>b__43>d.MoveNext() in C:\git\corefx\src\System.Net.Http\tests\StressTests\HttpStress\Program.cs:line 634
Another exception thrown was
Error from iteration 19 (GET Parameters) in task 3 with 363 successes / 16 fails:
System.ArgumentException: Destination is too short. (Parameter 'destination')
at System.ReadOnlyMemory`1.CopyTo(Memory`1 destination)
at System.Net.Http.Http2Connection.SendHeadersAsync(HttpRequestMessage request, CancellationToken cancellationToken, Boolean mustFlush)
at System.Net.Http.Http2Connection.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
at Program.<>c__DisplayClass1_0.<<Run>b__5>d.MoveNext() in C:\git\corefx\src\System.Net.Http\tests\StressTests\HttpStress\Program.cs:line 175
--- End of stack trace from previous location where exception was thrown ---
at Program.<>c__DisplayClass1_4.<<Run>b__43>d.MoveNext() in C:\git\corefx\src\System.Net.Http\tests\StressTests\HttpStress\Program.cs:line 634
On http1.1 sometimes the assertion fails but it never throws a httpException. The returned value in these cases is an empty string
at Program.<Run>g__ValidateContent|1_1(String expectedContent, String actualContent) in C:\git\corefx\src\System.Net.Http\tests\StressTests\HttpStress\Program.cs:line 122
at Program.<>c__DisplayClass1_0.<<Run>b__5>d.MoveNext() in C:\git\corefx\src\System.Net.Http\tests\StressTests\HttpStress\Program.cs:line 178
--- End of stack trace from previous location where exception was thrown ---
at Program.<>c__DisplayClass1_4.<<Run>b__43>d.MoveNext() in C:\git\corefx\src\System.Net.Http\tests\StressTests\HttpStress\Program.cs:line 634
[15-07-2019 15:17:17] Total: 30,817
GET Parameters Success: 30,395 Fail: 427
Error from iteration 2894 (GET Parameters) in task 6 with 30398 successes / 427 fails:
System.Exception: Expected response content "123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789090123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234", got ""
at Program.<Run>g__ValidateContent|1_1(String expectedContent, String actualContent) in C:\git\corefx\src\System.Net.Http\tests\StressTests\HttpStress\Program.cs:line 122
at Program.<>c__DisplayClass1_0.<<Run>b__5>d.MoveNext() in C:\git\corefx\src\System.Net.Http\tests\StressTests\HttpStress\Program.cs:line 178
--- End of stack trace from previous location where exception was thrown ---
at Program.<>c__DisplayClass1_4.<<Run>b__43>d.MoveNext() in C:\git\corefx\src\System.Net.Http\tests\StressTests\HttpStress\Program.cs:line 634
cc @stephentoub
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 19 (19 by maintainers)
Just to confirm, changing the app to set both
ko.Limits.Http2.MaxRequestHeaderFieldSize
andko.Limits.MaxRequestLineSize
to a much larger value makes the errors go away. So this is a bug in the stress app rather than in HttpClient.Going to fix this now to unblock the app.
i will try to put up a pr for this tomorrow đ
Based on what I wrote above (that url length maps exactly to the kestrel limit I linked to), I donât think thereâs a client bug here. I think itâs dutifully sending what was requested, and kestrel has explicit limits set that block it.
I just spoke with @jkotalik, and he found https://github.com/aspnet/AspNetCore/blob/81b757afcc15c02fc89f35f47cc96a148b09648f/src/Servers/Kestrel/Core/src/Internal/Http2/Http2Stream.cs#L208.
So I suggest the âfixâ here is to fix the stress app to work within the confines of what the server allows, or to eat this exception when it occurs.
Example url:
This is
Var0=
followed by 8155 characters. 8154 works, 8155 results in failure.@anipik, the HttpStress app runs with whatever SDK you have installed, not whatâs in the repo, and the output shows youâre running with 3.0.0-preview7-27902-19. Thatâs not particularly recent. Can you please uninstall your SDK and install a new one from https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-win-x64.exe. At least some of the call stacks youâre sharing look like things already fixed.