I’m attempting to deploy a fairly simple Flask app to Heroku’s cedar stack, but I keep seeing the following error:
2012-08-09T22:37:49+00:00 heroku[web.1]: State changed from crashed to starting
2012-08-09T22:37:52+00:00 heroku[web.1]: Starting process with command `gunicorn pytips.app:create_app() -b 0.0.0.0:42152 -w 3`
2012-08-09T22:37:53+00:00 app[web.1]: bash: -c: line 0: syntax error near unexpected token `('
2012-08-09T22:37:53+00:00 app[web.1]: bash: -c: line 0: `gunicorn pytips.app:create_app() -b 0.0.0.0:42152 -w 3'
And I have this as my Procfile:
web: gunicorn pytips.app:create_app() -b 0.0.0.0:$PORT -w 3
When I test this locally by running foreman start, things work just fine. Why is Heroku having problems if foreman is fine with it locally?
UPDATE: I’ve also tried testing with heroku run. Here’s what that yields:
heroku run --app pytips gunicorn pytips.app:create_app() -b 0.0.0.0:$PORT -w 3
gives me nothing.
heroku run --app pytips 'gunicorn pytips.app:create_app() -b 0.0.0.0:$PORT -w 3'
gives me heroku:108: command not found: -b.
My current solution is this: I escape the parentheses, e.g.,
While this totally explodes on my local box, it seems to work just peachy on Heroku’s system. I am still hoping the support team at Heroku can figure out why it works in one place, but not the other. Until then, I will just test locally with the the unescaped version, then put the escapes back before pushing to Heroku.