Web Installer preventing NodeBB server from starting.

Solved Technical Support
  • After filling out the Web Installer form and then running ./nodebb start on the command line. I get the errors listed below.
    It seems like the Web Installer is still using the 4567 port the node server is trying to use.
    I have tried killing all node processes before running ./nodebb start but the processes refuse to be killed and this has no effect.

    Any suggestions?

    ./nodebb start errors
    Starting NodeBB
      "./nodebb stop" to stop the NodeBB server
      "./nodebb log" to view server output
      "./nodebb help" for more commands
    
    
    NodeBB v2.8.5 Copyright (C) 2013-2023 NodeBB Inc.
    This program comes with ABSOLUTELY NO WARRANTY.
    This is free software, and you are welcome to redistribute it under certain conditions.
    For the full license, please visit: http://www.gnu.org/copyleft/gpl.html
    
    Clustering enabled: Spinning up 1 process(es).
    
    2023-01-31T18:55:54.079Z [4567/192] - info: Initializing NodeBB v2.8.5 https://node.mydomain.com
    2023-01-31T18:55:56.476Z [4567/192] - info: [socket.io] Restricting access to origin: https://node.mydomain.com:*
    (node:192) [LRU_CACHE_UNBOUNDED] UnboundedCacheWarning: TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.
    (Use `node --trace-warnings ...` to show where the warning was created)
    
    2023-01-31T18:55:56.727Z [4567/192] - warn: [plugins/load] The following plugins may not be compatible with your version of NodeBB. This may cause unintended behaviour or crashing. In the event of an unresponsive NodeBB caused by this plugin, run `./nodebb reset -p PLUGINNAME` to disable it.
      * nodebb-rewards-essentials
    
    2023-01-31T18:55:56.837Z [4567/192] - info: [api] Adding 0 route(s) to `api/v3/plugins`
    2023-01-31T18:55:56.853Z [4567/192] - info: [router] Routes added
    2023-01-31T18:55:56.865Z [4567/192] - info: šŸŽ‰ NodeBB Ready
    2023-01-31T18:55:56.867Z [4567/192] - info: šŸ¤ Enabling 'trust proxy'
    2023-01-31T18:55:56.870Z [4567/192] - error: NodeBB address in use, exiting...
    Error: listen EADDRINUSE: address already in use 0.0.0.0:4567
        at Server.setupListenHandle [as _listen2] (node:net:1733:16)
        at listenInCluster (node:net:1781:12)
        at doListen (node:net:1930:7)
        at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
    2023-01-31T18:55:56.874Z [4567/192] - error: uncaughtException: listen EADDRINUSE: address already in use 0.0.0.0:4567
    Error: listen EADDRINUSE: address already in use 0.0.0.0:4567
        at Server.setupListenHandle [as _listen2] (node:net:1733:16)
        at listenInCluster (node:net:1781:12)
        at doListen (node:net:1930:7)
        at process.processTicksAndRejections (node:internal/process/task_queues:83:21) {"date":"Tue Jan 31 2023 18:55:56 GMT+0000 (Coordinated Universal Time)","error":{"address":"0.0.0.0","code":"EADDRINUSE","errno":-98,"port":4567,"syscall":"listen"},"exception":true,"os":{"loadavg":[0.81,0.68,0.78],"uptime":603592.54},"process":{"argv":["/usr/local/bin/node","/usr/src/app/app.js"],"cwd":"/usr/src/app","execPath":"/usr/local/bin/node","gid":1000,"memoryUsage":{"arrayBuffers":869872,"external":2935100,"heapTotal":110329856,"heapUsed":78592824,"rss":174796800},"pid":192,"uid":1000,"version":"v18.13.0"},"stack":"Error: listen EADDRINUSE: address already in use 0.0.0.0:4567\n    at Server.setupListenHandle [as _listen2] (node:net:1733:16)\n    at listenInCluster (node:net:1781:12)\n    at doListen (node:net:1930:7)\n    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)","trace":[{"column":16,"file":"node:net","function":"Server.setupListenHandle [as _listen2]","line":1733,"method":"setupListenHandle [as _listen2]","native":false},{"column":12,"file":"node:net","function":"listenInCluster","line":1781,"method":null,"native":false},{"column":7,"file":"node:net","function":"doListen","line":1930,"method":null,"native":false},{"column":21,"file":"node:internal/process/task_queues","function":"process.processTicksAndRejections","line":83,"method":"processTicksAndRejections","native":false}]}
    2023-01-31T18:55:56.875Z [4567/192] - error: Error: listen EADDRINUSE: address already in use 0.0.0.0:4567
        at Server.setupListenHandle [as _listen2] (node:net:1733:16)
        at listenInCluster (node:net:1781:12)
        at doListen (node:net:1930:7)
        at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
    2023-01-31T18:55:56.875Z [4567/192] - info: [app] Shutdown (SIGTERM/SIGINT) Initialised.
    2023-01-31T18:55:56.878Z [4567/192] - error: Error [ERR_SERVER_NOT_RUNNING]: Server is not running.
        at new NodeError (node:internal/errors:400:5)
        at Server.close (node:net:2075:12)
        at Object.onceWrapper (node:events:627:28)
        at Server.emit (node:events:525:35)
        at emitCloseNT (node:net:2128:8)
        at process.processTicksAndRejections (node:internal/process/task_queues:81:21)
    [cluster] Child Process (192) has exited (code: 1, signal: null)
    [cluster] Spinning up another process...
    
    ----- snip -----
    # Repeats the above 2 more times
    
    3 restarts in 10 seconds, most likely an error on startup. Halting.
    
  • I figured out a solution. I just needed to prevent the web installer from starting up and claiming the 0.0.0.0:4567 address the nodebb server tries to use.

    The Web Installer only starts if there isn't already a config.json file. So I added a ConfigMap to my kubernetes manifest to insert a valid config.json file into the correct directory when the nodebb pod starts. I used this post for guidance in setting up the ConfigMap.

    Thanks for your help!

  • @timc do you have any systemd or perhaps pm2 daemons active?

  • I don't think so.

    node@nodebb-694ff7946-56wtz:/usr/src/app$ systemctl --version
    bash: systemctl: command not found
    node@nodebb-694ff7946-56wtz:/usr/src/app$ pm2 --version
    bash: pm2: command not found
    
  • @timc if you use the cli installer, you can use another port. However, I'm curious - do you have an existing installation of NodeBB running in this specific machine?

  • Might be worth it to run ps aux | grep node to see if NodeBB is indeed still running

  • @phenomlab I am trying to deploy nodebb in kubernetes using the official docker container. So I don't think I can change the port with the cli installer.

    @julian my ps aux | grep node output is below. There does appear to be a nodeBB server running, I think it is the web installer? However, all my attempts to kill the processes (kill -9 <PID>, etc.) seem to have no effect (the processes restart).

    node@nodebb-694ff7946-56wtz:/usr/src/app$ ps aux | grep node
    node           1  0.0  0.0   2484   364 ?        Ss   Jan31   0:00 /bin/sh -c test -n "${SETUP}" && ./nodebb setup || node ./nodebb build; node ./nodebb start
    node           8  0.0  3.2 42845668 128480 ?     Sl   Jan31   0:15 node ./nodebb build
    node          48  0.2  0.0   4164  3180 pts/0    Ss   18:15   0:00 bash
    node          56  0.0  0.0   6760  2748 pts/0    R+   18:15   0:00 ps aux
    node          57  0.0  0.0   3244   704 pts/0    S+   18:15   0:00 grep node
    
  • @timc have you tried killall node?

  • @PitaJ unfortunately, killall is not installed on the kubernetes pod (Debian 11), and since pods aren't supposed to have root access I cannot install it.

  • I figured out a solution. I just needed to prevent the web installer from starting up and claiming the 0.0.0.0:4567 address the nodebb server tries to use.

    The Web Installer only starts if there isn't already a config.json file. So I added a ConfigMap to my kubernetes manifest to insert a valid config.json file into the correct directory when the nodebb pod starts. I used this post for guidance in setting up the ConfigMap.

    Thanks for your help!

  • T timc has marked this topic as solved on
  • Great! Thanks for checking in with your solution 😃


