Error when starting NodeBB (Error parsing your configuration file)

Technical Support
  • Hey everyone,

    First time setting up NodeBB on a subdomain, and ran into an error upon attempting to start it:

    Starting NodeBB
      "./nodebb stop" to stop the NodeBB server
      "./nodebb log" to view server output
      "./nodebb restart" to restart NodeBB
    
    
    /home/mark/mynodebb/node_modules/nconf/lib/nconf/stores/file.js:153
        throw new Error("Error parsing your configuration file: [" + this.file + '
              ^
    Error: Error parsing your configuration file: [/home/mark/mynodebb/config.json]: Unexpected token /
        at File.loadSync (/home/mark/mynodebb/node_modules/nconf/lib/nconf/stores/file.js:153:11)
        at Provider.add (/home/mark/mynodebb/node_modules/nconf/lib/nconf/provider.js:137:23)
        at Provider.file (/home/mark/mynodebb/node_modules/nconf/lib/nconf/provider.js:63:15)
        at Object.<anonymous> (/home/mark/mynodebb/loader.js:14:20)
        at Module._compile (module.js:456:26)
        at Object.Module._extensions..js (module.js:474:10)
        at Module.load (module.js:356:32)
        at Function.Module._load (module.js:312:12)
        at Function.Module.runMain (module.js:497:10)
        at startup (node.js:119:16)
    

    Here's the output of the config.json file:

    {
        "url": "http://community.domain.com",
        "secret": "***",
        "database": "redis",
        "port":"4567",
        "bind_address":"0.0.0.0", //new
        "redis": {
            "host": "127.0.0.1",
            "port": "6379",
            "username": "***",
            "password": "***",
            "database": "0"
        },
    
        "use_port":"false", //don't forget this setting
    }
    

    When I test NGINX and run nginx -t, I get this:

    nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
    nginx: configuration file /etc/nginx/nginx.conf test is successful
    

    Contents of nginx.conf:

    user www-data;
    worker_processes 4;
    pid /run/nginx.pid;
    
    events {
    	worker_connections 768;
    	# multi_accept on;
    }
    
    http {
    	
    	##
    	# Basic Settings
    	##
    
    	sendfile on;
    	tcp_nopush on;
    	tcp_nodelay on;
    	keepalive_timeout 65;
    	types_hash_max_size 2048;
    	# server_tokens off;
    
    	# server_names_hash_bucket_size 64;
    	# server_name_in_redirect off;
    
    	include /etc/nginx/mime.types;
    	default_type application/octet-stream;
    
    	##
    	# Logging Settings
    	##
    
    	access_log /var/log/nginx/access.log;
    	error_log /var/log/nginx/error.log;
    
    	##
    	# Gzip Settings
    	##
    
    	gzip on;
    	gzip_disable "msie6";
    
    	# gzip_vary on;
    	# gzip_proxied any;
    	# gzip_comp_level 6;
    	# gzip_buffers 16 8k;
    	# gzip_http_version 1.1;
    	# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
    
    	##
    	# nginx-naxsi config
    	##
    	# Uncomment it if you installed nginx-naxsi
    	##
    
    	#include /etc/nginx/naxsi_core.rules;
    
    	##
    	# nginx-passenger config
    	##
    	# Uncomment it if you installed nginx-passenger
    	##
    	
    	#passenger_root /usr;
    	#passenger_ruby /usr/bin/ruby;
    
    	##
    	# Virtual Host Configs
    	##
    
    	include /etc/nginx/conf.d/*.conf;
    	include /etc/nginx/sites-enabled/*;
    
    	upstream nodebb {
       	 #update with your serve ip address with port
       	 server 192.241.242.65;
      }
    
    }
    
    
    #mail {
    #	# See sample authentication script at:
    #	# http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
    # 
    #	# auth_http localhost/auth.php;
    #	# pop3_capabilities "TOP" "USER";
    #	# imap_capabilities "IMAP4rev1" "UIDPLUS";
    # 
    #	server {
    #		listen     localhost:110;
    #		protocol   pop3;
    #		proxy      on;
    #	}
    # 
    #	server {
    #		listen     localhost:143;
    #		protocol   imap;
    #		proxy      on;
    #	}
    #}
    

    Contents of nodebb.conf I created in /etc/nginx/sites-enabled:

    server {
        listen 80;
    
        server_name community.domain.com;
    
        location / {
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-NginX-Proxy true;
    
            proxy_pass http://domain.com:4567/;
            proxy_redirect off;
    
            # Socket.IO Support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
        }
    }
    

    I initially tried to create a symlink between nodebb.conf in /sites-enabled and /sites-available, but this didn't seem to resolve the issue so I removed the symlink (I don't have any experience with creating symlinks prior to this project, so I thought I'd remove it in case I didn't execute the direction of the initial link correctly).

    Some background on my setup:

    • Ubuntu 14.04.3 x64 on a Digital Ocean droplet
    • Redis
    • NGINX

    I've been scouring these forums and elsewhere for tutorials throughout this installation, but I've followed this tutorial in particular all the way through: http://fengshuo.co/2015/03/07/setup-nodebb-with-do/

    My current domain shows the NGINX welcome message:

    ("Welcome to nginx!
    If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
    For online documentation and support please refer to nginx.org.
    Commercial support is available at nginx.com.
    Thank you for using nginx.")

    And my current subdomain (community.domain.com) shows a 502 Bad Gateway nginx/1.4.6 (Ubuntu) error message.

    Any help at all is appreciated. In the couple of days I've been hanging around these forums, I've already received a tremendous amount of help, so thank you! It's been fun (and quite daunting at times) learning multiple new things (NGINX, NodeBB, Redis) at once. Hoping to get this resolved soon.

  • @MarximusMG remove these from your config.json
    //new
    //don't forget this setting

  • @pichalite thanks for the response. I had wondered about that, but assumed they were ok to leave in there as comments since the tutorial didn't mentioned removing them.

    Just removed them, saved config.json, restarted nginx and rebooted the droplet, then tried running NodeBB but got the same error.

    I feel as if the lack of the symlink between /sites-enabled and /sites-available is relevant, but as I mentioned before, I'm not confident that I know how to execute that correctly (if it's needed in this case).

  • @MarximusMG Nginx has nothing to do with it... Nginx is just for proxying requests so you don't need to use the port in the URL.

    don't think you need this and not sure what that even does

    "use_port":"false",

    if you remove this line... remove the , at the end of the redis info too

  • @MarximusMG said:

    {
    "url": "http://community.domain.com",
    "secret": "",
    "database": "redis",
    "port":"4567",
    "bind_address":"0.0.0.0", //new
    "redis": {
    "host": "127.0.0.1",
    "port": "6379",
    "username": "
    ",
    "password": "***",
    "database": "0"
    },

    "use_port":"false", //don't forget this setting
    

    }

    try

    {
        "url": "http://community.domain.com",
        "secret": "***",
        "database": "redis",
        "port":"4567",
        "bind_address":"0.0.0.0", 
        "redis": {
            "host": "127.0.0.1",
            "port": "6379",
            "username": "***",
            "password": "***",
            "database": "0"
        }
    }
    

    As Pichalite also mentioned. then repost log.

  • @Joykiller @pichalite That did the trick! Thank you both so much for your help. Don't know why those lines were included in the tutorial I was using.

  • @MarximusMG which tutorial were you using? Can you post the link to it?

  • @julian does NodeBB use this option at all?

    "use_port": "false"

  • @pichalite Nope, use_port has been deprecated. Port usage is dictated by url from now on.


Suggested Topics


  • 0 Votes
    9 Posts
    709 Views

    @baris, I can’t reproduce it with short post content — in this case versioning works fine.

  • 1 Votes
    10 Posts
    1k Views

    @PitaJ @arranka

    Hi @all

    I still have the problem of the user display bug if there are too many members despite the plugin update.

    ISSUE HERE: https://github.com/NodeBB/nodebb-plugin-global-chat/issues/6

    I have hidden the list of users with the CSS code ACP:

    .chats-full [component="chat/header"] .members { display: none; } .chats-full [component="chat/header"]::before { content: "-- Tchatter avec tout les membres --"; font-weight: 500; }

    The problem is that this code hides users for all discussions and not just the Global Chat
    How to do this ? Or declare ROOMID on CSS/ACP

    Another question:

    How to rename the name of the salon?

    thanks for considering my comments.

  • 0 Votes
    1 Posts
    1k Views

    So... hello 🙂

    I was wondering if anyone has setup nodebb on Plesk Onyx succesfully?

    from what i can tell, everything is setup and working as it should, but I can not connect?...

    3/9 19:13 [7] - info: NodeBB v1.1.2 Copyright (C) 2013-2016 NodeBB Inc. 3/9 19:13 [7] - info: This program comes with ABSOLUTELY NO WARRANTY. 3/9 19:13 [7] - info: This is free software, and you are welcome to redistribute it under certain conditions. 3/9 19:13 [7] - info: 3/9 19:13 [7] - 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) > [email protected] start /usr/src/app > node loader.js 3/9 19:14 [36] - info: Launching web installer on port 4567 3/9 19:14 [36] - info: Web installer listening on http://0.0.0.0:4567 npm info it worked if it ends with ok npm info using [email protected] npm info using [email protected] npm info prestart [email protected] npm info start [email protected]

    anyone have any experiance?

  • 0 Votes
    9 Posts
    4k Views

    From C9 to Openshift
    If your looking to do this free then you may be real poor like me and how much data you use counts (I buy my net in lots of 500meg, ever meg counts), c9 can help with that.
    c9 is an online IDE, using it as your middle man with installing nodebb can allow you to avoid having to down and then up all the nodebb code. Without c9 each test install cost me around 70meg (I think thats what it was), using c9 its under 5.
    And the best thing is theres not trick to it, its simple...you do exactly the same steps but from c9's bash tab instead of your computer.

    Create an account with c9.
    Create a NodeJS workspace.
    Open it.
    Now just do all the usual steps you'd do in your cli in c9's bash console and you''ll avoid having to down/up anything.....plus you'll get to experience c9's amazing work.

    @drew Im sure Ill end up making a plugin at some point, but right now Im just learning Openshift and how to deal with updating and all dat.

  • NodeBB icons

    Solved Technical Support
    0 Votes
    4 Posts
    2k Views

    Here's the full list in case someone else will need it.