I have deployed MEAN stack on an EC2 ubuntu machine. I have written a crawler script that creates a child process for every URL I feed it and crawls and returns back the data to the parent. I don't really have a clue of where the following error occurs.
Error: listen EADDRINUSE at exports._errnoException (util.js:746:11) at Agent.Server._listen2 (net.js:1129:14) at listen (net.js:1155:10) at Agent.Server.listen (net.js:1240:5) at Object.start (_debugger_agent.js:20:9) at startup (node.js:86:9) at node.js:814:3
Each child process returns an object which I print in the console and in between which I get a lot of above error. My script is very large and I don't know where this error occurs and so I am unable to post any code.
The server is running fine on port 8000. netstat -tpln shows only mongodb and ssh process occupying ports 27017 and 22 respectively. I have also tried changing the server ports but the same problem persists.
How do I find due to which port this error occurs? How do I find which line of code triggers this error?
Any input would be really appreciated. Thanks in advance.