Listen EADDRINUSE: address already in use :::3000


I’ve tried all the other things for my bot to work with the dbl webhook but it keeps doing this over and over. I can’t access the event.js either and I don’t know how to fix it.

My project is the-keplerbot

Please help quick,


Hello @keplerteddy, welcome to the support forum!

Let me take a look at your code. It sounds like you have more than one piece of code trying to listen to requests on the same port, which is the cause of the error.


Taking a look at your project’s logs, I don’t see this error. When are you getting that message?


I currently commented the stuff out, I’ll uncomment it again.


Ah, I see the error now. If you comment out the code above that’s doing the ‘ping’, the error will go away. You may need to then figure out how to get DBL working at the same time as the ping server though.


It also works if I change the port to 5000 as well…

But then it isn’t connected.
Here is a few pages on the webhooks:


Any code running on glitch will need to listen to process.env.PORT. We only let that port get through.


You may be able to use the arrangement here to do both at the same time: Page cant be found


Hmm I don’t have an server at the moment, what would I set webhookServer to then?


I’ve added the same code that he did, and it seems to still say the exact same thing :confused:


you’re calling .listen on the server twice, you can remove one of those .listen calls (maybe the one on line 22)


Am I missing process.env.PORT?


Hmm, that seemed to work!


Great! take a look around and see if things are working.


Things are now working! I pressed the test button back at Discord Bot List and the test outputted like it was supposed too!

Thank you so much! :smiley: