anchor.diff:  Start unsuccessful
   </pre>
   
  -If this happens, try the following:
  -
  -  * **Find the reason app is failing and modify your code.**
  -    Run `cf events APP-NAME` and `cf logs APP-NAME --recent` and look for
  -messages similar to this:
  +If this happens:
  +
  +* **Find the reason app is failing and modify your code.** Run `cf events APP-NAME` and `cf logs APP-NAME --recent` and look for messages similar to this:
     <pre class="terminal">
     2018-07-20T15:53:26.00-0700   app.crash                  app-name   index: 2, reason: CRASHED, cell\_id: d874ad05-d0ca-4c63-9f5a-0b1ddd90dd5d, instance: f406c53e-b1ca-4a0f-6140-dddd, exit\_description: APP/PROC/WEB: Exited with status 1
     </pre>
  -  These messages may identify a memory or port issue.
  -  If they do, take that as a starting point when you re-examine and fix your
  -app code.
  -
  -  * **Make sure your app code uses the `PORT` environment variable.**
  -Your app may be failing because it is listening on the wrong port.
  -Instead of hard coding the port on which your app listens, use the `PORT` environment variable.
  -
  -    For example, this Ruby snippet assigns the port value to the `listen_here`
  -variable:
  +  These messages may identify a memory or port issue. If they do, take that as a starting point when you re-examine and fix your app code.
  +
  +* **Make sure your app code uses the `PORT` environment variable.** Your app may be failing because it is listening on the wrong port. Instead of hard coding the port on which your app listens, use the `PORT` environment variable.
  +
  +For example, this Ruby snippet assigns the port value to the `listen_here` variable:
        `listen_here = ENV['PORT']`
   
  -    For more examples specific to your app framework, see the
  -appropriate [buildpacks documentation](../../buildpacks/) for your app's language.
  -
  -  * **Make sure your app adheres to the principles of the
  -[Twelve-Factor App](http://12factor.net) and [Prepare to Deploy an App]
  -(./prepare-to-deploy.html).**
  -These texts explain how to prevent situations where your app builds locally but
  -fails to build in the cloud.
  -
  -  * **Verify the timeout configuration of your app.** App health checks use a timeout setting when an app starts up for the first time. See [Using Application Health Checks](./healthchecks.html). If an app fails to start up due to health check timeout, you might see messages in the logs similar to the following:
  +For more examples specific to your app framework, see the appropriate [buildpacks documentation](../../buildpacks/) for your app's language.
  +
  +* **Make sure your app adheres to the principles of the [Twelve-Factor App](http://12factor.net) and [Prepare to Deploy an App](./prepare-to-deploy.html).** These texts explain how to prevent situations where your app builds locally but fails to build in the cloud.
  +
  +* **Verify the timeout configuration of your app.** App health checks use a timeout setting when an app starts up for the first time. See [Using App Health Checks](./healthchecks.html). If an app fails to start up due to health check timeout, you might see messages in the logs similar to the following:
       <pre class="terminal">
     2017-01-30T14:07:20.39-0800 [CELL/0]     OUT Creating container
   2017-01-30T14:07:20.65-0800 [CELL/0]     OUT Successfully created container
  
positive.code: ---
  title: Troubleshooting app Deployment and Health
  owner:
    - Routing
    - Release Integration
  ---
  
  
  
  <% $this_topic = 'troubleshoot-app-health' %>
  
  Refer to this topic for help diagnosing and resolving common issues when you deploy and run apps on Cloud Foundry.
  
  ## <a id='scenarios'></a>Common Issues ##
  
  The following sections describe common issues you might encounter when attempting to deploy and run your app, and possible resolutions.
  
  ### <a id='time'></a>cf push Times Out ###
  
  If your deployment times out during the upload or staging phase, you may receive one of the following error messages:
  
  
negative.code:  my-drain: http://drain.example.com
  </pre>
  
  ### <a id='logs'></a> View Logs
  
  To view app logs streamed in real-time, use the `cf logs APP-NAME` command.
  
  To aggregate your app logs to view log history, bind your app to a syslog drain service. For more information, see [Streaming app Logs to Log Management Services](./../services/log-management.html).
  
  <p class="note"><strong>Note:</strong> The Diego architecture does not support the <code>cf files</code> command.</p>
  
  ### <a id='trace'></a> Trace Cloud Controller REST API Calls
  
  If a command fails or produces unexpected results, re-run it with HTTP tracing enabled to view requests and responses between the Cloud Foundry Command Line Interface (cf CLI) and the Cloud Controller REST API.
  
  For example:
  
  