Can not login to NodeBB. Login or password wrong

Unsolved Technical Support
  • @Kosiak Your login stays active for 14 days (by default), but admin will re-challenge you with password after 1 hour.

  • @julian How could the password get corrupted in the database? This is my default password for local development. I can't forget it even if I die.
    How can I change the password directly in the database?

  • @Kosiak said in Can not login to NodeBB. Login or password wrong:

    Interesting fact, due to the fact that I am logged into the frontend, I was able to change the language of the forum. When I tried to change the password nothing happens. I can enter any nonsense in the "Current Password" field and the form accepts it without errors. But I don't know if the password changes.

    How can this behavior be explained?

  • How can this behavior be explained?

    You probably got an error but we didn't show it (probably a bug).

    As for the password thing — 🤷 No idea.

    If this is your development database, then drop the database and start over.

  • @julian said in Can not login to NodeBB. Login or password wrong:

    If this is your development database, then drop the database and start over.

    This is a ported forum from another engine. Accordingly, I made a lot of edits locally, then transferred to the server where I continued the setup. Yes, definitely, if I rolled back the version that exists on my mac, I would lose a few hours of development and configuration, but I wouldn't spend many hours looking for a login problem. However, I have already wasted this time and I have no guarantees that the problem will not return in a few hours after I re-upload the database from the local version. Perhaps the problem is in the combination of settings that I made in the admin panel, or perhaps an electron flying out of a distant star got into the transistor of my server, corrupting my password. Who knows. However, if I could find a solution or problem that caused the situation, I could sleep more peacefully. Today I have the opportunity to roll back without losing too much, who knows if there will be such an opportunity the next time it happens. I am not a supporter of leaving unresolved problems behind.

  • I reuploaded the database from my local version. It wasn't easy and restore with "mongorestore --drop" failed. Despite the fact that mongorestore reported that everything was done, nothing has changed. Perhaps NodeBB has a cache somewhere, but I don't know anything about it. I had to first manually delete the mongodb database and then use mongorestore. I restarted Nodebb and got a working version. I can login. However, everything is extremely slow. I have never seen NodeBB run slower than wordpress on apache without a cache. Refreshing some pages takes tens of seconds. Unfortunately, it's almost morning and I have to go to bed because I don't understand anything anymore.
    If anyone has an idea what happened with the speed and how to fix it feel free to write it to me.

  • @kosiak you'll need to rebuild the Mongo indices, NodeBB should do it automatically but there are some commands you can run in mongo if you want to do them yourself.

    I don't have them on hand but @baris I'm sure does.

  • If you want to create indices you can run these in mongo cli.

    db.objects.createIndex({ _key: 1, score: -1 });
    db.objects.createIndex({ _key: 1, value: -1 }, { unique: true, sparse: true });
    db.objects.createIndex({ expireAt: 1 }, { expireAfterSeconds: 0 });
  • @baris I got error when I tried your commands:

    admin> use nodebb
    switched to db nodebb
    nodebb> db.objects.getIndexes()
    [ { v: 2, key: { _id: 1 }, name: '_id_' } ]
    nodebb> db.objects.createIndex({ _key: 1, score: -1 });
    nodebb> db.objects.createIndex({ _key: 1, value: -1 }, { unique: true, sparse: true });
    MongoServerError: Index build failed: 1374ccee-594f-4a6e-8561-881742cbb123: Collection nodebb.objects ( 2a93f794-19b8-444c-82e5-90190d386264 ) :: caused by :: E11000 duplicate key error collection: nodebb.objects index: _key_1_value_-1 dup key: { _key: "analyticsKeys", value: "uniquevisitors" }
    nodebb> db.objects.createIndex({ expireAt: 1 }, { expireAfterSeconds: 0 });
    nodebb> db.objects.getIndexes()
      { v: 2, key: { _id: 1 }, name: '_id_' },
      { v: 2, key: { _key: 1, score: -1 }, name: '_key_1_score_-1' },
        v: 2,
        key: { expireAt: 1 },
        name: 'expireAt_1',
        expireAfterSeconds: 0

    Is it ok?

  • For my original problem, I think I found a bug.
    For some reason the user password length was set to 0 (I didn't set it that way, it's not possible). When I set up my forum, my password was 7 characters long (before launching the site, I change the password to a complex and unique one, but during the development process I use a simple one that I remember). When I transferred the forum to the server and edited Users -> Settings, I set the minimum password to 8 characters, because it was impossible to leave the field with a default value of 0. And here I see a bug, because no one expects this behavior. Once the minimum password is set, NodeBB simply stops accepting any passwords that are shorter. This is completely non-obvious and as an admin I fell into a trap. I would expect two behaviors:

    1. Continue to accept set passwords even of shorter length until a password change is required
    2. Display a warning and reset passwords of shorter length if the administrator confirms this action.

    Снимок экрана 2023-02-01 в 14.04.48.png

Suggested Topics

  • 0 Votes
    2 Posts
  • 0 Votes
    1 Posts
  • 0 Votes
    2 Posts
  • Custom Login Page

    Unsolved Technical Support
    0 Votes
    3 Posts
  • 0 Votes
    12 Posts