0
votes

Im trying to deploy an app using cloud foundry an im getting this error and the app is crashing. i've tried to change the buildpack but nothing happens.

I don't know how to get more errors.

cf logs returns this log

     OUT Submodule 'compile-extensions' (https://github.com/cloudfoundry/compile-extensions.git) registered for path 'compile-extensions'
2017-02-25T11:08:59.56-0300 [STG/0]      ERR Cloning into 'compile-extensions'...
2017-02-25T11:09:00.23-0300 [STG/0]      OUT Submodule path 'compile-extensions': checked out 'a76a1ecab87f514248222e50fdc9f46c37078109'
2017-02-25T11:09:00.39-0300 [STG/0]      OUT -------> Buildpack version 1.5.15
2017-02-25T11:09:13.34-0300 [STG/0]      OUT      $ pip install -r requirements.txt
2017-02-25T11:09:48.99-0300 [STG/16]     OUT -----> Uploading droplet (159M)
2017-02-25T11:10:16.77-0300 [DEA/16]     OUT Starting app instance (index 0) with guid a627703f-3fc8-48a2-869c-572b2abec573
2017-02-25T11:10:26.87-0300 [API/0]      OUT App instance exited with guid a627703f-3fc8-48a2-869c-572b2abec573 payload: {"cc_partition"=>"default", "droplet"=>"a627703f-3fc8-48a2-869c-572b2abec573", "version"=>"3ead9c26-4535-4dbd-b3ce-d21483bae661", "instance"=>"cb6eda1feaf647aead2e9ef6c2d435b6", "index"=>0, "reason"=>"CRASHED", "exit_status"=>-1, "exit_description"=>"failed to start", "crash_timestamp"=>1488031826}

my manifest.yml is this

---
applications:
- name: cs
  instances: 1
  command: bash run.sh
  memory: 200M
  disk_quota: 256M
  random-route: false 
  buildpack: https://github.com/cloudfoundry/python-buildpack.git

my Procfile has this line

web: python cs/manage.py migrate && python cs/manage.py runserver 0.0.0.0:$PORT --noreload

and the run.sh has

#!/bin/bash
if [ -z "$VCAP_APP_PORT" ];
then SERVER_PORT=5000;
else SERVER_PORT="$VCAP_APP_PORT";
fi

python manage.py makemigrations
python manage.py migrate

echo [$0] Starting Django Server...
python cs/manage.py runserver --noreload 0.0.0.0:$SERVER_PORT

The same app it's deployed on heroku without any problem so i cannot understand the difference between heroku on cf.

1
a.) Your Procfile isn't doing anything. Setting command in your manifest.yml will override what's in Procfile. For clarity, you should pick one or the other. b.) Staging appears to be fine. pip isn't installing anything, but it's all running without error. c.) Your app is failing to start. It's exiting with exit code -1. Sorry but can't tell you more than that. Add some echo statements to your run.sh script and bump up the log level in your app. - Daniel Mikusa

1 Answers

0
votes

You can enable debug with "export CF_TRACE=true" and explore your droplet with cf download plugin - more on http://blog.ibmjstart.net/2015/05/22/cf-download/