Heroku Boot Crash

Technical Support
  • I just finally was successfully able to push the 1.10.x NodeBB to Heroku today. But now, every-time it boots it therefore crashes with this crash. The full log from Heroku is below.

    2019-07-23T22:00:18.709145+00:00 heroku[web.1]: State changed from crashed to starting
    2019-07-23T22:00:30.688534+00:00 heroku[web.1]: Starting process with command `npm start`
    2019-07-23T22:00:33.731554+00:00 app[web.1]: 
    2019-07-23T22:00:33.731583+00:00 app[web.1]: > [email protected] start /app
    2019-07-23T22:00:33.731585+00:00 app[web.1]: > node loader.js
    2019-07-23T22:00:33.731587+00:00 app[web.1]: 
    2019-07-23T22:00:34.262171+00:00 heroku[web.1]: State changed from starting to crashed
    2019-07-23T22:00:34.245050+00:00 heroku[web.1]: Process exited with status 0
    2019-07-23T22:29:23.573862+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=agile-shelf-13721.herokuapp.com request_id=6103ed0e-eae9-4251-8523-08cdb774e233 fwd="" dyno= connect= service= status=503 bytes= protocol=https
    2019-07-23T22:29:27.849767+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=agile-shelf-13721.herokuapp.com request_id=b777bbe0-30e1-4b7a-ae60-ac52112184e3 fwd="" dyno= connect= service= status=503 bytes= protocol=https
  • I found some information within stackoverflow. That I am going to attempt. StackOverFlow says this: The post is located here:

    It looks like a R10 Error Boot Timeout. The error occurs due to the application unable to reach an external resource, like a database.
    I would double check your DB connection because this error is likely due to an improperly configured database connection.
    Did you provision a database connection using Heroku's Add-on's? If not, you will have to provision a database to fix the error. mLab is a free option but there are many others. I'll try to walk you through an example of how to do this.
    Navigate to your Heroku app's dashboard. Click on Resources. In the add-on search box, type in the database service you'd like to provision. If you choose mLab, it will take you to the mLab GUI. Your URI connection string is at the top of the screen. (You want to choose the one labeled "Driver". ) Click on the 'add a user' tab at the center-bottom part of the screen. Add a username and password. Save. After that, copy the URI connection string above, then navigate back to your dashboard. Click on Settings, reveal config vars. Now paste the URI connection string in the text box, then add in your newly created user credentials to replace the <username> and <password> fields. Copy the config variable MONGODB_URI. Next, on your command line, set or export the MONGODB_URI environment variable. Finally, in your application, navigate to where you start your server, then replace the connection to your local host's database with the MONGODB_URI e.g.  process.env.MONGODB_URI. Next, Add, commit, push to master then to Heroku. The R10 error should be gone. If it's not, see the links below.

    EDIT: This didn't seem to work.

Suggested Topics

  • 1 Votes
    5 Posts

    @baris Thanks, updated and everything is working now.

  • Post queue too big (crashing site)

    Unsolved Technical Support
    0 Votes
    2 Posts

    I will post a couple queries to help with this.

    Get number of queued posts

    db.objects.count({_key: "post:queue"});

    Get latest 20 post queue objects ids

    db.objects.find({_key: "post:queue"}).sort({score: -1}).limit(20);

    Using ids from above query you can get the queued posts with

    db.objects.find({_key: "post:queue:<replace_with_id_from_above_query"});

    To delete a post queue from the db with id 123456

    db.objects.remove({_key: "post:queue", value: "123456"}); db.objects.remove({_key: "post:queue:123456"});

    To remove all queued posts

    db.objects.remove({_key: /^post:queue/});

    Hope that helps.

  • 0 Votes
    7 Posts

    Okay so just to confirm this is caused by an error in sharp, try creating a file called test-sharp.js in your nodebb directory with the following contents:

    'use strict'; const fs = require('fs/promises'); const sharp = require('sharp'); async function run() { const input = await fs.readFile('public/logo.png'); await sharp(input) .resize({ width: 100 }) .toFile('build/public/logo.png'); } run().then(() => {}, err => setTimeout(() => { throw err; }, 0));

    Then run it like node test-sharp.js. It should create the file build/public/logo.png. Check the exit code with echo $?.

  • 0 Votes
    4 Posts

    @pitaj Followup to last message ... turns out Heroku does not allow access through any other port than the one it gives you. Is this an insurmountable obstacle and I should look into other hosting, or is there a workaround?

  • Crash on /search

    Technical Support
    0 Votes
    4 Posts

    @Alexander-Craggs MongoDB, version 2.6 or greater is required