IDEA Start Failed: Address already in use

Answered

System: Windows10 (19037)

I have this problem occasionally. Remove all config and set all default is useless.

Sometime reboot system will fix It

Here with the log('idea.log' in https://uploads.services.jetbrains.com/)

EDIT:

Thanks, `netsh winsock reset` can fix it

Or you can try disable some network interface

13 comments
Comment actions Permalink

I had the same issue, and the fix was simple enough from here:  https://intellij-support.jetbrains.com/hc/en-us/community/posts/360009005139-Intellij-Not-starting-up-getting-error-BindException-Address-already-in-use-

 

net stop winnat
net start winnat

Seems to be an issue with windows and some ports not being freed.

 

6
Comment actions Permalink

I find it has something to do with the network interface. I disable some of them without reboot. Then it works

2
Comment actions Permalink

I had this issue while connected to the VPN that I need to be on in order to access the database. Disconnecting from the VPN, then opening the program will launch, I can then connect to the VPN and do what I need to do.

Pretty annoying little bug as launching MySQL Workbench or SSMS I have no such issue.

 

The VPN is a Split Tunnel so I'm not sure where the hiccup is. I do have the interface metric set to 1 for the VPN but this is often necessary for me.

2
Comment actions Permalink

To lock folders IDE is starting a server on localhost, it tries to bind on the first available port between 6942 and 6991, this exception is thrown if IDE was not able to bind on any of the ports in this range. All 50 ports are unlikely to be already used on a machine, so it appears to be a networking issue or some security software which doesn't permit IDE to bind on any port in this range even on localhost interface.

You can check with TcpView if these ports are already taken: https://docs.microsoft.com/en-us/sysinternals/downloads/tcpview . It will show the process using the ports.

But in case of the firewall it can just block the bind operation and TcpView will not show anything.

Reboot or fixing the network should help. You can also try `netsh winsock reset`.

1
Comment actions Permalink

Hi!

I'm getting this issue too, so I have a question: would it be possible to add the port number to logs or to the error message? I don't see any port blocked in TCPView and 'netsh winsock reset' doesn't always help. So it would be nice to improve logging somehow, it should not be too expensive. 


1
Comment actions Permalink

Hi, could you elaborate on it, please? Does it mean that IDEA tries to use virtual NIC? Which exactly NI did you disable? 

1
Comment actions Permalink

I disabled all virtual ethernet adapters and it works. Not try to find exactly one.

It may be system problem, because it also happened on other program. 

1
Comment actions Permalink

Hello Andrey,

Port number won't add any additional information as problem is related to network interface.

0
Comment actions Permalink

I have the same issue with Rider.

It happens consistently when opening Rider is NOT the first I do immediately after starting my computer and logging in. Restarting the computer and opening Rider as fast as possible generally works.

I ran netstat as administrator and find nothing listening to any port between 6942 and 6991.

I am not logged to a VPN, as the user above.

I have reinstalled Rider, with no improvement.

You mentioned that the purpose of binding to a port in this range is to lock files. Is this locking so important that should it fail, users must be totally prevented from making use of any feature of their IDE? Could it be considered to instead warn the user of the situation and function in degraded mode?

 

0
Comment actions Permalink

Hi Everyone, I need to leave this here in case some one is struggling with this consistently and what worked for me on windows.

The above solution does work, however it seems that it does not solve the underlying issues.  I work with a lot of docker and Hyper visor machines and discovered that the above solution messed up the network address resolution for the virtualized devices.  The final solution that I found was as follows:

  • Assign a static ip or reserve ip address on router for your workstation / laptop (you need to consult you router manual for this)
  • Reset the network adapter, if you're on wireless you will need to re-enter your credentials

I found that my IP address was changing too often and this was confusing the license manager as well.  I would get messages that my license is already been used on another computer (same computer, different IP address). Unfortunately you will need to restart for this but I reckon this is a permanent fix and not a quick patch.

0
Comment actions Permalink

Just setting the static address manually worked. This bug appeared when I upgraded to Windows 11 on the dev channel - thought it was a windows 11 issue - wasn't. Thanks for the help!

0
Comment actions Permalink

In new version of PHPStorm it cause freeze on loading screen and infinite loading. The error message "Address already in use" is hidden and it's just in `AppData\Local\JetBrains\PhpStorm2021.2\log`.
It happening because Hyper-V/WSL2 reserve many of ports with no logical reason... Just for case, i think. It can happen randomly and sometime after restart it works, sometime no... It depends on hyperv mood.

So u can disable Hyper-V engine (possible solution for few ppl): `dism.exe /Online /Disable-Feature:Microsoft-Hyper-V` and reboot.

Other solution is reserve the ports for yourself:
`netsh winsock reset`
reboot - maybe - it depends on message from previous cmd
`netsh int ipv4 add excludedportrange protocol=tcp startport=6942 numberofports=50`

If it doesn't work, this will be work:
`dism.exe /Online /Disable-Feature:Microsoft-Hyper-V` - turn off hyperv
reboot
`netsh int ipv4 add excludedportrange protocol=tcp startport=6942 numberofports=50`
`dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All` - turn on hyperv
reboot

0

Please sign in to leave a comment.