Recovering an Offline Application
Last updated June 11, 2020
Table of Contents
Your application may be experiencing downtime for a number of reasons. This article will help 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, will serve a default error page for your application when there are errors. You can compare this 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, you should investigate the cause of this issue. Our descriptions of these errors is the best place to start.
Check your processes
Check on the current status of your process formation:
$ heroku ps
This will tell you the current state of your application’s dynos. Ensure you are running the right number of each process type (at least one) and your dynos are booting correctly.
$ heroku scale web=1
If your dynos are 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 to be restarted after a schema change to your database, or if recent Heroku maintenance affected your application.
Test using curl
A number of issues can be detected using curl:
$ curl -v http://example.herokuapp.com/
herokuapp.com hostname in addition to your custom domains will help determine if the issue is specific to your custom domain or your application.
Some common issues you may discover are:
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.
Certificate errors, or other errors relating to using SSL, should refer to our SSL documentation.
Check application health
Heroku provides several additional tools to check the health of your application.
heroku releasesfor 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 may indicate that you need to scale your application or migrate to a larger database.
Review advice for production applications
Your application may be affected by an issue that would best be 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. You should check Heroku’s status site to see if your application is affected.
Ask for help
If you are still unable to determine why your application is down, get in touch with us via our support channels.