dmikusa / cf-php-apache-buildpack

CloudFoundry PHP & Apache HTTPD Buildpack
Apache License 2.0
4 stars 11 forks source link

Application failed to stage #3

Closed cringerjs closed 11 years ago

cringerjs commented 11 years ago

When running the command cf push --buildpack=https://github.com/dmikusa-pivotal/cf-php-apache-buildpack.git everything seems to be going fine, but I am given an error that states Checking status of app 'xxxxxxx'...Application failed to stage When browsing the site after that it just shows a 404.

Thinking I was doing something wrong I tried using the php example application cf-ex-php-info but I get the same errors. Any idea why I am getting this error?

dmikusa commented 11 years ago

Not sure what's going on here. I'm able to push the php-info app without any issues. I'd suggest the following to troubleshoot further.

1.) Update the cf utilities. There are frequent new versions and staying on the latest version helps with compatibility. Just run "gem update" to get the latest release. It's 5.2.0 as of me writing this.

2.) Run "cf apps" and check the status of the app. If it's listed as "running" that means the server is up. If that's the case, run "cf files app/httpd/logs/error_log" to check the log for HTTPD. Perhaps there's a problem with the application. If the app is listed as 0%, it means the server is not running. Run "cf crashlogs ", "cf events " and "cf logs ". Best thing is to just include the output here, but you'd be looking through the logs for some kind of error or an exit code in the events list.

dmikusa commented 11 years ago

This is what you should see...

moonraker:Downloads daniel$ git clone git@github.com:dmikusa-pivotal/cf-ex-php-info.git
Cloning into 'cf-ex-php-info'...
remote: Counting objects: 61, done.
remote: Compressing objects: 100% (44/44), done.
remote: Total 61 (delta 22), reused 47 (delta 10)
Receiving objects: 100% (61/61), 143.03 KiB, done.
Resolving deltas: 100% (22/22), done.

moonraker:Downloads daniel$ cd cf-ex-php-info/

moonraker:cf-ex-php-info daniel$ ls
README.md   config      htdocs      lib

moonraker:cf-ex-php-info daniel$ cf push --buildpack=https://github.com/dmikusa-pivotal/cf-php-apache-buildpack.git
Name> php-info

Instances> 1

1: 128M
2: 256M
3: 512M
4: 1G
Memory Limit> 1

Creating php-info... OK

1: php-info
2: none
Subdomain> php-info

1: cfapps.io
2: dans-apps.com
3: none
Domain> cfapps.io

Binding php-info.cfapps.io to php-info... OK

Create services for application?> n

Save configuration?> y

