fresh install, session problem

Technical Support
  • I am getting problems like:
    It looks like your login session is no longer active, or no longer matches with the server. Please refresh this page.
    We were unable to log you in, likely due to an expired session. Please try again.

    The thing is; when I try from my computer, Safari and Chrome does not give error; but Safari on my tablet or Chrome on my phone also give similar sesson problems.

    Setting are:

    Ubuntu 16.04; dedicated server; plesk panel; apache server, nginx proxy.

    CONFIG.JSON

    {
    "url": "https://forum.mydomain.com",
    "secret": "xxxxxxxx",
    "database": "mongo",
    "port": 4567,
    "mongo": {
    "host": "127.0.0.1",
    "port": "27017",
    "username": "nodebb",
    "password": "xxxxxxxxxx",
    "database": "nodebb"
    },
    "type": "literal"
    }

    ON PLESK PANEL:

    Additional nginx directives:

    location ~ / {

    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    
    proxy_set_header X-Forwarded-For $remote_addr;
    
    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;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    

    }

    Additional apache directives: none

    I have near zero knowledge about nginx settings; so I've copied all things that are advised in similar questions šŸ™‚

    Thanks for your help.

  • the url in your config has to match the fqdn of your site. Also, I don't believe the https is necessary in that config as you are not using https in your nginx config.

    {
    "url": "http://the.exact.url",
    "secret": "xxxxxxxx",
    "database": "mongo",
    "port": 4567,
    "mongo": {
    "host": "127.0.0.1",
    "port": "27017",
    "username": "nodebb",
    "password": "xxxxxxxxxx",
    "database": "nodebb"
    },
    
  • But the site has a certificate from Letsencrypt. I mean, I need to run in https.

    What must I change?

  • aditional info:

    I have added to plesk settings:

    Additional Apache directives:

    Additional directives for HTTP : RequestHeader set X-Forwarded-Proto "http"
    Additional directives for HTTPS : RequestHeader set X-Forwarded-Proto "https"

    Additional nginx directives:
    CHANGED TO: proxy_set_header X-Forwarded-Proto https;

    But still problem persists:

    ./nodebb log
    2018-03-28T20:09:27.120Z [16310] - info: Initializing NodeBB v1.8.1 https://forum.mydomain.com
    2018-03-28T20:09:27.919Z [16310] - info: [socket.io] Restricting access to origin: https://forum.mydomain.com : *
    2018-03-28T20:09:28.053Z [16310] - info: Routes added
    2018-03-28T20:09:28.056Z [16310] - info: NodeBB Ready
    2018-03-28T20:09:28.059Z [16310] - info: Enabling 'trust proxy'
    2018-03-28T20:09:28.061Z [16310] - info: NodeBB is now listening on: 0.0.0.0:4567
    2018-03-28T20:14:37.264Z [16310] - error: /login
    invalid csrf token
    2018-03-28T20:15:56.745Z [16310] - error: /register
    invalid csrf token
    2018-03-28T20:18:01.983Z [16310] - error: /register
    invalid csrf token
    2018-03-28T20:18:06.767Z [16310] - error: /register
    invalid csrf token
    2018-03-28T20:20:12.421Z [16310] - error: /register
    invalid csrf token

  • @seyeran Whatever is in your config.json has to match the URL you are navigating to.

  • @teh_g said in fresh install, session problem:

    @seyeran Whatever is in your config.json has to match the URL you are navigating to.

    Thank you. I am really indebted to you. I was trying to solve it for the last 6-7 hours.

    Solution worked for me is this:
    Permanent 301 redirect from HTTP to HTTPS

  • Still, I have this problem!

    server {
        listen 80;
    
        server_name disnut.com;
    
        location / {
            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";
        }
    }
    

    This is my NGINX Config

    0_1527224687271_Screenshot.png

  • same problem. any updates?

  • Ensure the config.json url matches the url you actually use to navigate to the forum.


Suggested Topics


  • ubuntu installed MongoDB error

    Solved Technical Support
    0 Votes
    12 Posts
    173 Views

    @phenomlab I reinstalled and deleted it. I think it installed successfully this time.
    c8b7132a-5581-4a46-afb3-f6b5524dacd0-image.png

  • 0 Votes
    3 Posts
    879 Views

    Hello there!

    NodeBB is designed to work best under a virtual private server. Using a traditional hosting service is not recommended as they do not have the capabilities to power NodeBB effectively.

    The code and instructions can be found here at our project repository Full instructions can be found in our Documentation Portal We recommend DigitalOcean to host your NodeBB, you'll get a month free just by registering with this link. You can also try applying the 10TOSHIP coupon to get another two months free, and as an added bonus, you'll be helping us out too!

    Thank you for your interest in NodeBB!

  • 1 Votes
    3 Posts
    1k Views

    Pulling from Master helped. However the webpage that starts NodeBB after setting up the DB through the webpage, doesn't restart it now. I had to kill the command line, and manually start nodeBB. But then it works fine. Just an FYI.

  • 0 Votes
    5 Posts
    2k Views

    @pichalite said in v1.x.x installs mongodb 2.1.22 and requires 2.1.3:

    @exodo try the install without the ~

    npm i [email protected]

    that's the latest in that minor version.

    seems to work now after a few error commands šŸŒ

    npm i [email protected] - > [email protected] install /var/foroexodo/nodebb/node_modules/mongodb/node_module s/kerberos > (node-gyp rebuild) || (exit 0) make: Entering directory `/var/foroexodo/nodebb/node_modules/mongodb/node_module s/kerberos/build' CXX(target) Release/obj.target/kerberos/lib/kerberos.o In file included from ../lib/kerberos.cc:1:0: ../lib/kerberos.h:5:27: fatal error: gssapi/gssapi.h: No such file or directory compilation terminated. make: *** [Release/obj.target/kerberos/lib/kerberos.o] Error 1 make: Leaving directory `/var/foroexodo/nodebb/node_modules/mongodb/node_modules /kerberos/build' gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_module s/node-gyp/lib/build.js:267:23) gyp ERR! stack at ChildProcess.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820: 12) gyp ERR! System Linux 3.5.0-54-generic gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/nod e-gyp.js" "rebuild" gyp ERR! cwd /var/foroexodo/nodebb/node_modules/mongodb/node_modules/kerberos gyp ERR! node -v v0.10.37 gyp ERR! node-gyp -v v1.0.1 gyp ERR! not ok [email protected] node_modules/mongodb ā”œā”€ā”€ [email protected] ā”œā”€ā”€ [email protected] ([email protected], [email protected], [email protected] 1, [email protected]) ā”œā”€ā”€ [email protected] ([email protected]) └── [email protected] ([email protected]) root@w1-exodo:/var/foroexodo/nodebb# npm ls mongodb [email protected] /var/foroexodo/nodebb └── [email protected] invalid npm ERR! invalid: [email protected] /var/foroexodo/nodebb/node_modules/mongodb npm ERR! not ok code 0 root@w1-exodo:/var/foroexodo/nodebb# npm install root@w1-exodo:/var/foroexodo/nodebb# ./nodebb upgrade 1. Bringing base dependencies up to date... OK 2. Checking installed plugins for updates... OK 3. Updating NodeBB data store schema... 15/8 11:14 [5763] - info: [database] Checking database indices. 15/8 11:14 [5763] - info: Beginning database schema update 15/8 11:14 [5763] - info: [2015/12/15] Chats upgrade skipped! 15/8 11:14 [5763] - info: [2015/12/23] Chats room hashes upgrade skipped! 15/8 11:14 [5763] - info: [2015/12/23] Adding theme to active plugins sorted set skipped! 15/8 11:14 [5763] - info: [2016/01/14] Creating user best post sorted sets skipped! 15/8 11:14 [5763] - info: [2016/01/20] Creating users:notvalidated skipped! 15/8 11:14 [5763] - info: [2016/01/23] Creating Global moderators group skipped! 15/8 11:14 [5763] - info: [2016/02/25] Social: Post Sharing skipped! 15/8 11:14 [5763] - info: [2016/04/14] Group title from settings to user profile skipped! 15/8 11:14 [5763] - info: [2016/04/19] Users post count per tid skipped! 15/8 11:14 [5763] - info: [2016/04/29] Dismiss flags from deleted topics skipped! 15/8 11:14 [5763] - info: [2016/05/28] Giving topics:read privs to any group that was previously allowed to Find & Access Category - skipped! 15/8 11:14 [5763] - info: [2016/06/13] Store upvotes/downvotes separately skipped! 15/8 11:14 [5763] - info: [2016/07/12] Upload privileges skipped! 15/8 11:14 [5763] - info: [2016/08/05] Removing best posts with negative scores skipped! 15/8 11:14 [5763] - info: [upgrade] Schema already up to date! OK NodeBB Upgrade Complete! root@w1-exodo:/var/foroexodo/nodebb# npm ls redis [email protected] /var/foroexodo/nodebb ā”œā”€ā”¬ [email protected] │ └─┬ [email protected] │ └── [email protected] ā”œā”€ā”€ [email protected] └─┬ [email protected] └── [email protected] root@w1-exodo:/var/foroexodo/nodebb# npm ls mongodb [email protected] /var/foroexodo/nodebb └── [email protected]
  • install on wp site

    Technical Support
    0 Votes
    22 Posts
    8k Views

    @yariplus Thanks for the help, but I guess it was not the solution. Thanks anyway, im going to try again