Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uploaded successfully to Heroku Local but getting 503 error once pushed to Heroku live

So after changing around files and shifting code in my MEAN stack app, I've finally got it to load on Heroku local. Now the problem is when I push this app to my Heroku remote and ask to Heroku open, the app has this error....

Failed to load resource: the server responded with a status of 503 (Service Unavailable)

Below is the link to the app on Heroku...Can any help or hint me in the right direction?

https://istressless.herokuapp.com/

like image 666
Kandianne Pierre Avatar asked Oct 06 '15 02:10

Kandianne Pierre


People also ask

Why my heroku app is showing application error?

"Application Error" or similar is always caused by your own application code. Routing errors will normally only surface themselves within the logs of your application. In most cases, you will be able to see the cause of the error there. To learn more about logging, please see our Logging article on DevCenter.

Can heroku use localhost?

Start your app locally using the heroku local command, which is installed as part of the Heroku CLI. Your app should now be running on http://localhost:5000/.

What is a 503 response?

The HyperText Transfer Protocol (HTTP) 503 Service Unavailable server error response code indicates that the server is not ready to handle the request. Common causes are a server that is down for maintenance or that is overloaded.

How do I fix heroku logs?

So start heroku logs --tail in one shell or command prompt and then run the deploy step in another window, and you should see logs appear in the first, hopefully with an error that we can then solve.


1 Answers

Once you have created a new heroku app with heroku create then ensure you have added a database and configured your Mean app with the settings defined on mean.io

To add a MongoDB database to your Heroku app with:

heroku addons:create mongolab:sandbox

Add the Mongodb string to the production env in server/config/env/production.js. You can find this string using the command heroku config

Configure your Mean app on heroku by setting some environment variables

heroku config:add BUILDPACK_URL=https://github.com/mbuchetics/heroku-buildpack-nodejs-grunt.git

heroku config:add NODE_ENV=production

Adding a new configuration variable should redeploy your app and hopefully start your Mean application on Heroku.

All this assumes you have the Heroku toolbelt installed and your local code is under git version control.

This information is from the Heroku section of the learn.mean.io website

like image 104
jr0cket Avatar answered Nov 15 '22 08:11

jr0cket