NodeBB Startup Error // 502 Bad Gateway



  • I recently updated a nodebb template file in a theme, and when I restarted NodeBB, it will not start, it keeps crashing.

    I am getting 502 Bad Gateway on the website (using nginx proxy)

    Here is my log, any ideas?

    27/12 05:19 [19438] - info: Time: Sun Dec 27 2015 05:19:24 GMT-0500 (EST)
    27/12 05:19 [19438] - info: Initializing NodeBB v0.8.2
    27/12 05:19 [19438] - info: [database] Checking database indices.
    27/12 05:19 [19438] - warn: [socket.io] Clustering detected, you are advised to configure Redis as a websocket store.
    27/12 05:19 [19438] - info: [plugins/spam-be-gone] Settings loaded
    27/12 05:19 [19438] - info: NodeBB Ready
    27/12 05:19 [19438] - info: Enabling 'trust proxy'
    27/12 05:19 [19438] - info: NodeBB is now listening on: 0.0.0.0:4567
    27/12 05:19 [19438] - error: undefined
    undefined
    27/12 05:19 [19438] - info: [app] Shutdown (SIGTERM/SIGINT) Initialised.
    27/12 05:19 [19438] - info: [app] Database connection closed.
    27/12 05:19 [19438] - info: [app] Web server closed to connections.
    27/12 05:19 [19438] - info: [app] Shutdown complete.
    3 restarts in 10 seconds, most likely an error on startup. Halting.
    error: undefined
    undefined



  • because your nodebb is shutdown and nobody lissten to 4567 port!



  • I am trying to start it back up again, and it won't start. It just shuts down when I load the page.



  • run nodebb with ./nodebb dev and see errors, fix them, then run it with ./nodebb start.



  • @sanatisharif said:

    ./nodebb dev

    Ok, didn't think to use that thanks, this is my error, any idea how to fix it?

    error: Error: listen EADDRINUSE
    at errnoException (net.js:901:11)
    at Server._listen2 (net.js:1039:14)
    at listen (net.js:1061:10)
    at Server.listen (net.js:1135:5)
    at listen (/root/website/nodebb/src/webserver.js:180:17)
    at /root/website/nodebb/src/webserver.js:57:3
    at EventEmitter.<anonymous> (/root/website/nodebb/src/emitter.js:17:5)
    at EventEmitter.emit (events.js:92:17)
    at /root/website/nodebb/src/meta/css.js:99:14
    at /root/website/nodebb/node_modules/async/lib/async.js:697:13
    27/12 06:14 [20324] - error: NodeBB address in use, exiting...
    [cluster] Child Process (20324) has exited (code: 0, signal: null)



  • ok, run ./nodebb stop and kill any possess that listen to nodebb Port,
    you can change nodebb port in config.js file!



  • after that run ./nodebb dev again


  • Admin

    @Sean said:

    27/12 05:19 [19438] - error: undefined
    undefined

    This is usually caused by a syntax error in one of the templates. If templates.js goes into a infinite loop while parsing the templates it prints that not so useful error message. Make sure your template has proper t.js syntax, ie follow the whitespace rules to the letter. Check out one the persona templates for reference.



  • @baris I figured it was a template error since all these problems happened after editing one of the templates, but I reverted the template back to the working version before my edits, and I just can't seem to get NodeBB to start back up. I'll look into the template again and see if there is any issues I can spot.



  • Alright, problem fixed, thanks guys.

    It was because of the template whitespace/indents messing up since I was copying from a file into the terminal.

    Thanks :)


Log in to reply
 


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