Installing on Heroku



  • I've attempted a heroku install 2 times: https://docs.nodebb.org/en/latest/installing/cloud/heroku.html

    I get through the whole installation but the app crashes every time.

    Logs say:

    2016-09-28T18:13:19.517332+00:00 app[web.1]: 28/9 18:13 [3] - info: Initializing NodeBB v1.1.2
    2016-09-28T18:13:21.348942+00:00 app[web.1]: 28/9 18:13 [3] - error: Error: Ready check failed: NOAUTH Authentication required.
    2016-09-28T18:13:21.348961+00:00 app[web.1]: at JavascriptReplyParser._parseResult (/app/node_modules/redis/lib/parsers/javascript.js:43:16)
    2016-09-28T18:13:21.348962+00:00 app[web.1]: at JavascriptReplyParser.try_parsing (/app/node_modules/redis/lib/parsers/javascript.js:114:21)
    2016-09-28T18:13:21.348962+00:00 app[web.1]: at JavascriptReplyParser.run (/app/node_modules/redis/lib/parsers/javascript.js:126:22)
    2016-09-28T18:13:21.348963+00:00 app[web.1]: at JavascriptReplyParser.execute (/app/node_modules/redis/lib/parsers/javascript.js:107:10)
    2016-09-28T18:13:21.348964+00:00 app[web.1]: at Socket. (/app/node_modules/redis/index.js:131:27)
    2016-09-28T18:13:21.348965+00:00 app[web.1]: at emitOne (events.js:90:13)
    2016-09-28T18:13:21.349069+00:00 app[web.1]: at Socket. (/app/node_modules/redis/index.js:131:27)
    2016-09-28T18:13:21.348965+00:00 app[web.1]: at Socket.emit (events.js:182:7)
    2016-09-28T18:13:21.349070+00:00 app[web.1]: at emitOne (events.js:90:13)
    2016-09-28T18:13:21.348966+00:00 app[web.1]: at readableAddChunk (_stream_readable.js:153:18)
    2016-09-28T18:13:21.349071+00:00 app[web.1]: at Socket.emit (events.js:182:7)
    2016-09-28T18:13:21.348967+00:00 app[web.1]: at Socket.Readable.push (_stream_readable.js:111:10)
    2016-09-28T18:13:21.349071+00:00 app[web.1]: at readableAddChunk (_stream_readable.js:153:18)
    2016-09-28T18:13:21.349067+00:00 app[web.1]: at JavascriptReplyParser._parseResult (/app/node_modules/redis/lib/parsers/javascript.js:43:16)
    2016-09-28T18:13:21.348968+00:00 app[web.1]: at TCP.onread (net.js:534:20)
    2016-09-28T18:13:21.349067+00:00 app[web.1]: at JavascriptReplyParser.try_parsing (/app/node_modules/redis/lib/parsers/javascript.js:114:21)
    

    config.json:

    {
      "url": "https://XXXX.herokuapp.com/",
      "secret": "XXXX-dd58a9fcc495",
      "database": "redis",
      "redis": {
        "host": "sculpin.redistogo.com",
        "port": "10027",
        "password": "XXXX",
        "database": "0"
      }
    }
    

    Any idea what I should do to fix it?


  • Gamers

    Are you very sure your database account settings are correctly configured?

    2016-09-28T18:13:21.348942+00:00 app[web.1]: 28/9 18:13 [3] - error: Error: Ready check failed: NOAUTH Authentication required.
    

    This states that you need authentication ;)



  • I just exactly followed the instructions here: https://docs.nodebb.org/en/latest/installing/cloud/heroku.html

    I don't know what I should change.



  • I've installed it locally on my Mac too. Same results.

    Perhaps theres been an installation script regression?


  • Global Moderator

    @setpixel it's related to your database settings. Your password or some other setting is incorrect.



  • I can confirm this, I had the same issue, it started happening recently, specifically when connecting to Heroku's Redis addons. It is most likely caused by some extra security changes done on those outwardly exposed redis stores.

    I found a workaround for it for now, was thinking about putting a pull request in, it involves simply supporting a "url" field for the redis database configs in config.json

    If a dev sees this, please let me know if you would like me to do it or if you are working on your own solution.

    Meanwhile, the fix:

    in nodebb/src/database/redis.js (https://github.com/NodeBB/NodeBB/blob/master/src/database/redis.js) replace the following:

        if (redis_socket_or_host && redis_socket_or_host.indexOf('/') >= 0) {
            cxn = redis.createClient(nconf.get('redis:host'), options);
        } else {
            cxn = redis.createClient(nconf.get('redis:port'), nconf.get('redis:host'), options);
        }
    

    with

        cxn = redis.createClient(process.env.REDIS_URL, options);
    

    where process.env.REDIS_URL should have your full redis connection url ("redis://...") as set by heroku

    also since the redis url string includes the password, you may want to remove the following bit in the same code block

        if (nconf.get('redis:password')) {
            cxn.auth(nconf.get('redis:password'));
        }
    

    Finally, a more general solution would be nice, again if anyone could mention a dev here please let me know if the config change solution is desirable.

    Cheers!



  • Can I just say, really shitty experience today.

    I posted an issue in Github, which was immediately closed and he told me to post in here.

    Then a moderator is saying that my password is incorrect?

    It's a bug.

    Just like @zoharm, I was able to fix the issue.

    ** The issue has nothing to do with Heroku ** I was able to recreate the issue locally. This issue is entirely related to a redis server having a password.

    My fix was to add the lines in in nodebb/src/database/redis.js (https://github.com/NodeBB/NodeBB/blob/master/src/database/redis.js) at line 77:

    if (nconf.get('redis:password')) {
    options.password = nconf.get('redis:password');
    }

    My guess is that the redis package was updated and introduced the bug.

    Should probably issue a fix ASAP as no one with redis and a password will work with a new install.

    Also, maybe don't close out issues immediately for something that is straight up a new bug. Oh and uh, fix yo shit.

    :D


  • Global Moderator

    @setpixel My apologies for not prefacing my response with "I think." It was most simple explanation given the information I had at the time. This issue you were having, based on everything you said, indicated an issue with your settings, not an issue with NodeBB.

    The reason your Github issue was closed (I'm assuming because I don't know what exactly you said) was most likely because at face value what you are describing, and what the error message you provided points to is a problem involving your database authentication settings.

    When you said you tested this locally, I assumed you meant you tested it with the same exact settings, which would of course mean you would get the same error from Heroku. I didn't realize you just tried setting a password on your local Redis database.

    You have to understand that the vast majority of issues presented on this site are basic technical issue encountered by people who are not acquainted with debugging or working within the systems NodeBB runs on.

    So, if you don't mind, please open a new Github issue with what you've found including the NodeBB commit hash and the redis npm package version. Thanks!


  • GNU/Linux

    I can confirm that the bug is valid - in my experienced opinion - and on the side of NodeBB (or probably a mistake on side of its dependencies).

    Reproduced locally with a fresh setup.

    @zoharm You can achieve the same circumvention by just using the redis:host property within the config.json (or the setup procedure) for the redis url like

    "host": "redis://:my-password@127.0.0.1:6379"
    

    This does not require any code modifications ;-)

    To keep the reference to the already filed issue: gh#5069



  • Thanks guys! Looking forward to using NodeBB! I'm excited!



  • @frissdiegurke @setpixel thanks for the info guys!

    Now I am curious though, I was always using v1.1.2 and it worked fine for a while on Heroku (which uses passworded redis servers). How did the issue suddenly start happening just recently? Dependencies couldn't have changed without a version change, right?



  • I was going to look into it, but it must be the redis npm package.


  • Admin

    Report your redis dependency version with npm ls redis.


  • GNU/Linux

    @zoharm Dependencies are allowed to change within a certain version range. If a package follows the semver specification (and does not introduce breaking bugs) there should never be problems with this for the version ranges NodeBB uses.
    But in this case it seems the socket.io-redis (or maybe even one of its dependencies) has introduced such a bug approximately 5 days ago.


  • Admin


Log in to reply
 

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.