Skip to content

How to fix error: transport error 202: bind failed: address already in use?

  • by
  • 2 min read
Countries With Highest Internet Download Speeds Ranked (July)

A lot of development-related tasks and programs, in general, often require internet connections to speak with a particular server to fetch content for the user. This communication often requires the use of ports on a user’s router. 

However, if the default port used by a program is taken or otherwise occupied, you can run into issues like the “transport error 202: bind failed” address already in use”. 

This article talks about the aforementioned error, its causes and what you can do to fix the problem.


What causes this error?

Regardless of the application throwing the error, the cause behind it is most likely the default communication port used by the program being used by something else. 

Since open ports on a router or machine can’t be shared, this leads to a conflict where two separate programs are now trying to communicate with one port. In such cases, the first program to access the port gets priority, hence the issue.

Also read: How to fix ‘unknown error: Devtoolsactiveport file doesn’t exist’?


How to fix this?

There are two ways you can tackle this situation:

  • Kill the process using the port in question.
  • Change the default port for one of the two programs. 

If you’re on Linux, you can check all the ports actively being used on your machine using the netstat command.

netstat -an
You can use netstat to identify what programs are using which ports.

Once you identify the program using a particular port you want to free, you can kill it to free up the port and then run the second program again to fix the issue. This is the preferred way of solving this problem. 

However, if you need to run both of these programs or multiple programs that default to the same port, it’s better to change their port numbers and assign unique port numbers to each program to ensure concurrent functioning without any conflicts in terms of connectivity. 

Also read: Linux Zgrep command explained

>