error: Error: listen EADDRINUSE

Bug Reports
  • 21/11 03:27 [2759] - error: Error: listen EADDRINUSE
    at errnoException (net.js:904:11)
    at Server._listen2 (net.js:1042:14)
    at listen (net.js:1064:10)
    at net.js:1146:9
    at dns.js:72:18
    at process._tickDomainCallback (node.js:463:13)
    Error: listen EADDRINUSE
    at errnoException (net.js:904:11)
    at Server._listen2 (net.js:1042:14)
    at listen (net.js:1064:10)
    at net.js:1146:9
    at dns.js:72:18
    at process._tickDomainCallback (node.js:463:13)

    hey guys ๐Ÿ™‚ got this error anyone got same issue as me?

    Im using this nginx to forward the port:

    server {
    listen 80;
    server_name anirole.com;
    return 301 http://www.anirole.com$request_uri;
    }

    server {
    listen 80;

    server_name www.anirole.com;
    
    location / {
        proxy_pass http://216.155.156.13:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    }
    

    }

  • @fr3em1nd EADDRINUSE - this error arises when this port used by another app. Do you have any other software running on port 3000? Could be worth editing config.json, changing the port number to something like 4567, then changing it in your nginx config to match your changes.

  • @a_5mith hey mate it seems to be right:

    "base_url": "http://www.xxxx.com",
    "port": "3000",
    "secret": "xxxx",
    "bind_address": "216.155.156.xx",
    "database": "redis",

  • @fr3em1nd Yes, it's right, but do you have anything else on the same port? Change 3000 for 4567, and do the same thing in your nginx config block. Then reload nginx with sudo service nginx reload & restart NodeBB

  • hey mate i did a quick research i fixed this:

    sudo fuser -k 3000/tcp

    i realized i might have ran the nodebb twice i have to disable everything else on port 3000

    i'd like to keep it at port 3000

  • @fr3em1nd You can try ./nodebb stop then starting it again. see if that helps.

  • @a_5mith yep

    fuser -k 3000/tcp

    seem to fix it so it will kill all to processes using that port

  • @fr3em1nd said:

    @a_5mith yep

    fuser -k 3000/tcp

    seem to fix it so it will kill all to processes using that port

    It may do work. But it is not very clean and can lead to serious problems to solve problems of this kind that way.
    Just a little advice. No offence. ๐Ÿ˜‰


Suggested Topics