Search code examples
scalaherokudeploymentscala-2.10playframework-2.2

Scala Play 2.2 application crashes after deploying in Heroku: target/start No such file or directory


I've been fighting with this for hours and I can't figure out why after deploying my Scala Play 2.2 application in Heroku I get this stacktrace:

2013-09-30T01:05:09.413177+00:00 heroku[web.1]: Starting process with command `target/start -Dhttp.port=18174 $PLAY_OPTS`
2013-09-30T01:05:10.931893+00:00 app[web.1]: bash: target/start: No such file or directory
2013-09-30T01:05:12.382399+00:00 heroku[web.1]: Process exited with status 127
2013-09-30T01:05:12.414050+00:00 heroku[web.1]: State changed from starting to crashed

I've tried several Procfile versions with no success, some examples are:

web: target/start -Dhttp.port=$PORT

web: target/start -Dhttp.port=$PORT $PLAY_OPTS

web: target/start -Dhttp.port=$PORT $JAVA_OPTS

web: target/start Web -Dhttp.port=$PORT $PLAY_OPTS

web: target/start -Dhttp.port=$PORT $PLAY_OPTS -Dconfig.file=application.conf

web: target/start -Dhttp.port=$PORT $PLAY_OPTS -Dconfig.file=conf/application.conf

I even tried using no Procfile.

I'm using Scala 2.10.2 and Play 2.2. In the same Heroku application I had a previous version of my project running on Play 2.0, I don't know if that is related.

The application works perfect locally. I connected to the bash in Heroku and run

sbt clean
sbt stage

by hand and I checked that the target gets cleaned and built again.

What does the "target/start: No such file or directory" refer to? To the target? To the start command? To something else?


Solution

  • Play 2.2 changed the name and location of the file used to start your app

    http://www.playframework.com/documentation/2.2.x/Production

    For example, to start an application of the project ‘foo’ from the project folder, update your Procfile to run:

    target/universal/stage/bin/foo