3

I have a .net core app which spins up a grpc server. I was able to run it locally without a problem until I had Windows updates today. After Windows applied latest updates, I tried to run my .net core app, but I keep getting the following error.

System.IO.IOException: Failed to bind port "127.0.0.1:50001" at Grpc.Core.Server.CheckPortsBoundSuccessfully()

I went to firewall and opened access to the port that grpc has problem accessing. It did not help. Anybody had this issue?

neo
  • 1,887
  • 2
  • 19
  • 36
  • which port is it trying to bind to? is something else using it? – Daniel A. White Jan 03 '19 at 16:13
  • 1
    I checked it is not being used. It is 50000 range – neo Jan 03 '19 at 16:14
  • This really looks like someone's using that port. Have you tried a different port? There isn't much complexity in binding the code that binds the port on the server side - it mostly just invokes the syscall to bind the port (and that seems to be failing). Can other servers (non-grpc) bind that port without a problem? – Jan Tattermusch Jan 10 '19 at 14:29
  • @neo Did you find a resolution to this? I'm having the exact same issue now on code that's been working fine for over a year. Port is NOT in use. – user3953989 Feb 06 '19 at 03:37
  • 1
    @user3953989 I posted the answer. – neo Feb 06 '19 at 20:48
  • @neo Thanks for the follow up and link! I came to this same conclusion but couldn't find any documentation to prove it. – user3953989 Feb 07 '19 at 02:25

1 Answers1

7

I wasted 2 days on this and finally got the answer. Windows update caused certain valid to use ports to be excluded and as a result I couldn't run any app that listens on those excluded ports.

Here is a link to Microsoft article. Windows update blocking previously valid ports

neo
  • 1,887
  • 2
  • 19
  • 36
  • Your answer reminded of the right search, but the link is dead. Consider changing it to something like https://stackoverflow.com/questions/54010365/how-to-see-what-is-reserving-ephemeral-port-ranges-on-windows – Mads Ravn Nov 16 '21 at 08:13