Suggested Topics


  • NodeBB on Oracle VPS [I need help!]

    Unsolved Technical Support
    0 Votes
    4 Posts
    283 Views

    Your issues with firewall are likely because Oracle is, essentially, using firewalld rules for all their images, even ones that don't have it included. So if you are running on Ubuntu, and trying to use ufw like most tutorials will recommend you do, it will do nothing with the default iptables entires and be essentially useless. And the bigger problem is that some of their rules are required to start to VMs (they need iSCSI access rules on boot)

    The easy solution is to just give in to Oracle's config and install firewalld:

    sudo apt install firewalld sudo systmctl enable --now firewalld

    (And ensure ufw is disabled)

    You can then manage rules using firewall-cmd. For example:

    sudo firewall-cmd --permanent --add-service={http,https} sudo firewall-cmd --reload

    Will allow http/https traffic.

    The second option is the one I assume you tried: fix iptables and use ufw. But this is a bit more complex than it seems.
    First issue is that IIRC the iptables rules will be applied again on reboot. Now, cloud init can be disabled, but there is another issue - the iSCSI rules.
    The official Oracle workaround for ufw potentially making the VMs unbootable is "don't use ufw" (https://docs.oracle.com/en-us/iaas/Content/knownissues.htm#ufw), and while you should be able to just ensure everything is correctly configured with ufw, I honestly stopped bothering. firewalld works fine for me, so, like Oracle, I would recommend that route instead.

    Additionally there is separate OCI networking and their firewall. You have to remember that Network Security Groups override Security Lists, so if you have one assigned to your VNIC, you need to edit it instead of the subnet-wide SL.

    If there is something else specifically you need help with you'll need to give more details - this post is just based on a guess you have the common issues.

  • 0 Votes
    5 Posts
    560 Views

    @julian said in Cannot start nodebb with systemd:

    /opt/nodebb/logs/output.log

    Hi julian, sorry for my delay response.
    I changed the services as you suggested, essentially this was my first implementation.

    I removed the file output.log, then I rebooted the system and started the services, when I went in the logs folder the file output.log was empty.

    UPDATE:

    I used journalctl -fu nodebb.service to see the log of the service, and I discovered a nice thing:

    alt text

    Any idea?

    UPDATE 2 [FIXED]

    Okay, so after spending some times on this, I discovered what is the cause of the problem. Essentially, I have installed nodebb as root account (which is wrong, my bad), and the systemd service was configured to run nodebb as the user "sfarzoso", but that user was not the owner of nodebb folder, so when I started the service using systemd, a permission problem happen.

    For fix this, I chowned the "opt" folder for "sfarzoso", which is the folder that I need to install nodebb, then I cloned the repo of nodebb and launched the setup again.
    All works now.

    Thanks for the attention, king regards.

  • 0 Votes
    4 Posts
    1k Views

    @The-Worms and anyone else following this topic: the RSS plugin may be fixed. See this topic for howto: https://community.nodebb.org/topic/13540/changes-to-nodebb-plugin-rss-in-light-of-yql-shutdown

  • 0 Votes
    12 Posts
    1k Views

    @pitaj Ah. Then I guess that was what happened for me.

  • 0 Votes
    2 Posts
    2k Views

    never mind been a while since i installed nodedbb, that prompt was for database = redis not the redis db number which came later on šŸ™‚

    ./nodebb setup 1/8 09:58 [5915] - info: NodeBB Setup Triggered via Command Line Welcome to NodeBB! This looks like a new installation, so you'll have to answer a few questions about your environment before we can proceed. Press enter to accept the default setting (shown in brackets). URL used to access this NodeBB (http://localhost:4567) Please enter a NodeBB secret (09df113d-0255-48b7-8e21-c2d0eba3be54) Which database to use (redis) 1/8 09:58 [5915] - info: Now configuring redis database: Host IP or address of your Redis instance (127.0.0.1) Host port of your Redis instance (6379) Password of your Redis database Which database to use (0..n) (0) 3 Configuration Saved OK [email protected] node_modules/redis [email protected] node_modules/connect-redis └── [email protected] ([email protected]) Populating database with default configs, if not already set... Enabling default theme: Persona No categories found, populating instance with default categories 1/8 09:59 [5915] - warn: No administrators have been detected, running initial user setup