NodeBB ACP-access broken

Bug Reports
  • Plugin & Theme Dev

    I try to create a new NodeBB setup (branch master or v0.7.x).
    Whenever I create a new admin via ./nodebb setup (since database was empty before) I CAN login but once I try to access /admin I automatically get logged out and my user is somehow broken so I cannot login anymore.
    Happens with mongo and redis. No errors within development output.

  • Plugin & Theme Dev

    @julian I just pulled the latest and tried again but this issue is still present.

    Do you have any clue how to fix or may you provide redis-commands therefor I can give you more information what happens to the user-object.

    Otherwise I sadly cannot setup local instance for testing (especially I wanted to try whether gh#1528 is still present).

    And a command to drop whole redis-databases would be nice thought. Currently for each try I need use a new db-index...

  • GNU/Linux

    @frissdiegurke flushdb in redis to drop just that database 😄

    What environment are you using?

    Edit: I can't reproduce this -- the setup completes properly and I can log in and access the ACP normally...

  • Plugin & Theme Dev

    I'm using redis 3.0.2, nodejs 0.12.7, npm 2.13.1, NodeBB commit 65ab5733ef8f6750ea710f490c8c92bea7721bbd and chromium 43.0.2357.134 on x86_64 Arch Linux 4.1.2-2.
    Should all be latest within arch-repos.

    After fresh git clone I ran

    npm i
    ./nodebb setup
    ./nodebb dev # same problem when using ./nodebb start, etc.

    When accessing NodeBB via browser now and logging in as the admin created within ./nodebb setup and accessing /admin afterwards the user gets somehow broken and I'm suddenly logged out.
    I cannot login afterwards.

    When using mongodb 3.0.4 (since I know it's cli) the objects-collection contains the following after trying to access /admin: (the user is called "frissdiegurke", for search ;))

    maybe you see anything suspicious... I noticed that the user-status is still set to "online".

    EDIT: here is the config.json:

        "url": "http://localhost:4567",
        "secret": "some uuid...",
        "database": "mongo",
        "mongo": {
            "host": "",
            "port": "27017",
            "username": "nodebb",
            "password": "secret",
            "database": "nodebb"

    so everything quite default values...

  • NodeBB

    What happens when you try to login after you get logged out? 403? 500?

  • Plugin & Theme Dev

    I've disabled the cache for this (request-header Cache-Control:no-cache) but without that the same result: 200.


    Remote Address:[::1]:4567
    Request URL:http://localhost:4567/login?local=1
    Request Method:POST
    Status Code:200 OK

    Response Headers

    Content-Type:text/html; charset=utf-8
    Date:Sat, 18 Jul 2015 15:13:14 GMT
    set-cookie:express.sid=s%3AKZKFhtm5od-ur_JBgNkN1mZk-_MgogOF.r%2BamgtRRL1d%2Bun5NbhOxIuBW1W%2FJx7WAv9xp01UorXo; Path=/; Expires=Sat, 01 Aug 2015 15:13:14 GMT; HttpOnly

    Request Headers

    Accept-Encoding:gzip, deflate
    Content-Type:application/x-www-form-urlencoded; charset=UTF-8
    Cookie:org.cups.sid=6592779d4f2a1725f4c410957b3ffef2; connect.sid=s%3AR0QEUPdPVSiS5tazLC8bkdhtLmjyYEnp.Q5Eucy7fsCVN22WViBWuZaWgmOzhFKrayNvnkdYuleY; express.sid=s%3AKZKFhtm5od-ur_JBgNkN1mZk-_MgogOF.r%2BamgtRRL1d%2Bun5NbhOxIuBW1W%2FJx7WAv9xp01UorXo
    User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36

    Query String Parameters


    Form Data


    I've also tried with other returnTo value (http://localhost:4567/tags) but same result 200 and redirect to /login?local=1

    EDIT: After cleaning cookies (more specific express.sid) I can login again but as soon I try to access /admin it's the same all over again.

  • Plugin & Theme Dev

    The request to /admin itself when logged in (and avatar is showed, etc.) results in a 302 as it seems:


    Remote Address:[::1]:4567
    Request URL:http://localhost:4567/admin
    Request Method:GET
    Status Code:302 Moved Temporarily

    Response Headers

    Content-Type:text/html; charset=utf-8
    Date:Sat, 18 Jul 2015 15:41:47 GMT
    set-cookie:express.sid=s%3ASnR2fDlqTEBDunA6DAyurgERQy9LvZwj.jmjluB9kDCE%2BSEhCtxTpzgcakpjJa%2BKOpuFYYSgtmIo; Path=/; Expires=Sat, 01 Aug 2015 15:41:47 GMT; HttpOnly
    Vary:Accept, Accept-Encoding

    Request Headers

    Accept-Encoding:gzip, deflate, sdch
    Cookie:express.sid=s%3ABq2PBi6iT5jaRQ6Qg3ojLy9PyWB0dRe6.VgpaSnS%2B%2BvdTxoJkxieZgw4ZpOWzUxJZOOH%2BWygCNqw; express.sid=s%3AYryeHEojKdlk3cc9SBmIegkusB9GeJ70.wJ5jXbD5oqvrygsWvUKMbq8mVJGIXrprt%2F%2F3OAH0jn0
    User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.134 Safari/537.36

    Maybe the two different express.sid request-cookies have sth to do with this o_O

  • NodeBB

    Can you try switching the session store to redis and see if that helps?

  • Plugin & Theme Dev

    I've used redis in first place, just switched to mongodb for debugging purpose since I'm not familiar with redis commands.
    So everything happens using redis the same way.

  • GNU/Linux

    Highly peculiar... and does this also happen on, say... a cloud install?

  • NodeBB

    @frissdiegurke Does this happen with node 0.10.x?

  • Plugin & Theme Dev

    @baris said:

    @frissdiegurke Does this happen with node 0.10.x?

    Since there is no way to install node 0.10.x (neither iojs, wanted to try this 😄 ) without purging my current version I'm not willing to do this.

    I've just tried to remove all global installed node_modules (rm -rf /usr/lib/node_modules), clean npm cache and reinstall npm and my global modules.
    But it still didn't fix the problem (fixed some non-related errors though).

    I'll try on my desktop-pc (also bleeding-edge arch-linux) later this day to see if it works there.

  • GNU/Linux

    You could try installing nvm, which would allow you to "install" Node from within your home directory...

    Then you can switch between 0.10, 0.11, 0.12, and even iojs, with a single nvm use command.

    Of course, you do have to npm rebuild each time, but that's not so bad.

  • Plugin & Theme Dev

    @julian well, that's affordable 😄 didn't know nvm thanks!

    Using nodejs v0.10.40 (npm 1.4.28) and npm rb within NodeBB root, flushing db and calling ./nodebb setup again... The issue still persists o_O

    I've also tried the v0.6.x branch (using nodejs 0.12.x) where the same issue occurs, so it's definitely no fault within the NodeBB core (unless caused by lately bugfixes within that branch too)...

    As I said I'll test on desktop-pc later on. Maybe I'll also try around with docker some time (never used it yet, definitely need to xD ).

  • GNU/Linux

    Eh, try LXC. I recommend it over Docker 😄

Suggested Topics

| | | |