Your application can experience downtime for a number of reasons. This article helps you discover why and what you can do to remedy the problem.
Check Your Application Logs
The first step is to check your application’s logs. Many common application errors as well as Heroku’s errors are printed to your applications logs. To view your logs, run:
$ heroku logs
Note that many frameworks, including Ruby on Rails, serve a default error page for your application when there are errors. You can compare that to Heroku’s error page, which is used when one of Heroku’s error codes is the cause of the issue.
If your logs show one of Heroku’s error codes, investigate the cause of this issue. Our descriptions of these errors is the best place to start.
Check Tour Processes
Check on the current status of your process formation:
$ heroku ps
This command tells you the current state of your application’s dynos. Ensure you’re running the right number of each process type (at least one) and your dynos are booting correctly.
$ heroku scale web=1
If your dynos crashed, restarting the app can help debug the issue.
Restart Your Application
If the problem is not immediately present, it can be helpful to restart your application, tail your logs, and then try viewing your application in a web browser.
$ heroku restart
$ heroku logs --tail
$ heroku open
Some application issues are solved by restart. For example, your application may need a restart after a schema change to your database, or if recent Heroku maintenance affected your application.
Test Using curl
You can detect a number of issues using curl
:
$ curl -v http://example-app-1234567890ab.herokuapp.com/
Testing your herokuapp.com
hostname in addition to your custom domains helps determine if the issue is specific to your custom domain or your application.
Some common issues:
An HTTP 500 error code indicates an error returned by your application. Check your Heroku logs for more details.
An HTTP 503 error code indicates a Heroku error code. Check your logs for the error code you received and reference our Heroku error code documentation for further information.
Resolve DNS errors (
could not resolve host
) by setting up your custom domain for use on Heroku. Note that alternate instructions apply if you’re using SSL.For certificate errors, or other errors relating to using SSL, refer to our SSL documentation.
Check Application Health
Heroku provides several additional tools to check the health of your application.
Check
heroku releases
for recent changes made to your application. You can rollback to an older release if necessary.A monitoring add-on like New Relic is an excellent way of keeping an eye on your application’s health. A large change in requests received or response time can indicate that you need to scale your application or migrate to a larger database.
Review Advice for Production Applications
Your application can be affected by an issue that’s best mitigated by modifying how your Heroku application is running on the platform. Production Check is a great tool for ensuring that your app is ready to run on the platform in production.
Check Platform Status
An active or recent incident could cause your application to be unavailable or unstable. Check Heroku’s status site to see if your application is affected.
Ask for Help
If you still can’t determine why your application is down, get in touch with us via our support channels.