-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
QUIC: Port 50009 throws QUIC_STATUS_ADDRESS_IN_USE #71518
Comments
Tagging subscribers to this area: @dotnet/ncl Issue DetailsDescriptionIn .NET 6 I have unit tests that start Kestrel on port 50019. I works fine. I updated the unit test to .NET 7 and it now throws QUIC_STATUS_ADDRESS_IN_USE. Why is that? Is it a bug, or intentional behavior? If it's intentional then there should be documentation about what ports can be used. Reproduction Stepsvar builder = WebApplication.CreateBuilder(args);
builder.WebHost.ConfigureKestrel(c =>
{
c.ListenLocalhost(50009, listner =>
{
listner.Protocols = Microsoft.AspNetCore.Server.Kestrel.Core.HttpProtocols.Http3;
listner.UseHttps();
});
});
var app = builder.Build();
app.MapGet("/", () => "Hello World!");
app.Run(); Expected behaviorWorks Actual behavior
Regression?Yes Known WorkaroundsUse a different port ConfigurationNo response Other informationNo response
|
The fix in my unit test project was to change the port to 55019. Why 55019 works and 50019 now doesn't.... 🤷♂️ |
did you try to dump ports using |
50019 with .NET 6 = works I flipped back and forth a number of times to check that it was changing the .NET version that triggered it and nothing else. And I changed the port to a couple of other similar values, e.g. 50018, before discovering a bigger change like 55019 worked. Perhaps msquic doesn't allow listening on a range of ports by default? I didn't use netstat. The QUIC_STATUS_ADDRESS_IN_USE error is coming from MsQuicListener. It's in the stacktrace. Repo is available to test. It's very simple. |
Triage: let's investigate for 7.0 and root cause this then we can decide what to do about it. |
This does not look like .NET Runtime bug, the error comes from MsQuic. I was able to reproduce this even outside MsQuic using the sample app from https://docs.microsoft.com/en-us/windows/win32/winsock/sio-acquire-port-reservation, the problematic range seems to be ports 50000-50059. I filed issue with MsQuic to see if they can do something about it: microsoft/msquic#2891 |
There is something called Port Exclusion Ranges apparently that affects this:
|
Tracking by (internal) OS issue: https://microsoft.visualstudio.com/OS/_workitems/edit/40464377 |
Triage: There is nothing we can do. It needs to be address in the OS. Moving to Future for tracking purposes. |
This is documented in out troubleshooting guide. |
Description
In .NET 6 I have unit tests that start a Kestrel HTTP/3 endpoint on port 50019. It works fine.
I updated the unit test to .NET 7 and it now throws QUIC_STATUS_ADDRESS_IN_USE. Why is that? Is it a bug, or intentional behavior? If it's intentional then there should be documentation about what ports can be used.
Reproduction Steps
Small modification to the empty ASP.NET Core template to add a H3 port:
Expected behavior
Works
Actual behavior
Regression?
Yes
Known Workarounds
Use a different port
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: