<commit_before>---
title: Troubleshoot Application Deployment and Health
---

_This page assumes that you are using cf v6._

The basic tools for troubleshooting are:

* `cf apps`, `cf events`, `cf logs --recent` and the other [troubleshooting commands](#cf-commands)
* The [heuristics](#scenarios) to apply in common failure scenarios
* Examining [environment variables](#env)
* Exploring [logs](#logs)
* Tracing [Cloud Controller REST API calls](#trace)
* The [Cloud Foundry Developers](https://groups.google.com/a/cloudfoundry.org/forum/#!forum/vcap-dev)
mailing list, where you can search on error messages

## <a id='scenarios'></a>Failure Scenarios and Troubleshooting Heuristics ##

This section explains basic troubleshooting for failure scenarios in each stage
of app deployment.

### <a id='upload'></a>App fails to upload ###

* Verify that your app does not exceed the maximum size allowed by Cloud
Controller.

* Verify that your network connection is not slow and causing the upload to
time out.
If you are seeing `500` errors, a slow network connection may be at fault.

* If your app contains a large number of files and is failing to upload,
it sometimes helps to push the app repeatedly.
Each push uploads a few more files.
Eventually, all files have uploaded and the push succeeds.

### <a id='detect'></a>Cloud Foundry fails to detect a buildpack ###

* Verify that your app is in a language or framework supported by one of
the three [system buildpacks](../../buildpacks/), or, that you are using the
`-b` option to give `cf push` the location of an appropriate buildpack.

### <a id='compile'></a>App fails to compile ###

* Verify that the amount of memory your app is configured to use is within
the limit specified by the buildpack.

* Verify that your app uses the `PORT` environment variable and does not specify
a port in any other way.

* Verify that your app generally adheres to the principles of the
[Twelve-Factor App](http://12factor.net) and [Prepare to Deploy an Application]
(./prepare-to-deploy.html).
Your app might build in a way that works fine locally but fails in the cloud.
These texts explain the kinds of adjustments that solve this kind of problem.

* Alternatively, sometimes a Cloud Controller problem causes a compile failure.

### <a id='start'></a>App fails to start or scale ###

* Verify that you are pushing the app to a Cloud Foundry app space that has
sufficient memory available for all instances of your app.

* Verify that components within Cloud Foundry can communicate with each other.
Look for log entries indicating problems such as _example here_.
Cloud networking issues can cause problems like this.

## <a id='cf-commands'></a>cf Troubleshooting Commands ##

Cloud Foundry's cf command line interface provides commands for investigating
app deployment and health.

Some of these commands may return connection credentials.
Remove credentials and other sensitive information from command
output before you post the output a public forum.

* `cf apps`: Returns a list of the applications deployed to the current space<commit_msg>remove placeholder line to put back later<commit_after>---
title: Troubleshoot Application Deployment and Health
---

_This page assumes that you are using cf v6._

The basic tools for troubleshooting are:

* [Troubleshooting commands](#cf-commands) like `cf apps`, `cf events`, and `cf logs --recent`
* [Heuristics](#scenarios) to apply in common failure scenarios
* [Environment variables](#env)
* [Logs](#logs)
* [Cloud Controller REST API requests and responses](#trace)
* The [Cloud Foundry Developers](https://groups.google.com/a/cloudfoundry.org/forum/#!forum/vcap-dev)
mailing list

## <a id='scenarios'></a>Failure Scenarios and Troubleshooting Heuristics ##

This section explains basic troubleshooting for failure scenarios in each stage
of app deployment.

### <a id='upload'></a>App fails to upload ###

* Verify that your app does not exceed the maximum size allowed by Cloud
Controller.

* Verify that your network connection is not slow and causing the upload to
time out.
If you are seeing `500` errors, a slow network connection may be at fault.

* If your app contains a large number of files and is failing to upload,
it sometimes helps to push the app repeatedly.
Each push uploads a few more files.
Eventually, all files have uploaded and the push succeeds.

### <a id='detect'></a>Cloud Foundry fails to detect a buildpack ###

* Verify that your app is in a language or framework supported by one of
the three [system buildpacks](../../buildpacks/), or, that you are using the
`-b` option to give `cf push` the location of an appropriate buildpack.

### <a id='compile'></a>App fails to compile ###

* Verify that the amount of memory your app is configured to use is within
the limit specified by the buildpack.

* Verify that your app uses the `PORT` environment variable and does not specify
a port in any other way.

* Verify that your app generally adheres to the principles of the
[Twelve-Factor App](http://12factor.net) and [Prepare to Deploy an Application]
(./prepare-to-deploy.html).
Your app might build in a way that works fine locally but fails in the cloud.
These texts explain the kinds of adjustments that solve this kind of problem.

* Alternatively, sometimes a Cloud Controller problem causes a compile failure.

### <a id='start'></a>App fails to start or scale ###

* Verify that you are pushing the app to a Cloud Foundry app space that has
sufficient memory available for all instances of your app.

* Verify that components within Cloud Foundry can communicate with each other.
Cloud networking issues can cause problems like this.

## <a id='cf-commands'></a>cf Troubleshooting Commands ##

Cloud Foundry's cf command line interface provides commands for investigating
app deployment and health.

Some of these commands may return connection credentials.
Remove credentials and other sensitive information from command
output before you post the output a public forum.

* `cf apps`: Returns a list of the applications deployed to the current space
{'fraction_non_alphanumeric': 0.07650632080118207, 'fraction_numerical': 0.0019701198489574783, 'mean_word_length': 4.5787545787545785, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5552909', 'n_tokens_mistral': 1600, 'n_tokens_neox': 1567, 'n_words': 855}