Skip to content
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

Windows update blocks previously valid ports used in examples #19905

Open
cimpok opened this issue Aug 10, 2019 · 6 comments

Comments

@cimpok
Copy link

@cimpok cimpok commented Aug 10, 2019

The example here
https://github.com/grpc/grpc/blob/master/examples/csharp/RouteGuide/RouteGuideServer/Program.cs
uses port 50052
Running this example results System.IO.IOException: 'Failed to bind port "localhost:50052"'
It took me several hours to find out the cause:
February 13 cumulative update 4074588 in Windows 10 Version 1709 has silently blocked some ports.
https://support.microsoft.com/en-us/help/4093046/ports-blocked-after-you-install-monthly-rollup-package-kb4074588
Running netsh interface ipv4 show excludedportrange protocol=tcp will show the blocked ports.
Maybe you could save someone a similar hassle if you change the port number out of these blocked ranges.

@jtattermusch

This comment has been minimized.

Copy link
Contributor

@jtattermusch jtattermusch commented Aug 29, 2019

@cimpok thanks for the report. I wasn't able to find the list of blocked ports anywhere. Can you provide a link?

@cimpok

This comment has been minimized.

Copy link
Author

@cimpok cimpok commented Aug 30, 2019

@jtattermusch Hi, I could also not find an explicit list of newly blocked ports (maybe they differ somewhat from machine to machine, is the reason?)
https://support.microsoft.com/en-us/help/4074588 I found only this Microsoft's workaround to the problem they suggest to check the ports with netsh before using them.

There might be a programmatic solution to avoid the blocked ports but it would divert attention from the sample's simple goal (which I would hate when learning grpc), I suggest just chose some other as 50052 avoiding the list below. I have the following ranges blocked on my Windows 10 desktop computer kept fresh with all available updates:
Start Port End Port
80 80
443 443
2869 2869
10243 10243
49739 49838
49839 49938
50042 50141
50142 50241
50242 50341
50342 50441
50949 51048
52968 53067

@jtattermusch

This comment has been minimized.

Copy link
Contributor

@jtattermusch jtattermusch commented Sep 4, 2019

We could change the ports, but I'd like to change it to something that will work for everyone. How do we know the list you provided is not just something that's specific to your machine?

@JamesNK @JunTaoLuo this might be impacting examples at https://github.com/grpc/grpc-dotnet/tree/master/examples/ as well.

@jtattermusch

This comment has been minimized.

Copy link
Contributor

@jtattermusch jtattermusch commented Sep 5, 2019

FTR, The command to get the excluded port range is netsh interface ipv4 show excludedportrange protocol=tcp as documented here: https://support.microsoft.com/en-us/help/4074588

@jtattermusch

This comment has been minimized.

Copy link
Contributor

@jtattermusch jtattermusch commented Sep 5, 2019

Btw on my machine I have an up-to-date system (win10) and this is what I get:

netsh interface ipv4 show excludedportrange protocol=tcp

Protocol tcp Port Exclusion Ranges

Start Port    End Port
----------    --------
     47001       47001

* - Administered port exclusions.
@JamesNK

This comment has been minimized.

Copy link
Contributor

@JamesNK JamesNK commented Sep 5, 2019

Mine:

netsh interface ipv4 show excludedportrange protocol=tcp

Protocol tcp Port Exclusion Ranges

Start Port    End Port
----------    --------
        80          80
       443         443
     49730       49829
     49830       49929
     50000       50059     *
     50060       50159
     50160       50259
     50260       50359
     50360       50459
     51017       51116

* - Administered port exclusions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.