2

I've deployed my app to Heroku and am getting the following error in the logs upon loading the page:

2016-12-09T22:47:56.020392+00:00 heroku[slug-compiler]: Slug compilation started
2016-12-09T22:47:56.020401+00:00 heroku[slug-compiler]: Slug compilation finished
2016-12-09T22:47:56.001478+00:00 heroku[web.1]: State changed from crashed to starting
2016-12-09T22:48:00.770182+00:00 heroku[web.1]: Starting process with command `gunicorn surfspots.wsgi --log-file -`
2016-12-09T22:48:03.282956+00:00 heroku[web.1]: Process exited with status 127
2016-12-09T22:48:03.180446+00:00 app[web.1]: bash: gunicorn: command not found
2016-12-09T22:48:03.300446+00:00 heroku[web.1]: State changed from starting to crashed

I am running Python 3.5.2:

$ cat runtime.txt 
python-3.5.2

The name of my Django project is 'surfspots':

$ cat Procfile 
web: gunicorn surfspots.wsgi --log-file -

For this person, they received the same issue and solved it because they had not installed gunicorn.

However, I do have gunicorn installed in my requirements.txt, using "pip install gunicorn"

Here is my requirements.txt file:

$ cat requirements.txt
boto==2.43.0
click==6.6
click-plugins==1.0.3
cligj==0.4.0
descartes==1.0.2
dj-database-url==0.4.1
Django==1.10.4
django-bootstrap3==7.1.0
django-geojson==2.9.1
django-leaflet==0.19.0
django-storages==1.5.1
django-tables2==1.2.6
django-widget-tweaks==1.4.1
Fiona==1.7.1
GeoAlchemy2==0.4.0
gunicorn==19.6.0
jsonfield==1.0.3
munch==2.0.4
numpy==1.11.2
pandas==0.19.1
psycopg2==2.6.2
pyproj==1.9.5.1
python-dateutil==2.6.0
pytz==2016.7
requests==2.12.3
six==1.10.0
SQLAlchemy==1.1.4

This is the directory structure for my Django project:

$ tree . -L 2
.
├── locations
│   ├── admin.py
│   ├── apps.py
│   ├── data
│   ├── __init__.py
│   ├── migrations
│   ├── models.py
│   ├── __pycache__
│   ├── static
│   ├── templates
│   ├── tests.py
│   └── views.py
├── manage.py
├── Procfile
├── README.md
├── requirements.txt
├── runtime.txt
├── surfspots
│   ├── __init__.py
│   ├── __pycache__
│   ├── settings.py
│   ├── urls.py
│   └── wsgi.py
└── venv
    ├── bin
    ├── include
    ├── lib
    └── pip-selfcheck.json

Any tips? Thank you!

Community
  • 1
  • 1
briangoodness
  • 69
  • 1
  • 6
  • Which python version is specified in `runtime.txt` file? – Eugene Lisitsky Dec 09 '16 at 23:05
  • Is gunicon installed just for your user, or system wide? Return code of 127 from bash means means that it can't find a path to that executable - make sure it's in the Heroku user's PATH. (See here for context: http://stackoverflow.com/a/1763178/3276583) – nikobelia Dec 09 '16 at 23:50
  • Is that requirements.txt committed to git? And can you show your file structure? – Daniel Roseman Dec 10 '16 at 09:48
  • thank you @EugeneLisitsky! I am running Python 3.5.2 -- added that to my original post. And yes, I did specify the Python version in my runtime.txt fie – briangoodness Dec 10 '16 at 23:34
  • thank you @DanielRoseman! yes, the requirements.txt file is committed to git. I added my file structure to my original post. – briangoodness Dec 10 '16 at 23:35
  • thank you @nikobelia! I am not sure how to check where gunicorn is installed for the system? I am running my code from Heroku. Locally, it runs fine, just not on the live Heroku server. Are you able to point me how to check this using the Heroku CLI? – briangoodness Dec 10 '16 at 23:37

1 Answers1

1

Strangely, my Heroku build could not access gunicorn. However, I just saw an answer in this post that suggested that I uninstall all requirements remotely, and reinstall them. This happened to work for me! Thank you all for your prompt replies, much appreciated.

Community
  • 1
  • 1
briangoodness
  • 69
  • 1
  • 6