Error registering New Account, Connection has been lost



  • Connection to NodeBB has been lost error when registering an account / login to NodeBB.

    7/10 01:54:30 [19404] - info: Enabling 'trust proxy'
    7/10 01:54:30 [19404] - error:  Error: listen EADDRINUSE 0.0.0.0:4567
        at Object.exports._errnoException (util.js:1020:11)
        at exports._exceptionWithHostPort (util.js:1043:20)
        at Server._listen2 (net.js:1262:14)
        at listen (net.js:1298:10)
        at net.js:1408:9
        at _combinedTickCallback (internal/process/next_tick.js:83:11)
        at process._tickCallback (internal/process/next_tick.js:104:9)
    7/10 01:54:30 [19404] - error: NodeBB address in use, exiting...
    3 restarts in 10 seconds, most likely an error on startup. Halting.
    
    • lsof -i:4567:
    COMMAND   PID  USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME
    node    17174 h7org   17u  IPv4 308612721      0t0  TCP *:4567 (LISTEN)
    

  • Global Moderator

    You can't run ./nodebb dev while an existing nodebb process it running. EADDRINUSE means the port is in use, usually by another NodeBB process.



  • I understand, so what could be the problem, causeing the "Connection to NodeBB has been lost error"?


  • Global Moderator

    Make sure url in config.json is set to exactly the URL at which you access your forum.



  • Yes, all seems ok in config.json. In the meantime I did a new install with latest OS(Debian 9)/Node.js/etc., was able to log-in however, the registration still unresponsive and all admin functions are available but no changes can be saved while the same "Connection to NodeBB has been lost error" is present.



  • Found something in console that may help:

    Failed to load resource: the server responded with a status of 403 (Forbidden)  http://community.h7.org/socket.io/?EIO=3&transport=polling&t=Lxq7d38
    

  • Global Moderator

    @h7 are there any errors in the browser console?



  • @pitaj yes, 40+:

    0_1507335303042_Screenshot 2017-10-06 20.13.12.png


  • Global Moderator

    @h7 Can you provide your nginx config and nodebb config.json?



  • nginx.conf:

    server {
        server_name community.h7.org;
    
    listen 5.45.114.72:80;
    listen [2a03:f480:1:1a::27]:80;
    listen 80;
    
        gzip on;
        gzip_min_length 1024;
        gzip_proxied expired no-cache no-store private auth;
        gzip_types text/css image/x-ico application/pdf image/jpeg image/png image/gif application/javascript application/x-javascript application/x-pointplus;
        set $root_path /var/www/h7org/data/www/community.h7.org;
        root $root_path;
    
        disable_symlinks if_not_owner from=$root_path;
        
        location / {
            #index index.html;
            #try_files $uri $uri/ /index.php?$args;
    
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header Host $http_host;
            proxy_set_header X-NginX-Proxy true;
    
            proxy_pass http://127.0.0.1:4567;
            proxy_redirect off;
    
            # Socket.IO Support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    
        location ~ \.php$ {
         }
    
        #location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpeg|avi|zip|gz|bz2|rar|swf|ico)$ {
        #    try_files $uri $uri/ @fallback;
        #    expires 30d;
        #}
    
        location @fallback {
        }
    
        include /etc/nginx/fastpanel2-sites/h7org/community.h7.org.includes;
        include /etc/nginx/fastpanel2-includes/*.conf;
    
        error_log /var/www/h7org/data/logs/community.h7.org-frontend.error.log;
        access_log /var/www/h7org/data/logs/community.h7.org-frontend.access.log;
    }
    

    config.json:

    {
        "url": "http://community.h7.org",
        "secret": "***",
        "database": "redis",
        "redis": {
            "host": "127.0.0.1",
            "port": "6379",
            "password": "***",
            "database": "0"
        }
    }
    

  • Global Moderator

    Wrong nginx config. I need the site config with the reverse proxy settings etc.



  • @pitaj edited..


  • Global Moderator

    Does ./nodebb stop then ./nodebb dev stop those errors?



  • @PitaJ
    ./nodebb stop gives response: NodeBB is already stopped.

    ./nodebb dev gives the errors:

    7/10 03:46:05 [20930] - error:  Error: listen EADDRINUSE 0.0.0.0:4567
        at Object.exports._errnoException (util.js:1020:11)
        at exports._exceptionWithHostPort (util.js:1043:20)
        at Server._listen2 (net.js:1262:14)
        at listen (net.js:1298:10)
        at net.js:1408:9
        at _combinedTickCallback (internal/process/next_tick.js:83:11)
        at process._tickCallback (internal/process/next_tick.js:104:9)
    7/10 03:46:05 [20930] - error: NodeBB address in use, exiting...
    3 restarts in 10 seconds, most likely an error on startup. Halting.
    

  • Global Moderator

    How did you start NodeBB?



  • @pitaj started with ./nodebb start now just checked with ./nodebb restart and while community.h7.org is accessible, I get the message NodeBB could not be restarted, as a running instance could not be found.

    ./nodebb log results are:

    7/10 03:48:59 [21010] - error:  Error: listen EADDRINUSE 0.0.0.0:4567
        at Object.exports._errnoException (util.js:1020:11)
        at exports._exceptionWithHostPort (util.js:1043:20)
        at Server._listen2 (net.js:1262:14)
        at listen (net.js:1298:10)
        at net.js:1408:9
        at _combinedTickCallback (internal/process/next_tick.js:83:11)
        at process._tickCallback (internal/process/next_tick.js:104:9)
    7/10 03:48:59 [21010] - error: NodeBB address in use, exiting...
    3 restarts in 10 seconds, most likely an error on startup. Halting.
    


  • pkill -9 node then ./nodebb restart and service nginx restart fixed all problems. It seems a previous NodeBB was still running in memory 😳

    @PitaJ thans a lot for the help! Truly amazing app with excellent community support!


Log in to reply
 


Star

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.