NodeBB on Openshift - A few questions and problems

Technical Support
  • Well hello there.

    I've recently set up of this here fine piece of software as a guild forum on Openshift following this guide with one exception: I used v1.0.3 instead of v0.9.x as reccomended.

    The installation works, but Openshifts default MongoDB version is 2.4 and therefore below the required 2.6 version. The only actual errors I get because of this (so far) are from trying to use the search wich I've just disabled, and the database section in the admin panel.
    There is this custom cartridge, but it's intended for dev only and does not include the utils to import my existing DB.

    Here's my config.json:

    {
        "url": "http://forum-futuregadgetlab.rhcloud.com:8080",
        "bind_address": "127.10.29.1",
        "secret": "xxx",
        "database": "mongo",
        "mongo": {
            "host": "127.10.29.2",
            "port": "27017",
            "username": "admin",
            "password": "xxx",
            "database": "forum"
        }
    }
    
    

    Now on to my actual questions/problems

    • Does anyone know how I could get my MongoDB version up to the requirement? Or will I be fine even with 2.4?
    • Emoji point to the wrong port 8080 and therefore won't load. I think the Emoji plugin is using the url from config.json as a base, but that's clearly not correct since my installation is available at Port 80 as you can see here. However, if I remove the :8080 from my url in config.json, the forum won't be available.
    • Emails - I can't those things to work. Sending mails from terminal works fine, but nodebb doesn't seem to be able to. I always got ERROR EPIPE or soemthing similar. I then tried to set up mailgun, but since I don't have a custom domain I can't set DNS records to get mailgun to work. I then created a new google account to send emails through, wich also didn't work. Now, even with 'Route through google' option disabled and login credentials removed, I always get an error from google while trying to send a test email, as if the option isn't/can't be properly deactivated.

    I hope this community is able to help out. Looking forward to replies!

  • Please follow this guide.
    https://github.com/ahwayakchih/openshift-nodebb

    Latest MongoDB cartridge can be found here.
    https://github.com/icflorescu/openshift-cartridge-mongodb.

  • According to this issue on that guide, it won't work with v1.0.0 and above, and I really don't want to use an older version of NodeBB.

    And I'm aware of that cartridge, even tried it for a bit after I realised that I'm on an ancient MongoDB version, but it does not come with mongorestore so I don't know how to get my existing data into there. I don't know MongoDB that well, so if you could help me figure it out, I'd be greatful.

  • This issue only tells that upgrading from NodeBB 0.9.x to 1.x.x doesn't work. All stable and weekly versions of NodeBB 1.x.x should work fine (newer MongoDB version helps a lot).

    You can always upgrade on your local machine and import datastore/database to a freshly installed NodeBB.

  • Alright, I should've tried it myself before abandoning the idea.

    I created a second App on Openshift and am following the install instructions as I type this and hope everything goes well.

    Some time later:
    Okay, fresh install is finished. the post-receive script failed the first time

    remote: Welcome to NodeBB!
    remote:
    remote: This looks like a new installation, so you'll have to answer a few questions about your environment before we can proceed.
    remote: Press enter to accept the default setting (shown in brackets).
    remote:
    remote: 2/7 11:27 [152854] - info: Now configuring mongo database:
    remote: Configuration Saved OK
    remote: 2/7 11:27 [152854] - warn: You have no mongo password setup!
    remote: 2/7 11:27 [152854] - info: [database] Checking database indices.
    remote: Populating database with default configs, if not already set...
    remote: 2/7 11:27 [152854] - warn: NodeBB Setup Aborted.
    remote:  MongoError: E11000 duplicate key error collection: forum2.objects index: _key_1_value_-1 dup key: { : "config", : null }
    remote:     at Function.MongoError.create (/var/lib/openshift/5777d64c2d527177cf000239/app-root/runtime/repo/node_modules/mongodb-core/lib/error.js:31:11)
    remote:     at toError (/var/lib/openshift/5777d64c2d527177cf000239/app-root/runtime/repo/node_modules/mongodb/lib/utils.js:114:22)
    remote:     at /var/lib/openshift/5777d64c2d527177cf000239/app-root/runtime/repo/node_modules/mongodb/lib/collection.js:1008:67
    remote:     at commandCallback (/var/lib/openshift/5777d64c2d527177cf000239/app-root/runtime/repo/node_modules/mongodb-core/lib/topologies/server.js:1194:9)
    remote:     at Callbacks.emit (/var/lib/openshift/5777d64c2d527177cf000239/app-root/runtime/repo/node_modules/mongodb-core/lib/topologies/server.js:119:3)
    remote:     at null.messageHandler (/var/lib/openshift/5777d64c2d527177cf000239/app-root/runtime/repo/node_modules/mongodb-core/lib/topologies/server.js:358:23)
    remote:     at Socket.<anonymous> (/var/lib/openshift/5777d64c2d527177cf000239/app-root/runtime/repo/node_modules/mongodb-core/lib/connection/connection.js:292:22)
    remote:     at Socket.emit (events.js:95:17)
    remote:     at Socket.<anonymous> (_stream_readable.js:765:14)
    remote:     at Socket.emit (events.js:92:17)
    remote:     at emitReadable_ (_stream_readable.js:427:10)
    remote:     at emitReadable (_stream_readable.js:423:5)
    remote:     at readableAddChunk (_stream_readable.js:166:9)
    remote:     at Socket.Readable.push (_stream_readable.js:128:10)
    remote:     at TCP.onread (net.js:529:21)
    remote: CLIENT_RESULT:
    remote: CLIENT_RESULT: .-============================================-.
    remote: CLIENT_RESULT: .  Setup failed.
    remote: CLIENT_RESULT: .
    remote: CLIENT_RESULT: .  There was a problem completing NodeBB setup.
    remote: CLIENT_RESULT: .
    remote: CLIENT_RESULT: .  Check logfile for more information:
    remote: CLIENT_RESULT: .  logs/openshift-nodebb-setup.log
    remote: CLIENT_RESULT: ^-============================================-^
    remote: CLIENT_RESULT:
    remote: -------------------------
    remote: Git Post-Receive Result: failure
    remote: Activation status: failure
    remote: Activation failed for the following gears:
    remote: 5777d64c2d527177cf000239 (Error activating gear: CLIENT_ERROR: Failed to execute action hook 'deploy' for 5777d64c2d527177cf000239 application forum2
    remote: #<IO:0x00000001241390>
    remote: #<IO:0x00000001241318>
    remote: )
    remote: Deployment completed with status: failure
    

    but succeded on the 2nd try after an empty commit.

    Now let's see if I can figure out how to get my data to this fresh installation...

  • I managed to transfer the data by installing MongoDB locally to get the utils and using rhc port-forward to get access to the databases.

    But since then, users with Firefox and Opera reported that they're getting a constant flood of ERROR: Invalid Session messages on pretty much every action they take, and I get error: /login invalid csrf token in my log. Some can't login/register at all, some can login but not post anything, and so on. Chrome users are fine, and I'm not sure if this is a result of the new installation procedure or the database migration. Or neither?

    Others have this too apparently, see here and here.
    With OpenShift however I am not able to change anything webserver related, so not sure how to fix. This issue was not present in previous installation, wich is weird.

  • You have to clear cookies on browser side (just clear all cache) or change settings (domain related) on NodeBB side via Admin.

  • I got it to work just now. I tried a bunch of stuff, and after a force-restart it finally worked, but now I'm not sure what fixed it in the end.

    Thanks for all your help @nhl-pl, couldn't have done this without you. You have my gratitude 🙇

  • You've put port 8080 in "url". This should be the actual URL that people visit, and not the port on which the server should listen. You can specify the actual listen-port in config.json as follows:

    "port": 8080,
    

    This will fix the emoji-issue you're talking about 😉 (along with many other problems that may come up because the clients are trying an unresolvable port 8080)

    Source:
    https://docs.nodebb.org/en/latest/configuring/config.html


Suggested Topics