title: CF_STAGING_TIMEOUT for deploying Shiny app on Bluemix with Cloud Foundry
body: <p>I have a Shiny app that runs as expected locally, and I am working to deploy it to Bluemix using Cloud Foundry. I am using <a href="https://github.com/beibeiyang/cf-buildpack-r" rel="nofollow noreferrer">this buildpack</a>.</p>
  
  <p>The default staging time for apps to build is 15 minutes, but that is not long enough to install R and the packages needed for my app. If I try to push my app with the defaults, I get an error about running out of time:</p>
  
  <pre><code>Error restarting application: sherlock-topics failed to stage within 15.000000 minutes
  </code></pre>
  
  <p>I changed my <code>manifest.yml</code> to increase the staging time:</p>
  
  <pre><code>applications:  
  - name: sherlock-topics
    memory: 728M
    instances: 1
    buildpack: git://github.com/beibeiyang/cf-buildpack-r.git
    env:
      CRAN_MIRROR: https://cran.rstudio.com
      CF_STAGING_TIMEOUT: 45
      CF_STARTUP_TIMEOUT: 9999
  </code></pre>
  
  <p>Then I also changed the staging time for the CLI before pushing:</p>
  
  <pre><code>cf set-env sherlock-topics CF_STAGING_TIMEOUT 45
  cf push sherlock-topics
  </code></pre>
  
  <p>What happens then is that the app tries to deploy. It installs R in the container and installs packages, but only for about 15 minutes (a little longer). When it gets to the first new task (package) after the 15 minute mark, it errors but with a different, sadly uninformative error message.</p>
  
  <pre><code>Staging failed
  Destroying container
  Successfully destroyed container
  
  FAILED
  Error restarting application: StagingError
  </code></pre>
  
  <p>There is nothing in the logs but info about the libraries being installed and then <code>Staging failed</code>.</p>
  
  <p>Any ideas about why it isn't continuing to stage past the 15-minute mark, even after I increase <code>CF_STAGING_TIMEOUT</code>? </p>