Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

Running idrop.link on Heroku

Christian Schulze edited this page May 14, 2015 · 3 revisions

Note: The following guide assumes you have an Heroku account and you are logged in (heroku login).

Setup

Open up a terminal. Change the directory to wherever you have downloaded/checked out idrop.link. Run heroku create to initialise the project with heroku. Then push the code via git push heroku master to heroku.

If you'd open the app right now, you'd get an Application Error. We need to configure the database connection. The app uses environment variables to control the database access. So if you like, you can register a free MongoDB instance on mongolab or such. Please note that the database has to be called idroplink or otherwise the app won't find the database. You then get something like mongodb://<dbuser>:<dbpassword>@<somestring>.mongolab.com:39088/idroplink from the database provider.

Starting the app

Run heroku ps:scale web=1 to create a dyno and let the app run.

Considerations

Note that the port variable in the configuration file is omitted if deployed to heroku. Heroku itself sets an environment variable that replaces the configuration file port variable.

Common Problems

To debug the problems you might experience, type heroku logs --tail and go through the listed problems below. Please note: Github Issues are not meant to help you with your problems.

Authentification Error

If the log shows something like this:

2015-05-14T13:32:12.788825+00:00 app[web.1]: Listening at localhost:7667
2015-05-14T13:32:13.141562+00:00 app[web.1]:   message: 'auth failed',
2015-05-14T13:32:13.141556+00:00 app[web.1]: { [MongoError: auth failed]
2015-05-14T13:32:13.141560+00:00 app[web.1]:   name: 'MongoError',
2015-05-14T13:32:13.141565+00:00 app[web.1]:   errmsg: 'auth failed',
2015-05-14T13:32:13.141567+00:00 app[web.1]:   code: 18 }
2015-05-14T13:32:13.141564+00:00 app[web.1]:   ok: 0,
2015-05-14T13:33:10.277923+00:00 heroku[web.1]: Stopping process with SIGKILL
2015-05-14T13:33:10.277810+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2015-05-14T13:33:11.501209+00:00 heroku[web.1]: Process exited with status 137
2015-05-14T13:33:11.521050+00:00 heroku[web.1]: State changed from starting to crashed

your MONGODB_URI configured above is wrong (or the username/password), and the app can't authenticate itself to the MongoDB server.