I want to start debugging node.js app using Intellij and node.js interpreter running on Docker. While running the app works, when I try to debug I get the error:
Error running 'index.js' com.github.dockerjava.api.exception.InternalServerErrorException: {"message":"driver failed programming external connectivity on endpoint focused_poincare (a17137973880d1be7c6a74fc142184fdda31e0dec8ebd539b09d9dbe4cf70014): Error starting userland proxy: Bind for 0.0.0.0:55578 failed: port is already allocated"}
Remote interpreter was configured acccording to the documentation. I have created a new Node.js Run/Debug configuration and entered the following data:
.
What might be the cause for debugging not working?
I use:
- Intellij Idea Ultimate v. 2019.1.4 Preview
- Intellij NodeJS plugin v. 191.7479.1, NodeJS remote interpreter plugin v. 191.6014.8 and Docker plugin v. 191.7141.44
- Docker Desktop Community v. 2.0.0.3
EDIT: Adressing the comments:
Local debugging works. The file (index.js) that I am trying to run consists only of console.log('Hello world!') so I don't spawn any child processes on my own. My host system has Windows 10 Pro as OS, so for checking the open ports on host system I used netstat -an | find "55578", which returned nothing. Moreover, if I try to run docker manually from the command line, using docker run -it -p 55578:55578 node, everything runs and no error is given.
Also, each time I try remote debugging, the port number given by Intellij in an error message seems to be random high port number. I tried looking for open ports just after getting error message, but never found one that is open with a number reported by Intellij and those indeed appear in the output:
My Run/Debug configuration:
My Docker configuration (I had to check "Expose daemon on tcp://localhost:2375 without TLS" in Docker configuration to make Intellij and Docker play together):
EDIT: When I add --inspect-brk=0.0.0.0:55432 as "Node Parameters" in "Run/Debug Configurations" Intellij windows (per this bug report) the container nad program start, but debugging seems to be no-op (e.g. the program does not stop on breakpoints).



netstat | grep 55578? also, does your app spawn child processes? can you debug it locally (using local interpreter)? - lena