Saving to manifest.yml... OK
Uploading php-info... OK
Preparing to start php-info... OK
-----> Downloaded app package (140K)
Initialized empty Git repository in /tmp/buildpacks/cf-php-apache-buildpack.git/.git/
Custom config found, overriding default options
Configuring HTTPD Version: 2.2.25
Downloading [https://dl.dropboxusercontent.com/u/186123235/binaries/httpd/2.2/httpd-2.2.25-bin.tar.gz]
Downloaded [/tmp/cache/httpd-2.2.25-bin.tar.gz]
Configuring PHP Version: 5.4.18
Downloading [https://dl.dropboxusercontent.com/u/186123235/binaries/php/5.4/php-5.4.18-bin.tar.gz]
Downloaded [/tmp/cache/php-5.4.18-bin.tar.gz]
Found custom php.ini file, installing.
Installing PEAR mod [Crypt_GPG]
Output from install [downloading Crypt_GPG-1.3.2.tar ...
Starting to download Crypt_GPG-1.3.2.tar (Unknown size)
............................................................................................................................................................................................................................done: 1,108,480 bytes
install ok: channel://pear.php.net/Crypt_GPG-1.3.2
]
Installing PEAR mod [Crypt_CBC]
Output from install [downloading Crypt_CBC-1.0.1.tar ...
Starting to download Crypt_CBC-1.0.1.tar (Unknown size)
.....done: 13,312 bytes
install ok: channel://pear.php.net/Crypt_CBC-1.0.1
]
-----> Uploading droplet (36M)
Checking status of app 'php-info'..............
  1 of 1 instances running (1 running)
Push successful! App 'php-info' available at http://php-info.cfapps.io
cringerjs commented 11 years ago

Doesn't seem to be getting the buildpack files

jeremys@ubuntu:~/Projects$ cf -v
cf 5.2.0

jeremys@ubuntu:~/Projects$ git clone git@github.com:dmikusa-pivotal/cf-ex-php-info.git
Cloning into 'cf-ex-php-info'...
remote: Counting objects: 61, done.
remote: Compressing objects: 100% (44/44), done.
remote: Total 61 (delta 22), reused 47 (delta 10)
Receiving objects: 100% (61/61), 143.03 KiB, done.
Resolving deltas: 100% (22/22), done.
jeremys@ubuntu:~/Projects$ cd cf-ex-php-info/
jeremys@ubuntu:~/Projects/cf-ex-php-info$ ls
config  htdocs  lib  README.md
jeremys@ubuntu:~/Projects/cf-ex-php-info$ cf push --buildpack=https://github.com/dmikusa-pivotal/cf-php-apache-buildpack.git

Name> php-info-test

Instances> 1

1: 128M
2: 256M
3: 512M
4: 1G
Memory Limit> 256M

Creating php-info-test... OK

1: php-info-test
2: none
Subdomain> php-info-test

1: cfapps.io
2: none
Domain> cfapps.io

Creating route php-info-test.cfapps.io... OK
Binding php-info-test.cfapps.io to php-info-test... OK

Create services for application?> n

Bind other services to application?> n

Save configuration?> y

Saving to manifest.yml... OK
Uploading php-info-test... OK
Preparing to start php-info-test... OK
Checking status of app 'php-info-test'...Application failed to stage

jeremys@ubuntu:~/Projects/cf-ex-php-info$ cf crashlogs --app php-info-test
No crashed instances found.

jeremys@ubuntu:~/Projects/cf-ex-php-info$ cf events --app php-info-test
Using manifest file manifest.yml

Getting events for php-info-test... OK

time   instance index   description   exit status
jeremys@ubuntu:~/Projects/cf-ex-php-info$ cf logs --app php-info-test
Using manifest file manifest.yml

Application failed to stage
cat ~/.cf/crash # for more details

jeremys@ubuntu:~/Projects/cf-ex-php-info$ cat ~/.cf/crash
Time of crash:
  2013-08-24 17:55:33 -0700

CFoundry::StagingError: 170001: Staging error: cannot get instances since staging failed

<<<
REQUEST: GET https://api.run.pivotal.io/v2/apps/3cf480f0-32a2-4ea5-b3f7-7c3f7cfecb09/instances
REQUEST_HEADERS:
  Accept : application/json
  Authorization : [PRIVATE DATA HIDDEN]
  Content-Length : 0
RESPONSE: [400]
RESPONSE_HEADERS:
  connection : keep-alive
  content-length : 89
  content-type : application/json;charset=utf-8
  date : Sun, 25 Aug 2013 00:55:33 GMT
  server : nginx
  x-content-type-options : nosniff
  x-vcap-request-id : 7f479a83-920d-4b4f-8f61-2ca4be6c61f3
RESPONSE_BODY:
{
  "code": 170001,
  "description": "Staging error: cannot get instances since staging failed"
}
>>>

cfoundry-4.3.5/lib/cfoundry/baseclient.rb:169:in `handle_error_response'
cfoundry-4.3.5/lib/cfoundry/baseclient.rb:148:in `handle_response'
cfoundry-4.3.5/lib/cfoundry/baseclient.rb:89:in `request'
cfoundry-4.3.5/lib/cfoundry/baseclient.rb:66:in `get'
cfoundry-4.3.5/lib/cfoundry/v2/base.rb:54:in `instances'
cfoundry-4.3.5/lib/cfoundry/v2/app.rb:55:in `instances'
cf-5.2.0/lib/cf/cli/app/logs.rb:19:in `logs'
mothership-0.5.1/lib/mothership/base.rb:66:in `run'
mothership-0.5.1/lib/mothership/command.rb:72:in `block in invoke'
cf-5.2.0/lib/manifests/plugin.rb:60:in `call'
cf-5.2.0/lib/manifests/plugin.rb:60:in `block in wrap_with_optional_name'
cf-5.2.0/lib/manifests/plugin.rb:58:in `each'
cf-5.2.0/lib/manifests/plugin.rb:58:in `with_index'
cf-5.2.0/lib/manifests/plugin.rb:58:in `wrap_with_optional_name'
cf-5.2.0/lib/manifests/plugin.rb:11:in `block in default_to_app_from_manifest'
mothership-0.5.1/lib/mothership/command.rb:82:in `instance_exec'
mothership-0.5.1/lib/mothership/command.rb:82:in `block (2 levels) in invoke'
mothership-0.5.1/lib/mothership/command.rb:86:in `instance_exec'
mothership-0.5.1/lib/mothership/command.rb:86:in `invoke'
mothership-0.5.1/lib/mothership/base.rb:55:in `execute'
cf-5.2.0/lib/cf/cli.rb:187:in `block (2 levels) in execute'
cf-5.2.0/lib/cf/cli.rb:198:in `save_token_if_it_changes'
cf-5.2.0/lib/cf/cli.rb:186:in `block in execute'
cf-5.2.0/lib/cf/cli.rb:122:in `wrap_errors'
cf-5.2.0/lib/cf/cli.rb:182:in `execute'
mothership-0.5.1/lib/mothership.rb:45:in `start'
cf-5.2.0/bin/cf:16:in `<top (required)>'
/home/jeremys/.rbenv/versions/2.0.0-p247/bin/cf:23:in `load'
/home/jeremys/.rbenv/versions/2.0.0-p247/bin/cf:23:in `<main>'
dmikusa commented 11 years ago

With the error that you're showing, I don't believe the build pack has even started running.

Preparing to start php-info-test... OK
Checking status of app 'php-info-test'...Application failed to stage

It's going right from "Preparing to start" to "Checking status...". You should see the build pack running between these two steps.

Suggestions:

  1. Delete your app. "cf delete php-info-test". Run "cf apps", make sure the app you are pushing does not exist.
  2. Delete the manifest.yml file.
  3. Run "cf push --buildpack=https://github.com/dmikusa-pivotal/cf-php-apache-buildpack.git"

This will give you a fresh environment to push the app.

Also, as a note. There were some system outages with Pivotal's Hosted CF environment on Sun. See here.

cringerjs commented 11 years ago

I'm going to blame the outage because now everything is working as intended.