How to deploy react-native-web app into heroku? - heroku

I am trying to use react-native-web in my college project.
I've following steps here and successfully create a dev version of react-native-web app. I want to deploy my app onto Heroku, after searching many questions, I still can't run my app on Heroku. It always crashed after 60 seconds after starting.
2018-02-24T19:19:44.376383+00:00 heroku[web.1]: Starting process with command `./node_modules/.bin/webpack-dev-server --inline --port 28330`
2018-02-24T19:19:49.667640+00:00 app[web.1]: Project is running at [1m[34mhttp://localhost:28330/[39m[22m
2018-02-24T19:19:49.668544+00:00 app[web.1]: webpack output is served from [1m[34m/[39m[22m
2018-02-24T19:20:02.082843+00:00 app[web.1]: Hash: [1m070ba25084e72482b7f3[39m[22m
2018-02-24T19:20:02.082868+00:00 app[web.1]: Version: webpack [1m3.11.0[39m[22m
2018-02-24T19:20:02.082871+00:00 app[web.1]: Time: [1m11923[39m[22mms
2018-02-24T19:20:02.082873+00:00 app[web.1]: [1mAsset[39m[22m [1mSize[39m[22m [1mChunks[39m[22m [1m[39m[22m [1m[39m[22m [1mChunk Names[39m[22m
2018-02-24T19:20:02.082874+00:00 app[web.1]: [1m[33mbundle.js[39m[22m [1m[33m2.35 MB[39m[22m [1m0[39m[22m [1m[32m[emitted][39m[22m [1m[33m[big][39m[22m main
2018-02-24T19:20:02.082877+00:00 app[web.1]: [2] [1m./node_modules/react/index.js[39m[22m 190 bytes {[1m[33m0[39m[22m}[1m[32m [built][39m[22m
2018-02-24T19:20:02.082878+00:00 app[web.1]: [65] [1m./node_modules/react-native-web/dist/index.js[39m[22m 12.9 kB {[1m[33m0[39m[22m}[1m[32m [built][39m[22m
2018-02-24T19:20:02.082880+00:00 app[web.1]: [122] [1mmulti (webpack)-dev-server/client?http://localhost:28330 ./index.web.js[39m[22m 40 bytes {[1m[33m0[39m[22m}[1m[32m [built][39m[22m
2018-02-24T19:20:02.082882+00:00 app[web.1]: [123] [1m(webpack)-dev-server/client?http://localhost:28330[39m[22m 7.91 kB {[1m[33m0[39m[22m}[1m[32m [built][39m[22m
2018-02-24T19:20:02.082884+00:00 app[web.1]: [124] [1m./node_modules/url/url.js[39m[22m 23.3 kB {[1m[33m0[39m[22m}[1m[32m [built][39m[22m
2018-02-24T19:20:02.082885+00:00 app[web.1]: [131] [1m./node_modules/strip-ansi/index.js[39m[22m 161 bytes {[1m[33m0[39m[22m}[1m[32m [built][39m[22m
2018-02-24T19:20:02.082887+00:00 app[web.1]: [133] [1m./node_modules/loglevel/lib/loglevel.js[39m[22m 7.86 kB {[1m[33m0[39m[22m}[1m[32m [built][39m[22m
2018-02-24T19:20:02.082889+00:00 app[web.1]: [134] [1m(webpack)-dev-server/client/socket.js[39m[22m 1.08 kB {[1m[33m0[39m[22m}[1m[32m [built][39m[22m
2018-02-24T19:20:02.082890+00:00 app[web.1]: [136] [1m(webpack)-dev-server/client/overlay.js[39m[22m 3.67 kB {[1m[33m0[39m[22m}[1m[32m [built][39m[22m
2018-02-24T19:20:02.082892+00:00 app[web.1]: [141] [1m(webpack)/hot nonrecursive ^\.\/log$[39m[22m 170 bytes {[1m[33m0[39m[22m}[1m[32m [built][39m[22m
2018-02-24T19:20:02.082893+00:00 app[web.1]: [143] [1m(webpack)/hot/emitter.js[39m[22m 77 bytes {[1m[33m0[39m[22m}[1m[32m [built][39m[22m
2018-02-24T19:20:02.082895+00:00 app[web.1]: [145] [1m./index.web.js[39m[22m 380 bytes {[1m[33m0[39m[22m}[1m[32m [built][39m[22m
2018-02-24T19:20:02.082897+00:00 app[web.1]: [243] [1m./node_modules/react-native-web/dist/exports/Vibration/index.js[39m[22m 796 bytes {[1m[33m0[39m[22m}[1m[32m [built][39m[22m
2018-02-24T19:20:02.082899+00:00 app[web.1]: [283] [1m./node_modules/react-native-web/dist/exports/VirtualizedList/index.js[39m[22m 327 bytes {[1m[33m0[39m[22m}[1m[32m [built][39m[22m
2018-02-24T19:20:02.082901+00:00 app[web.1]: [285] [1m./App.js[39m[22m 2.53 kB {[1m[33m0[39m[22m}[1m[32m [built][39m[22m
2018-02-24T19:20:02.082903+00:00 app[web.1]: + 271 hidden modules
2018-02-24T19:20:02.082911+00:00 app[web.1]: webpack: Compiled successfully.
2018-02-24T19:20:21.276101+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2018-02-24T19:20:21.276101+00:00 heroku[web.1]: Stopping process with SIGKILL
2018-02-24T19:20:21.364850+00:00 heroku[web.1]: Process exited with status 137
2018-02-24T19:20:44.673361+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2018-02-24T19:20:44.673652+00:00 heroku[web.1]: Stopping process with SIGKILL
2018-02-24T19:20:44.812657+00:00 heroku[web.1]: Process exited with status 137
2018-02-24T19:20:44.892098+00:00 heroku[web.1]: State changed from starting to crashed
Is there anyone who can show me the steps to deploy my react-native-web into Heroku?
Thanks.

You're trying to run the webpack-dev-server in a production environment, which is not recommended.
You will need to:
Setup a production webpack build script in npm/yarn so that your browser side code gets built (usually output to a 'build' or 'dist' directory). There should be instructions for on Heroku (see here) so it knows which script to run to build this on the server after the server checks out your master branch.
Setup a minimal server script that is loaded via a 'start' script. Try ExpressJs for this. Note that Heroku creates a PORT environment variable (process.env.PORT) that contains the assigned HTTP port to use for the HTTP server (pass it to express.listen). Heroku have a minimal Express server example to look at.

Related

Heroku: This site can’t be reached

My heroku app cannot be accessed after a build. The logs show that the web server node and worker node both are listening.
It's a flask app run by gunicorn and it has 2 addons - newrelic and redistogo.
Error:
This site can’t be reached.
appname.herokuapp.com’s server IP address could not be found.
DNS_PROBE_FINISHED_NXDOMAIN
Logs:
```2020-02-05T16:24:31.556201+00:00 heroku[worker.1]: Starting process with command `python worker.py`
2020-02-05T16:24:32.278863+00:00 heroku[worker.1]: State changed from starting to up
2020-02-05T16:24:33.363132+00:00 app[worker.1]: 16:24:33 RQ worker started, version 0.5.1
2020-02-05T16:24:33.364484+00:00 app[worker.1]: 16:24:33
2020-02-05T16:24:33.364574+00:00 app[worker.1]: 16:24:33 *** Listening on high, default, low...
2020-02-05T16:24:35.295791+00:00 heroku[web.1]: Starting process with command `newrelic-admin run-program gunicorn app:server`
2020-02-05T16:24:41.159117+00:00 heroku[web.1]: State changed from starting to up
2020-02-05T16:24:40.959907+00:00 app[web.1]: [2020-02-05 16:24:40 +0000] [4] [INFO] Starting gunicorn 20.0.4
2020-02-05T16:24:40.961836+00:00 app[web.1]: [2020-02-05 16:24:40 +0000] [4] [INFO] Listening at: http://0.0.0.0:21126 (4)
2020-02-05T16:24:40.962097+00:00 app[web.1]: [2020-02-05 16:24:40 +0000] [4] [INFO] Using worker: sync
2020-02-05T16:24:40.971809+00:00 app[web.1]: [2020-02-05 16:24:40 +0000] [12] [INFO] Booting worker with pid: 12
2020-02-05T16:24:41.143051+00:00 app[web.1]: [2020-02-05 16:24:41 +0000] [20] [INFO] Booting worker with pid: 20```
EDIT:
Procfile:
web: newrelic-admin run-program gunicorn app:server
worker: python worker.py
Worker:
import os
import redis
from rq import Worker, Queue, Connection
listen = ['high', 'default', 'low']
redis_url = os.getenv('REDISTOGO_URL', 'redis://localhost:6379')
conn = redis.from_url(redis_url)
if __name__ == '__main__':
with Connection(conn):
worker = Worker(list(map(Queue, listen)))
worker.work()
The app is accessible now. It seems to be downtime with Heroku. Although they haven't reported this in their status page.

pushing keras with tensorflow backend crashes in heroku

I've a flask app and it works fine on my local system. It has keras with tensorflow backend and it runs on python 3.6.
When I push my code to heroku. It starts downloading this file which never happens on my local system and it crashes.:
Downloading data from https://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg16_weights_tf_dim_ordering_tf_kernels.h5
I'm guessing it is memory/timeout error. I'm using free heroku account for this.
How can I get it to work on heroku?
Error Log:
Starting process with command `gunicorn app:app --timeout 300`
[INFO] Starting gunicorn 19.7.1
[2017-10-09 14:04:25 +0000] [4] [INFO] Listening at: http://0.0.0.0:50169 (4)
2017-10-09T14:04:25.367668+00:00 app[web.1]: [2017-10-09 14:04:25 +0000] [4] [INFO] Using worker: sync
2017-10-09T14:04:25.372148+00:00 app[web.1]: [2017-10-09 14:04:25 +0000] [8] [INFO] Booting worker with pid: 8
2017-10-09T14:04:25.479248+00:00 app[web.1]: [2017-10-09 14:04:25 +0000] [16] [INFO] Booting worker with pid: 16
2017-10-09T14:04:26.136655+00:00 heroku[web.1]: State changed from starting to up
2017-10-09T14:04:26.745551+00:00 app[web.1]: Using TensorFlow backend.
2017-10-09T14:04:26.749705+00:00 app[web.1]: Using TensorFlow backend.
2017-10-09T14:04:50.593444+00:00 app[web.1]: Downloading data from https://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg16_weights_tf_dim_ordering_tf_kernels.h5
2017-10-09T14:04:50.660642+00:00 app[web.1]: Downloading data from https://github.com/fchollet/deep-learning-models/releases/download/v0.1/vgg16_weights_tf_dim_ordering_tf_kernels.h5
2017-10-09T14:04:57.914283+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=example.herokuapp.com request_id=b2aeff63-6d72-48e3-a2be-1d3e2344752b fwd="103.224.37.6" dyno=web.1 connect=1ms service=30001ms status=503 bytes=0 protocol=https
2017-10-09T14:05:30.595619+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/favicon.ico" host=example.herokuapp.com request_id=af073356-f635-46fe-90bd-8527ef13092b fwd="103.224.37.6" dyno=web.1 connect=3ms service=30000ms status=503 bytes=0 protocol=https
2017-10-09T14:05:31.976163+00:00 app[web.1]:
2017-10-09T14:05:31.976163+00:00 app[web.1]: ...........................] - ETA: 24s
2017-10-09T14:05:31.976163+00:00 app[web.1]:
==>..........................] - ETA: 27s
2017-10-09T14:05:31.976163+00:00 app[web.1]: =====>........................] - ETA: 22s109109248/553467096 [====>.........................] - ETA: 27s
2017-10-09T14:05:31.976163+00:00 app[web.1]: - ETA: 21s
......] - ETA: 22s
2017-10-09T14:05:31.976163+00:00 app[web.1]: [=========>....................] - ETA: 22s
2017-10-09T14:05:31.976163+00:00 app[web.1]:
096 [===========>..................] - ETA: 21s
2017-10-09T14:05:31.976163+00:00 app[web.1]:
............] - ETA: 15s
2017-10-09T14:05:31.976163+00:00 app[web.1]: ....] - ETA: 14s
>.............] - ETA: 13s
2017-10-09T14:05:31.976163+00:00 app[web.1]: 67096 [==================>...........] - ETA: 11s
2017-10-09T14:05:31.976163+00:00 app[web.1]:
..] - ETA: 12s
.......] - ETA: 10s
2017-10-09T14:05:31.976163+00:00 app[web.1]: ====>.......] - ETA: 6s
=====>.....] - ETA: 4s
2017-10-09T14:05:31.976163+00:00 app[web.1]: ============>.......] - ETA: 7s
2017-10-09T14:05:31.976163+00:00 app[web.1]: =================>..] - ETA: 1s
tions.
2017-10-09T14:05:31.976186+00:00 app[web.1]: 2017-10-09 14:05:31.976043: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-10-09T14:05:31.976187+00:00 app[web.1]: 2017-10-09 14:05:31.976055: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-10-09T14:05:32.031285+00:00 app[web.1]: 2017-10-09 14:05:32.031191: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-10-09T14:05:32.031292+00:00 app[web.1]: 2017-10-09 14:05:32.031257: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-10-09T14:05:32.031293+00:00 app[web.1]: 2017-10-09 14:05:32.031276: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-10-09T14:05:32.443446+00:00 app[web.1]: [2017-10-09 14:05:32 +0000] [58] [INFO] Booting worker with pid: 58
2017-10-09T14:05:32.991979+00:00 app[web.1]: Using TensorFlow backend.
2017-10-09T14:05:35.819169+00:00 heroku[web.1]: Process running mem=908M(177.5%)
2017-10-09T14:05:35.819247+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2017-10-09T14:05:48.065459+00:00 app[web.1]: [2017-10-09 14:05:48 +0000] [67] [INFO] Booting worker with pid: 67
2017-10-09T14:05:48.130754+00:00 app[web.1]: [2017-10-09 14:05:48 +0000] [68] [INFO] Booting worker with pid: 68
2017-10-09T14:05:48.499120+00:00 app[web.1]: Using TensorFlow backend.
2017-10-09T14:05:48.528333+00:00 app[web.1]: Using TensorFlow backend.
2017-10-09T14:06:12.730309+00:00 app[web.1]: 2017-10-09 14:06:12.730203: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-10-09T14:06:12.730319+00:00 app[web.1]: 2017-10-09 14:06:12.730287: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-10-09T14:06:12.730340+00:00 app[web.1]: 2017-10-09 14:06:12.730308: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-10-09T14:06:12.745697+00:00 app[web.1]: 2017-10-09 14:06:12.745605: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-10-09T14:06:12.745703+00:00 app[web.1]: 2017-10-09 14:06:12.745674: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-10-09T14:06:12.745704+00:00 app[web.1]: 2017-10-09 14:06:12.745686: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-10-09T14:06:13.221496+00:00 app[web.1]: [2017-10-09 14:06:13 +0000] [117] [INFO] Booting worker with pid: 117
2017-10-09T14:06:15.851825+00:00 heroku[web.1]: Process running mem=912M(178.3%)
2017-10-09T14:06:15.851966+00:00 heroku[web.1]: Error R14 (Memory quota exceeded)
2017-10-09T14:06:17.618828+00:00 app[web.1]: Using TensorFlow backend.
2017-10-09T14:06:24.973806+00:00 app[web.1]: [2017-10-09 14:06:24 +0000] [126] [INFO] Booting worker with pid: 126
2017-10-09T14:06:25.464279+00:00 app[web.1]: Using TensorFlow backend.
2017-10-09T14:06:55.977804+00:00 app[web.1]: 2017-10-09 14:06:55.977280: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-10-09T14:06:55.977817+00:00 app[web.1]: 2017-10-09 14:06:55.977783: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-10-09T14:06:55.977833+00:00 app[web.1]: 2017-10-09 14:06:55.977807: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-10-09T14:06:56.343185+00:00 heroku[web.1]: Process running mem=1111M(217.1%)
2017-10-09T14:06:56.343268+00:00 heroku[web.1]: Error R15 (Memory quota vastly exceeded)
2017-10-09T14:06:56.343377+00:00 heroku[web.1]: Stopping process with SIGKILL
2017-10-09T14:06:56.778935+00:00 heroku[web.1]: State changed from up to crashed
2017-10-09T14:06:56.763085+00:00 heroku[web.1]: Process exited with status 137

Flask app on heroku

I have an issue making my flask app working on heroku.
I'm using a simple flask app along flask-sqlalchemy
I didin't find anything specific on my problem altough I think I understand but can't figure it out how to make it work.
Here is the requirements.txt content:
alembic==0.9.2
click==6.7
Flask==0.12.2
Flask-Migrate==2.0.4
Flask-Script==2.0.5
Flask-SQLAlchemy==2.2
Flask-WTF==0.14.2
gunicorn==19.7.1
itsdangerous==0.24
Jinja2==2.9.6
Mako==1.0.6
MarkupSafe==1.0
python-dateutil==2.6.0
python-editor==1.0.3
six==1.10.0
SQLAlchemy==1.1.10
Werkzeug==0.12.2
WTForms==2.1
Here is the Procfile content:
web: gunicorn main:app
Here is the output of log files in heroku dashboard
2017-06-03T06:59:24.005560+00:00 app[web.1]: return __import__('MySQLdb')
2017-06-03T06:59:24.005561+00:00 app[web.1]: ImportError: No module named MySQLdb
2017-06-03T06:59:24.769740+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=aqueous-spire-85572.herokuapp.com request_id=965e64b9-20f0-4aa0-8a71-d564068a5c70 fwd="31.5.203.202" dyno=web.1 connect=1ms service=16ms status=404 bytes=386 protocol=https
2017-06-03T07:32:46.321187+00:00 heroku[web.1]: Idling
2017-06-03T07:32:46.321726+00:00 heroku[web.1]: State changed from up to down
2017-06-03T07:32:47.062599+00:00 app[web.1]: [2017-06-03 07:32:47 +0000] [4] [INFO] Handling signal: term
2017-06-03T07:32:47.062699+00:00 app[web.1]: [2017-06-03 07:32:47 +0000] [10] [INFO] Worker exiting (pid: 10)
2017-06-03T07:32:47.063539+00:00 app[web.1]: [2017-06-03 07:32:47 +0000] [9] [INFO] Worker exiting (pid: 9)
2017-06-03T07:32:47.110825+00:00 app[web.1]: [2017-06-03 07:32:47 +0000] [4] [INFO] Shutting down: Master
2017-06-03T07:32:47.055557+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-06-03T07:32:47.247466+00:00 heroku[web.1]: Process exited with status 0
The error message tells you, that you haven't installed the MySQLdb module. Add it to your requirements.txt

Deploy coffeescripted derbyjs app to heroku

When deploying to heroku I get the following error log:
2013-08-05T18:14:39.217252+00:00 heroku[web.1]: State changed from crashed to starting
2013-08-05T18:14:43.819448+00:00 heroku[web.1]: Starting process with command `node server.js`
2013-08-05T18:14:45.272628+00:00 app[web.1]:
2013-08-05T18:14:45.274663+00:00 app[web.1]: module.js:340
2013-08-05T18:14:45.277076+00:00 app[web.1]: throw err;
2013-08-05T18:14:45.277256+00:00 app[web.1]: ^
2013-08-05T18:14:45.279157+00:00 app[web.1]: Error: Cannot find module '/app/server.js'
2013-08-05T18:14:45.279157+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:338:15)
2013-08-05T18:14:45.279157+00:00 app[web.1]: at Function.Module._load (module.js:280:25)
2013-08-05T18:14:45.279157+00:00 app[web.1]: at Function.Module.runMain (module.js:497:10)
2013-08-05T18:14:45.279157+00:00 app[web.1]: at startup (node.js:119:16)
2013-08-05T18:14:45.279157+00:00 app[web.1]: at node.js:901:3
2013-08-05T18:14:46.719239+00:00 heroku[web.1]: Process exited with status 8
2013-08-05T18:14:46.736590+00:00 heroku[web.1]: State changed from starting to crashed
I'm new to derbyjs as well as heroku ... great, great, great tools, anyway!
So, why is the app complaining about a /app/server.js file?
It's a coffeescript project, and as far as I am aware, it uses browserify to deliver js on the fly. Also, there simply is no server.coffee in the app dir ... as it is the app dir, how can there ever be a server.js in it?? well, surely some meaning hidden from me for now.
Guys, can you help out?
I'm using:
Derby 0.5.9
Heroku Toolbelt ... just installed before writing this task
Deploy steps as explained on derbyjs.com
Cheers, Joehannes

Heroku app failing with code 255

Newbie to Heroku here.
I've gone through the motions described here:
http://www.playframework.org/documentation/2.0.2/ScalaTodoList
And I've managed to set up a simple Play app on Heroku. Next up, I've tried uploading my main application which I've been developing on my own station, by going through the same steps as earlier. Uploading and compilation worked, however the app keeps crashing with code 255. Here is are the logs:
2012-08-21T19:07:29+00:00 heroku[slugc]: Slug compilation started
2012-08-21T19:10:18+00:00 heroku[api]: Attach HEROKU_POSTGRESQL_GOLD resource by heroku-postgresql#addons.heroku.com
2012-08-21T19:10:18+00:00 heroku[api]: Release v2 created by heroku-postgresql#addons.heroku.com
2012-08-21T19:10:18+00:00 heroku[api]: Add DATABASE_URL config by email#gmail.com
2012-08-21T19:10:18+00:00 heroku[api]: Release v3 created by email#gmail.com
2012-08-21T19:10:18+00:00 heroku[api]: Add SBT_OPTS, PATH, REPO, JAVA_OPTS config by b.panait#gmail.com
2012-08-21T19:10:18+00:00 heroku[api]: Release v4 created by email#gmail.com
2012-08-21T19:10:18+00:00 heroku[api]: Release v5 created by email#gmail.com
2012-08-21T19:10:18+00:00 heroku[api]: Deploy 40c5224 by email#gmail.com
2012-08-21T19:10:19+00:00 heroku[slugc]: Slug compilation finished
2012-08-21T19:10:25+00:00 heroku[web.1]: Starting process with command `target/start -Dhttp.port=28820 -Xmx384m -Xss512k
-XX:+UseCompressedOops`
2012-08-21T19:10:26+00:00 app[web.1]: This application is already running (Or delete the RUNNING_PID file).
2012-08-21T19:10:27+00:00 heroku[web.1]: Process exited with status 255
2012-08-21T19:10:27+00:00 heroku[web.1]: State changed from starting to crashed
2012-08-21T19:10:27+00:00 heroku[web.1]: State changed from crashed to starting
2012-08-21T19:10:30+00:00 heroku[web.1]: Starting process with command `target/start -Dhttp.port=21120 -Xmx384m -Xss512k
-XX:+UseCompressedOops`
2012-08-21T19:10:31+00:00 app[web.1]: This application is already running (Or delete the RUNNING_PID file).
2012-08-21T19:10:32+00:00 heroku[web.1]: Process exited with status 255
2012-08-21T19:10:32+00:00 heroku[web.1]: State changed from starting to crashed
2012-08-21T19:32:43+00:00 heroku[web.1]: State changed from crashed to starting
2012-08-21T19:32:47+00:00 heroku[web.1]: Starting process with command `target/start -Dhttp.port=35227 -Xmx384m -Xss512k
-XX:+UseCompressedOops`
2012-08-21T19:32:48+00:00 app[web.1]: This application is already running (Or delete the RUNNING_PID file).
2012-08-21T19:32:49+00:00 heroku[web.1]: Process exited with status 255
2012-08-21T19:32:49+00:00 heroku[web.1]: State changed from starting to crashed
2012-08-21T19:33:09+00:00 heroku[web.1]: State changed from crashed to starting
2012-08-21T19:33:13+00:00 heroku[web.1]: Starting process with command `target/start -Dhttp.port=3275 -Xmx384m -Xss512k
-XX:+UseCompressedOops`
2012-08-21T19:33:14+00:00 app[web.1]: This application is already running (Or delete the RUNNING_PID file).
2012-08-21T19:33:15+00:00 heroku[web.1]: Process exited with status 255
2012-08-21T19:33:16+00:00 heroku[web.1]: State changed from starting to crashed
I have no idea where to start investigating here. The main app is quite large, has some extra dependencies and uses a database. Any help is appreciated.
EDIT1: Ok, so I've deleted RUNNING_PID from my git repository (deleting it from heroku doesn't really work: https://devcenter.heroku.com/articles/ssh-access). I also updated my procfile to:
web: target/start -Dhttp.port=${PORT} ${JAVA_OPTS} -DapplyEvolutions.default=true -Ddb.default.url=${DATABASE_URL} -Ddb.default.driver=org.h2.Driver
I am now getting the following errors:
2012-08-21T20:24:45+00:00 heroku[slugc]: Slug compilation finished
2012-08-21T20:24:48+00:00 heroku[web.1]: Starting process with command `target/start -Dhttp.port=38558 -Xmx384m -Xss512k
-XX:+UseCompressedOops`
2012-08-21T20:24:51+00:00 app[web.1]: Play server process ID is 2
2012-08-21T20:24:57+00:00 app[web.1]: [←[37minfo←[0m] play - database [default] connected at jdbc:h2:mem:play
2012-08-21T20:24:58+00:00 app[web.1]: [←[33mwarn←[0m] play - Your production database [default] needs evolutions!
2012-08-21T20:24:58+00:00 app[web.1]:
2012-08-21T20:24:58+00:00 app[web.1]: # --- Rev:1,Ups - f9a96e0
...
Copy of the evolution file.
...
2012-08-21T20:24:58+00:00 app[web.1]:
2012-08-21T20:24:58+00:00 app[web.1]: [←[33mwarn←[0m] play - Run with -DapplyEvolutions.default=true if you want to run
them automatically (be careful)
2012-08-21T20:24:58+00:00 app[web.1]: Oops, cannot start the server.
2012-08-21T20:24:58+00:00 app[web.1]: PlayException: Database 'default' needs evolution! [An SQL script need to be run o
n your database.]
2012-08-21T20:24:58+00:00 app[web.1]: at play.api.db.evolutions.EvolutionsPlugin$$anonfun$onStart$1.apply(Evolutions.s
cala:422)
2012-08-21T20:24:58+00:00 app[web.1]: at play.api.db.evolutions.EvolutionsPlugin$$anonfun$onStart$1.apply(Evolutions.s
cala:410)
2012-08-21T20:24:58+00:00 app[web.1]: at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59
)
2012-08-21T20:24:58+00:00 app[web.1]: at scala.collection.immutable.List.foreach(List.scala:45)
2012-08-21T20:24:58+00:00 app[web.1]: at play.api.db.evolutions.EvolutionsPlugin.onStart(Evolutions.scala:410)
2012-08-21T20:24:58+00:00 app[web.1]: at play.api.Play$$anonfun$start$1.apply(Play.scala:60)
2012-08-21T20:24:58+00:00 app[web.1]: at play.api.Play$$anonfun$start$1.apply(Play.scala:60)
2012-08-21T20:24:58+00:00 app[web.1]: at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59
)
2012-08-21T20:24:58+00:00 app[web.1]: at scala.collection.immutable.List.foreach(List.scala:45)
2012-08-21T20:24:58+00:00 app[web.1]: at play.api.Play$.start(Play.scala:60)
2012-08-21T20:24:58+00:00 app[web.1]: at play.core.StaticApplication.<init>(ApplicationProvider.scala:51)
2012-08-21T20:24:58+00:00 app[web.1]: at play.core.server.NettyServer$.createServer(NettyServer.scala:132)
2012-08-21T20:24:58+00:00 app[web.1]: at play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:153)
2012-08-21T20:24:58+00:00 app[web.1]: at play.core.server.NettyServer$$anonfun$main$5.apply(NettyServer.scala:152)
2012-08-21T20:24:58+00:00 app[web.1]: at scala.Option.map(Option.scala:133)
2012-08-21T20:24:58+00:00 app[web.1]: at play.core.server.NettyServer$.main(NettyServer.scala:152)
2012-08-21T20:24:58+00:00 app[web.1]: at play.core.server.NettyServer.main(NettyServer.scala)
2012-08-21T20:25:00+00:00 heroku[web.1]: Process exited with status 255
2012-08-21T20:25:00+00:00 heroku[web.1]: State changed from starting to crashed
EDIT2:
Ok, I've figured out how to fix the problem with the evolutions. Simply add applyEvolutions.default=true to application.conf and the evolutions will be applied automatically. You have to be careful with this as it can destroy your data if you have destructors set up in your evolutions.
As Alper rightly suggested,
try adding -Dplay.evolutions.db.default.autoApplyDowns=true to your Procfile.
It fixed it for me.

Resources