heroku error Process exited with status 3 - heroku

I was trying to create an app with the learned model with flask through Heroku env
2019-11-17T01:24:29.506868+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2019-11-17T01:24:29.506869+00:00 app[web.1]: worker.init_process()
2019-11-17T01:24:29.506871+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 133, in init_process
2019-11-17T01:24:29.506872+00:00 app[web.1]: self.load_wsgi()
2019-11-17T01:24:29.506874+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 142, in load_wsgi
2019-11-17T01:24:29.506875+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2019-11-17T01:24:29.506877+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
2019-11-17T01:24:29.506878+00:00 app[web.1]: self.callable = self.load()
2019-11-17T01:24:29.506880+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2019-11-17T01:24:29.506881+00:00 app[web.1]: return self.load_wsgiapp()
2019-11-17T01:24:29.506883+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
2019-11-17T01:24:29.506884+00:00 app[web.1]: return util.import_app(self.app_uri)
2019-11-17T01:24:29.506885+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/util.py", line 331, in import_app
2019-11-17T01:24:29.506887+00:00 app[web.1]: mod = importlib.import_module(module)
2019-11-17T01:24:29.506889+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/importlib/init.py", line 126, in import_module
2019-11-17T01:24:29.506890+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2019-11-17T01:24:29.506892+00:00 app[web.1]: File "", line 994, in _gcd_import
2019-11-17T01:24:29.506893+00:00 app[web.1]: File "", line 971, in _find_and_load
2019-11-17T01:24:29.506894+00:00 app[web.1]: File "", line 953, in _find_and_load_unlocked
2019-11-17T01:24:29.506896+00:00 app[web.1]: ModuleNotFoundError: No module named 'application'
2019-11-17T01:24:29.506986+00:00 app[web.1]: [2019-11-17 01:24:29 +0000] [11] [INFO] Worker exiting (pid: 11)
2019-11-17T01:24:29.533341+00:00 app[web.1]: [2019-11-17 01:24:29 +0000] [4] [INFO] Shutting down: Master
2019-11-17T01:24:29.533421+00:00 app[web.1]: [2019-11-17 01:24:29 +0000] [4] [INFO] Reason: Worker failed to boot.
2019-11-17T01:24:29.601346+00:00 heroku[web.1]: Process exited with status 3
2019-11-17T04:07:39.025573+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=ny-cab-fare-prediction-api.herokuapp.com request_id=c63bd1ad-8314-452b-b9ea-5f72a0c524cf fwd="103.5.134.31" dyno= connect= service= status=503 bytes= protocol=https
2019-11-17T04:07:39.936881+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=ny-cab-fare-prediction-api.herokuapp.com request_id=4dd5e588-dd2c-486e-a998-6bd6cbf5298d fwd="103.5.134.31" dyno= connect= service= status=503 bytes= protocol=https
2019-11-17T05:18:07.225765+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=ny-cab-fare-prediction-api.herokuapp.com request_id=fc42949c-9825-4ecb-877e-b13983bbb948 fwd="103.5.134.31" dyno= connect= service= status=503 bytes= protocol=https
2019-11-17T05:18:07.906552+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=ny-cab-fare-prediction-api.herokuapp.com request_id=3e214acf-6344-418e-ac4f-9fc064471329 fwd="103.5.134.31" dyno= connect= service= status=503 bytes= protocol=https
2019-11-17T05:18:33.000000+00:00 app[api]: Build started by user yegavintin#gmail.com
2019-11-17T05:19:07.395350+00:00 heroku[web.1]: State changed from crashed to starting
2019-11-17T05:19:07.061059+00:00 app[api]: Deploy 1345edea by user yegavintin#gmail.com
2019-11-17T05:19:07.061059+00:00 app[api]: Release v7 created by user yegavintin#gmail.com
2019-11-17T05:19:14.659794+00:00 heroku[web.1]: Starting process with command gunicorn application:app
2019-11-17T05:19:17.128085+00:00 heroku[web.1]: State changed from starting to crashed
2019-11-17T05:19:17.132088+00:00 heroku[web.1]: State changed from crashed to starting
2019-11-17T05:19:16.965846+00:00 app[web.1]: [2019-11-17 05:19:16 +0000] [4] [INFO] Starting gunicorn 20.0.0
2019-11-17T05:19:16.966852+00:00 app[web.1]: [2019-11-17 05:19:16 +0000] [4] [INFO] Listening at: http://0.0.0.0:32063 (4)
2019-11-17T05:19:16.967039+00:00 app[web.1]: [2019-11-17 05:19:16 +0000] [4] [INFO] Using worker: sync
2019-11-17T05:19:16.971935+00:00 app[web.1]: [2019-11-17 05:19:16 +0000] [11] [INFO] Booting worker with pid: 11
2019-11-17T05:19:16.977535+00:00 app[web.1]: [2019-11-17 05:19:16 +0000] [11] [ERROR] Exception in worker process
2019-11-17T05:19:16.977539+00:00 app[web.1]: Traceback (most recent call last):
2019-11-17T05:19:16.977542+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2019-11-17T05:19:16.977544+00:00 app[web.1]: worker.init_process()
2019-11-17T05:19:16.977546+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 133, in init_process
2019-11-17T05:19:16.977548+00:00 app[web.1]: self.load_wsgi()
2019-11-17T05:19:16.977550+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 142, in load_wsgi
2019-11-17T05:19:16.977552+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2019-11-17T05:19:16.977554+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
2019-11-17T05:19:16.977556+00:00 app[web.1]: self.callable = self.load()
2019-11-17T05:19:16.977558+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2019-11-17T05:19:16.977560+00:00 app[web.1]: return self.load_wsgiapp()
2019-11-17T05:19:16.977562+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
2019-11-17T05:19:16.977564+00:00 app[web.1]: return util.import_app(self.app_uri)
2019-11-17T05:19:16.977566+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/util.py", line 331, in import_app
2019-11-17T05:19:16.977568+00:00 app[web.1]: mod = importlib.import_module(module)
2019-11-17T05:19:16.977570+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/importlib/init.py", line 126, in import_module
2019-11-17T05:19:16.977573+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2019-11-17T05:19:16.977575+00:00 app[web.1]: File "", line 994, in _gcd_import
2019-11-17T05:19:16.977577+00:00 app[web.1]: File "", line 971, in _find_and_load
2019-11-17T05:19:16.977579+00:00 app[web.1]: File "", line 953, in _find_and_load_unlocked
2019-11-17T05:19:16.977587+00:00 app[web.1]: ModuleNotFoundError: No module named 'application'
2019-11-17T05:19:16.977747+00:00 app[web.1]: [2019-11-17 05:19:16 +0000] [11] [INFO] Worker exiting (pid: 11)
2019-11-17T05:19:17.019314+00:00 app[web.1]: [2019-11-17 05:19:17 +0000] [4] [INFO] Shutting down: Master
2019-11-17T05:19:17.019530+00:00 app[web.1]: [2019-11-17 05:19:17 +0000] [4] [INFO] Reason: Worker failed to boot.
2019-11-17T05:19:17.104870+00:00 heroku[web.1]: Process exited with status 3
2019-11-17T05:19:25.549819+00:00 heroku[web.1]: Starting process with command gunicorn application:app
2019-11-17T05:19:27.758021+00:00 heroku[web.1]: State changed from starting to crashed
2019-11-17T05:19:27.630416+00:00 app[web.1]: [2019-11-17 05:19:27 +0000] [4] [INFO] Starting gunicorn 20.0.0
2019-11-17T05:19:27.630968+00:00 app[web.1]: [2019-11-17 05:19:27 +0000] [4] [INFO] Listening at: http://0.0.0.0:30205 (4)
2019-11-17T05:19:27.631086+00:00 app[web.1]: [2019-11-17 05:19:27 +0000] [4] [INFO] Using worker: sync
2019-11-17T05:19:27.636390+00:00 app[web.1]: [2019-11-17 05:19:27 +0000] [11] [INFO] Booting worker with pid: 11
2019-11-17T05:19:27.642955+00:00 app[web.1]: [2019-11-17 05:19:27 +0000] [11] [ERROR] Exception in worker process
2019-11-17T05:19:27.642958+00:00 app[web.1]: Traceback (most recent call last):
2019-11-17T05:19:27.642959+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2019-11-17T05:19:27.642964+00:00 app[web.1]: worker.init_process()
2019-11-17T05:19:27.642965+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 133, in init_process
2019-11-17T05:19:27.642967+00:00 app[web.1]: self.load_wsgi()
2019-11-17T05:19:27.642968+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 142, in load_wsgi
2019-11-17T05:19:27.642970+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2019-11-17T05:19:27.642972+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
2019-11-17T05:19:27.642973+00:00 app[web.1]: self.callable = self.load()
2019-11-17T05:19:27.642975+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2019-11-17T05:19:27.642976+00:00 app[web.1]: return self.load_wsgiapp()
2019-11-17T05:19:27.642978+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
2019-11-17T05:19:27.642979+00:00 app[web.1]: return util.import_app(self.app_uri)
2019-11-17T05:19:27.642980+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/util.py", line 331, in import_app
2019-11-17T05:19:27.642982+00:00 app[web.1]: mod = importlib.import_module(module)
2019-11-17T05:19:27.642983+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/importlib/init.py", line 126, in import_module
2019-11-17T05:19:27.642985+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2019-11-17T05:19:27.642987+00:00 app[web.1]: File "", line 994, in _gcd_import
2019-11-17T05:19:27.642988+00:00 app[web.1]: File "", line 971, in _find_and_load
2019-11-17T05:19:27.642990+00:00 app[web.1]: File "", line 953, in _find_and_load_unlocked
2019-11-17T05:19:27.642994+00:00 app[web.1]: ModuleNotFoundError: No module named 'application'
2019-11-17T05:19:27.643170+00:00 app[web.1]: [2019-11-17 05:19:27 +0000] [11] [INFO] Worker exiting (pid: 11)
2019-11-17T05:19:27.682204+00:00 app[web.1]: [2019-11-17 05:19:27 +0000] [4] [INFO] Shutting down: Master
2019-11-17T05:19:27.682293+00:00 app[web.1]: [2019-11-17 05:19:27 +0000] [4] [INFO] Reason: Worker failed to boot.
2019-11-17T05:19:27.742185+00:00 heroku[web.1]: Process exited with status 3
2019-11-17T05:19:28.000000+00:00 app[api]: Build succeeded
2019-11-17T05:21:57.875588+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=ny-cab-fare-prediction-api.herokuapp.com request_id=cf5e1a0c-7b15-4344-a7d6-1e9d18950322 fwd="103.5.134.31" dyno= connect= service= status=503 bytes= protocol=https
2019-11-17T05:21:58.581392+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=ny-cab-fare-prediction-api.herokuapp.com request_id=3ab91fae-db55-4a87-a571-64dc5d3dafb9 fwd="103.5.134.31" dyno= connect= service= status=503 bytes= protocol=https

Not sure why you have web: gunicorn application:app this in Procefile. Your repo doesn't have application module.
Please change you Procfile contents to web: gunicorn app:app.

Related

Simple Flask app works locally, but crash when I deploy to heroku

It's a simple flask app here is the code:
from flask import Flask, render_template, url_for, flash, redirect
from forms import InviteForm
import requests
import os
app = Flask(__name__)
app.config['SECRET_KEY'] = os.environ["SECRET_KEY"]
#app.route("/home")
def landing_page():
return render_template('home.html')
#app.route("/", methods=['GET', 'POST'])
#app.route("/invite", methods=['GET', 'POST'])
def invite():
form = InviteForm()
if form.validate_on_submit():
invite_slack_result = invite_to_slack(form.email.data)
print(invite_slack_result)
if invite_slack_result["ok"]:
flash('Invite send at {}'.format(form.email.data, 'success'))
else:
flash(invite_slack_result)
return redirect(url_for('landing_page'))
return render_template('invite.html', title='Invite', form=form)
def invite_to_slack(user_email):
slack_request = 'https://slack.com/api/users.admin.invite?token='
slack_token = os.environ["SLACK_API_TOKEN"]
user_email = '&email=' + str(user_email)
url = slack_request.strip() + slack_token.strip() + user_email.strip()
r = requests.get(url)
data = r.json()
print(data["ok"])
return data
if __name__ == '__main__':
app.run()
I tried all guides out there but when I deploy to heroku app always crash.
Here is the log:
› Warning: heroku update available from 7.19.3 to 7.24.1
2019-05-03T09:55:43.480413+00:00 app[api]: Release v1 created by user myemail#gmail.com
2019-05-03T09:55:43.641038+00:00 app[api]: Enable Logplex by user myemail#gmail.com
2019-05-03T09:55:43.641038+00:00 app[api]: Release v2 created by user myemail#gmail.com
2019-05-03T09:55:43.480413+00:00 app[api]: Initial release by user myemail#gmail.com
2019-05-03T09:56:44.939393+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=fast-temple-32581.herokuapp.com request_id=14db9962-9b66-4bf3-8745-ef09b221f655 fwd="46.176.119.138" dyno= connect= service= status=502 bytes= protocol=https
2019-05-03T09:56:46.072393+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/favicon.ico" host=fast-temple-32581.herokuapp.com request_id=44c5fe2b-2375-4139-955b-e7493847bf60 fwd="46.176.119.138" dyno= connect= service= status=502 bytes= protocol=https
2019-05-03T09:58:36.000000+00:00 app[api]: Build started by user myemail#gmail.com
2019-05-03T09:59:02.166369+00:00 app[api]: Release v3 created by user myemail#gmail.com
2019-05-03T09:59:02.166369+00:00 app[api]: Deploy 80d67888 by user myemail#gmail.com
2019-05-03T09:59:02.179942+00:00 app[api]: Scaled to web#1:Free by user myemail#gmail.com
2019-05-03T09:59:06.601864+00:00 heroku[web.1]: Starting process with command `gunicorn run:app`
2019-05-03T09:59:09.154085+00:00 heroku[web.1]: State changed from starting to crashed
2019-05-03T09:59:09.159463+00:00 heroku[web.1]: State changed from crashed to starting
2019-05-03T09:59:09.131387+00:00 heroku[web.1]: Process exited with status 3
2019-05-03T09:59:08.970428+00:00 app[web.1]: [2019-05-03 09:59:08 +0000] [4] [INFO] Starting gunicorn 19.9.0
2019-05-03T09:59:08.971230+00:00 app[web.1]: [2019-05-03 09:59:08 +0000] [4] [INFO] Listening at: http://0.0.0.0:38229 (4)
2019-05-03T09:59:08.977780+00:00 app[web.1]: [2019-05-03 09:59:08 +0000] [4] [INFO] Using worker: sync
2019-05-03T09:59:08.985422+00:00 app[web.1]: [2019-05-03 09:59:08 +0000] [10] [INFO] Booting worker with pid: 10
2019-05-03T09:59:08.992316+00:00 app[web.1]: [2019-05-03 09:59:08 +0000] [10] [ERROR] Exception in worker process
2019-05-03T09:59:08.992320+00:00 app[web.1]: Traceback (most recent call last):
2019-05-03T09:59:08.992323+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2019-05-03T09:59:08.992325+00:00 app[web.1]: worker.init_process()
2019-05-03T09:59:08.992326+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 129, in init_process
2019-05-03T09:59:08.992328+00:00 app[web.1]: self.load_wsgi()
2019-05-03T09:59:08.992330+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
2019-05-03T09:59:08.992332+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2019-05-03T09:59:08.992333+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
2019-05-03T09:59:08.992335+00:00 app[web.1]: self.callable = self.load()
2019-05-03T09:59:08.992337+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
2019-05-03T09:59:08.992339+00:00 app[web.1]: return self.load_wsgiapp()
2019-05-03T09:59:08.992340+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
2019-05-03T09:59:08.992342+00:00 app[web.1]: return util.import_app(self.app_uri)
2019-05-03T09:59:08.992344+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/util.py", line 350, in import_app
2019-05-03T09:59:08.992345+00:00 app[web.1]: __import__(module)
2019-05-03T09:59:08.992385+00:00 app[web.1]: ModuleNotFoundError: No module named 'run'
2019-05-03T09:59:08.992603+00:00 app[web.1]: [2019-05-03 09:59:08 +0000] [10] [INFO] Worker exiting (pid: 10)
2019-05-03T09:59:09.045407+00:00 app[web.1]: [2019-05-03 09:59:09 +0000] [4] [INFO] Shutting down: Master
2019-05-03T09:59:09.045727+00:00 app[web.1]: [2019-05-03 09:59:09 +0000] [4] [INFO] Reason: Worker failed to boot.
2019-05-03T09:59:10.000000+00:00 app[api]: Build succeeded
2019-05-03T09:59:12.048363+00:00 heroku[web.1]: Starting process with command `gunicorn run:app`
2019-05-03T09:59:14.458234+00:00 heroku[web.1]: State changed from starting to crashed
2019-05-03T09:59:14.447613+00:00 heroku[web.1]: Process exited with status 3
2019-05-03T09:59:14.324923+00:00 app[web.1]: [2019-05-03 09:59:14 +0000] [4] [INFO] Starting gunicorn 19.9.0
2019-05-03T09:59:14.325632+00:00 app[web.1]: [2019-05-03 09:59:14 +0000] [4] [INFO] Listening at: http://0.0.0.0:14930 (4)
2019-05-03T09:59:14.325973+00:00 app[web.1]: [2019-05-03 09:59:14 +0000] [4] [INFO] Using worker: sync
2019-05-03T09:59:14.331737+00:00 app[web.1]: [2019-05-03 09:59:14 +0000] [10] [INFO] Booting worker with pid: 10
2019-05-03T09:59:14.337117+00:00 app[web.1]: [2019-05-03 09:59:14 +0000] [10] [ERROR] Exception in worker process
2019-05-03T09:59:14.337120+00:00 app[web.1]: Traceback (most recent call last):
2019-05-03T09:59:14.337123+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2019-05-03T09:59:14.337124+00:00 app[web.1]: worker.init_process()
2019-05-03T09:59:14.337126+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 129, in init_process
2019-05-03T09:59:14.337128+00:00 app[web.1]: self.load_wsgi()
2019-05-03T09:59:14.337129+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 138, in load_wsgi
2019-05-03T09:59:14.337131+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2019-05-03T09:59:14.337133+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
2019-05-03T09:59:14.337135+00:00 app[web.1]: self.callable = self.load()
2019-05-03T09:59:14.337136+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 52, in load
2019-05-03T09:59:14.337138+00:00 app[web.1]: return self.load_wsgiapp()
2019-05-03T09:59:14.337140+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiapp
2019-05-03T09:59:14.337141+00:00 app[web.1]: return util.import_app(self.app_uri)
2019-05-03T09:59:14.337143+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/util.py", line 350, in import_app
2019-05-03T09:59:14.337145+00:00 app[web.1]: __import__(module)
2019-05-03T09:59:14.337146+00:00 app[web.1]: ModuleNotFoundError: No module named 'run'
2019-05-03T09:59:14.337279+00:00 app[web.1]: [2019-05-03 09:59:14 +0000] [10] [INFO] Worker exiting (pid: 10)
2019-05-03T09:59:14.365569+00:00 app[web.1]: [2019-05-03 09:59:14 +0000] [4] [INFO] Shutting down: Master
2019-05-03T09:59:14.365656+00:00 app[web.1]: [2019-05-03 09:59:14 +0000] [4] [INFO] Reason: Worker failed to boot.
2019-05-03T09:59:23.531289+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=fast-temple-32581.herokuapp.com request_id=23abb9dc-bfc5-4e3f-8460-3ac6367bc50c fwd="46.176.119.138" dyno= connect= service= status=503 bytes= protocol=https
2019-05-03T09:59:25.345486+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=fast-temple-32581.herokuapp.com request_id=ab5c577d-1ce1-4eb1-a2de-94840c8f13e5 fwd="46.176.119.138" dyno= connect= service= status=503 bytes= protocol=https
I tried almost guides/videos/tutorials but I always get the same problem, I don't know what's wrong and at this point I can't even guess
Here is thepastebin link to the error log
Here is the full project on github
there are some information in the Heroku crash log:
2019-05-03T09:59:06.601864+00:00 heroku[web.1]: Starting process with command `gunicorn run:app`
......
2019-05-03T09:59:08.992345+00:00 app[web.1]: __import__(module)
2019-05-03T09:59:08.992385+00:00 app[web.1]: ModuleNotFoundError: No module named 'run'
Starting process with command `gunicorn run:app`
It seems that you didn't set the right WSGI application for gunicorn
Add a Procfile file at project root directory,
the content of this file is :
web: gunicorn psgSlackInvite:app
you project's wsgi application is "app" in the module "psgSlackInvite"

Code is working locally but not on Heroku

I am testing Facebook Messenger bot. Part of the code with core functionality:
const schedule = require('node-schedule');
app.post('/webhook/', function(req, res) {
let messaging_events = req.body.entry[0].messaging
var j = schedule.scheduleJob('10 * * * * *', function(){
for (let i = 0; i < messaging_events.length; i++) {
let event = messaging_events[i]
let sender = event.sender.id
if (event.message && event.message.text) {
let text = event.message.text
sendText(sender, "Text echo: " + text.substring(0, 100))
}
}
res.sendStatus(200)
})
})
It should reply the same message that is sent to the bot every minute (when the clock crosses 10 seconds - 2:46:10 PM, 2:47:10 PM, etc.)
If I try similar code locally, it works. It does not on Heroku. It behaves irregularly - sometimes it replies the message 2 to 4 times at once and then crashes, sometimes it does not reply anything at all. Here is the Heroku log:
2018-03-19T13:48:43.574712+00:00 heroku[web.1]: Unidling
2018-03-19T13:48:43.575153+00:00 heroku[web.1]: State changed from down to starting
2018-03-19T13:48:45.854373+00:00 heroku[web.1]: Starting process with command `node index.js`
2018-03-19T13:48:48.046370+00:00 app[web.1]: running: port
2018-03-19T13:48:48.550571+00:00 heroku[web.1]: State changed from starting to up
2018-03-19T13:49:10.035608+00:00 heroku[router]: at=info method=POST path="/webhook/" host=dry-badlands-96368.herokuapp.com request_id=89a76e53-663d-4086-8457-64c0f26be8c7 fwd="31.13.113.20" dyno=web.1 connect=1ms service=11963ms status=200 bytes=201 protocol=https
2018-03-19T13:49:10.046345+00:00 heroku[router]: at=info method=POST path="/webhook/" host=dry-badlands-96368.herokuapp.com request_id=0da8c7a9-4d5f-45bc-8797-54f608968581 fwd="31.13.105.114" dyno=web.1 connect=0ms service=20401ms status=200 bytes=201 protocol=https
2018-03-19T13:49:41.297748+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/webhook/" host=dry-badlands-96368.herokuapp.com request_id=cd1568a1-68c3-455f-872e-260f8023d925 fwd="31.13.113.170" dyno=web.1 connect=1ms service=30002ms status=503 bytes=0 protocol=https
2018-03-19T13:49:41.747709+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/webhook/" host=dry-badlands-96368.herokuapp.com request_id=32947747-1c2b-475c-a2b8-46477e13c4a2 fwd="31.13.114.116" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0 protocol=https
2018-03-19T13:50:10.059682+00:00 app[web.1]: _http_outgoing.js:491
2018-03-19T13:50:10.059738+00:00 app[web.1]: throw new Error('Can\'t set headers after they are sent.');
2018-03-19T13:50:10.059740+00:00 app[web.1]: ^
2018-03-19T13:50:10.059742+00:00 app[web.1]:
2018-03-19T13:50:10.059744+00:00 app[web.1]: Error: Can't set headers after they are sent.
2018-03-19T13:50:10.059745+00:00 app[web.1]: at validateHeader (_http_outgoing.js:491:11)
2018-03-19T13:50:10.059747+00:00 app[web.1]: at ServerResponse.setHeader (_http_outgoing.js:498:3)
2018-03-19T13:50:10.059748+00:00 app[web.1]: at ServerResponse.header (/app/node_modules/express/lib/response.js:767:10)
2018-03-19T13:50:10.059750+00:00 app[web.1]: at ServerResponse.contentType (/app/node_modules/express/lib/response.js:595:15)
2018-03-19T13:50:10.059752+00:00 app[web.1]: at ServerResponse.sendStatus (/app/node_modules/express/lib/response.js:357:8)
2018-03-19T13:50:10.059753+00:00 app[web.1]: at Job.job (/app/index.js:46:9)
2018-03-19T13:50:10.059755+00:00 app[web.1]: at Job.invoke (/app/node_modules/node-schedule/lib/schedule.js:173:10)
2018-03-19T13:50:10.059756+00:00 app[web.1]: at /app/node_modules/node-schedule/lib/schedule.js:543:11
2018-03-19T13:50:10.059758+00:00 app[web.1]: at Timeout._onTimeout (/app/node_modules/node-schedule/lib/schedule.js:501:7)
2018-03-19T13:50:10.059759+00:00 app[web.1]: at ontimeout (timers.js:482:11)
2018-03-19T13:50:10.130605+00:00 heroku[web.1]: Process exited with status 1
2018-03-19T13:50:10.241686+00:00 heroku[web.1]: State changed from up to crashed
Does anyone have any idea why is this happening? Maybe Heroku is not suited for this?
Thank you for all suggestions.

Unable to deploy Phoenix 1.3.0-rc1 to Heroku, builds but crashes

I'm trying to deploy a Phoenix 1.3.0-rc1 to Heroku.
It builds properly but I'm unable to access the website. It might be useful to notice that I'm able to access the app while running Phoenix on my machine.
Also worth noticing that I'm using SSL.
This is $ heroku logs --tail output:
2017-03-31T01:45:15.876452+00:00 app[api]: Release v14 created by user me#jonathansoifer.com
2017-03-31T01:44:31.000000+00:00 app[api]: Build succeeded
2017-03-31T01:45:21.350931+00:00 heroku[web.1]: Starting process with command `MIX_ENV=prod mix phx.server`
2017-03-31T01:45:23.798042+00:00 app[web.1]: exited: {{shutdown,
2017-03-31T01:45:23.798041+00:00 app[web.1]: application: customer_acquisition
2017-03-31T01:45:23.798015+00:00 app[web.1]:
2017-03-31T01:45:23.798040+00:00 app[web.1]: =INFO REPORT==== 31-Mar-2017::01:45:23 ===
2017-03-31T01:45:23.798042+00:00 app[web.1]: {failed_to_start_child,
2017-03-31T01:45:23.798043+00:00 app[web.1]: 'Elixir.CustomerAcquisition.Web.Endpoint',
2017-03-31T01:45:23.798044+00:00 app[web.1]: {shutdown,
2017-03-31T01:45:23.798051+00:00 app[web.1]: {failed_to_start_child,'Elixir.Phoenix.Endpoint.Handler',
2017-03-31T01:45:23.798052+00:00 app[web.1]: {shutdown,
2017-03-31T01:45:23.798053+00:00 app[web.1]: {ranch_listener_sup,
2017-03-31T01:45:23.798053+00:00 app[web.1]: {failed_to_start_child,
2017-03-31T01:45:23.798054+00:00 app[web.1]: 'Elixir.CustomerAcquisition.Web.Endpoint.HTTP'},
2017-03-31T01:45:23.798054+00:00 app[web.1]: {'EXIT',
2017-03-31T01:45:23.798055+00:00 app[web.1]: {noproc,
2017-03-31T01:45:23.798056+00:00 app[web.1]: {gen_server,call,
2017-03-31T01:45:23.798057+00:00 app[web.1]: {set_new_listener_opts,
2017-03-31T01:45:23.798056+00:00 app[web.1]: [ranch_server,
2017-03-31T01:45:23.798058+00:00 app[web.1]: 'Elixir.CustomerAcquisition.Web.Endpoint.HTTP',16384,
2017-03-31T01:45:23.798058+00:00 app[web.1]: [{env,
2017-03-31T01:45:23.798059+00:00 app[web.1]: [{dispatch,
2017-03-31T01:45:23.798060+00:00 app[web.1]: [{'_',[],
2017-03-31T01:45:23.798060+00:00 app[web.1]: [{[>,>],
2017-03-31T01:45:23.798061+00:00 app[web.1]: [],'Elixir.Phoenix.Endpoint.CowboyWebSocket',
2017-03-31T01:45:23.798062+00:00 app[web.1]: {'Elixir.Phoenix.Transports.WebSocket',
2017-03-31T01:45:23.798062+00:00 app[web.1]: {'Elixir.CustomerAcquisition.Web.Endpoint',
2017-03-31T01:45:23.798063+00:00 app[web.1]: 'Elixir.CustomerAcquisition.Web.UserSocket',
2017-03-31T01:45:23.798063+00:00 app[web.1]: websocket}}},
2017-03-31T01:45:23.798064+00:00 app[web.1]: {'_',[],'Elixir.Plug.Adapters.Cowboy.Handler',
2017-03-31T01:45:23.798064+00:00 app[web.1]: {'Elixir.CustomerAcquisition.Web.Endpoint',
2017-03-31T01:45:23.798065+00:00 app[web.1]: []}}]}]}]}]}]}}}}}}}}},
2017-03-31T01:45:23.798066+00:00 app[web.1]: {'Elixir.CustomerAcquisition.Application',start,[normal,[]]}}
2017-03-31T01:45:23.798066+00:00 app[web.1]: type: permanent
2017-03-31T01:45:23.870799+00:00 app[web.1]: ** (exit) exited in: GenServer.call(Mix.State, {:get, {Map, :get, [:debug, false]}}, 5000)
2017-03-31T01:45:23.870801+00:00 app[web.1]: ** (EXIT) no process
2017-03-31T01:45:23.870802+00:00 app[web.1]: (elixir) lib/gen_server.ex:596: GenServer.call/3
2017-03-31T01:45:23.870803+00:00 app[web.1]: (mix) lib/mix/cli.ex:65: Mix.CLI.run_task/2
2017-03-31T01:45:23.870804+00:00 app[web.1]: (elixir) lib/code.ex:363: Code.require_file/2
2017-03-31T01:45:23.870804+00:00 app[web.1]:
2017-03-31T01:45:23.870999+00:00 app[web.1]: {"init terminating in do_boot",{noproc,{gen_server,call,[elixir_config,{get_and_put,at_exit,[]}]}}}
2017-03-31T01:45:23.871019+00:00 app[web.1]: init terminating in do_boot ()
2017-03-31T01:45:23.871288+00:00 app[web.1]:
2017-03-31T01:45:25.175329+00:00 app[web.1]: Crash dump is being written to: erl_crash.dump...done
2017-03-31T01:45:25.225434+00:00 heroku[web.1]: Process exited with status 1
2017-03-31T01:45:25.238818+00:00 heroku[web.1]: State changed from starting to crashed
2017-03-31T01:45:33.319992+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=liberty.ai request_id=2de26102-043c-4635-aee0-df1c0f812fd1 fwd="191.183.100.215,172.68.25.249" dyno= connect= service= status=503 bytes= protocol=http
2017-03-31T01:45:33.968974+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=liberty.ai request_id=f3f5e957-5796-4354-ade2-69bd7bc60c84 fwd="191.183.100.215,172.68.27.167" dyno= connect= service= status=503 bytes= protocol=http
Any help is appreciated.
I ran into this same error, it turns out that phoenix 1.3.0-rc1 requires elixir 1.4. If you add an elixir_buildpack.config, you can set the elixir version like so:
elixir_version=1.4.2
I found this solution here: https://github.com/HashNuke/heroku-buildpack-elixir/issues/99.

Sails js and Heroku : An error occurred in the application and your page could not be served.

I need help with heroku. My app works perfectly, but today is not working. I didnt modify any file. Somebody can help me? I followed another post in stackOverFlow, but doesnt work.
I run heroku logs:
2017-02-21T14:51:12.588970+00:00 app[web.1]: Line 3997 in .tmp/public/concat/production.js
2017-02-21T14:51:12.588971+00:00 app[web.1]:
2017-02-21T14:51:12.588971+00:00 app[web.1]: ------------------------------------------------------------------------
2017-02-21T14:51:12.589061+00:00 app[web.1]:
2017-02-21T14:51:12.589124+00:00 app[web.1]: Looks like a Grunt error occurred--
2017-02-21T14:51:12.589185+00:00 app[web.1]: Please fix it, then **restart Sails** to continue running tasks (e.g. watching for changes in assets)
2017-02-21T14:51:12.589241+00:00 app[web.1]: Or if you're stuck, check out the troubleshooting tips below.
2017-02-21T14:51:12.589303+00:00 app[web.1]:
2017-02-21T14:51:12.589958+00:00 app[web.1]: Troubleshooting tips:
2017-02-21T14:51:12.590030+00:00 app[web.1]:
2017-02-21T14:51:12.590089+00:00 app[web.1]: *-> Are "grunt" and related grunt task modules installed locally? Run `npm install` if you're not sure.
2017-02-21T14:51:12.590133+00:00 app[web.1]:
2017-02-21T14:51:12.590178+00:00 app[web.1]: *-> You might have a malformed LESS, SASS, CoffeeScript file, etc.
2017-02-21T14:51:12.590247+00:00 app[web.1]:
2017-02-21T14:51:12.590287+00:00 app[web.1]: *-> Or maybe you don't have permissions to access the `.tmp` directory?
2017-02-21T14:51:12.590377+00:00 app[web.1]: e.g., `/app/.tmp` ?
2017-02-21T14:51:12.590423+00:00 app[web.1]:
2017-02-21T14:51:12.590468+00:00 app[web.1]: If you think this might be the case, try running:
2017-02-21T14:51:12.592153+00:00 app[web.1]: sudo chown -R 17728 /app/.tmp
2017-02-21T14:51:12.592214+00:00 app[web.1]:
2017-02-21T14:51:30.670658+00:00 app[web.1]: Error: The hook `grunt` is taking too long to load.
2017-02-21T14:51:30.670679+00:00 app[web.1]: Make sure it is triggering its `initialize()` callback, or else set `sails.config.grunt._hookTimeout to a higher value (currently 20000)
2017-02-21T14:51:30.670680+00:00 app[web.1]: at Timeout.tooLong [as _onTimeout] (/app/node_modules/sails/lib/app/private/loadHooks.js:85:21)
2017-02-21T14:51:30.670682+00:00 app[web.1]: at ontimeout (timers.js:365:14)
2017-02-21T14:51:30.670682+00:00 app[web.1]: at tryOnTimeout (timers.js:237:5)
2017-02-21T14:51:30.670683+00:00 app[web.1]: at Timer.listOnTimeout (timers.js:207:5)
2017-02-21T14:51:30.780591+00:00 heroku[web.1]: Process exited with status 0
2017-02-21T14:51:30.795109+00:00 heroku[web.1]: State changed from starting to crashed
2017-02-21T14:51:30.796348+00:00 heroku[web.1]: State changed from crashed to starting
2017-02-21T14:51:33.992516+00:00 heroku[web.1]: Starting process with command `npm start`
2017-02-21T14:51:36.040206+00:00 app[web.1]:
2017-02-21T14:51:36.040223+00:00 app[web.1]: > estudioMate#0.0.0 start /app
2017-02-21T14:51:36.040224+00:00 app[web.1]: > node app.js
2017-02-21T14:51:36.040225+00:00 app[web.1]:
2017-02-21T14:51:37.483529+00:00 app[web.1]: Warning: connect.session() MemoryStore is not
2017-02-21T14:51:37.483541+00:00 app[web.1]: designed for a production environment, as it will leak
2017-02-21T14:51:37.483542+00:00 app[web.1]: memory, and will not scale past a single process.
2017-02-21T14:51:37.602636+00:00 app[web.1]: Express midleware for passport
2017-02-21T14:51:37.621476+00:00 app[web.1]: Tue, 21 Feb 2017 14:51:37 GMT connect deprecated multipart: use parser (multiparty, busboy, formidable) npm module instead at
node_modules/express/node_modules/connect/lib/middleware/bodyParser.js:56:20
2017-02-21T14:51:37.621689+00:00 app[web.1]: Tue, 21 Feb 2017 14:51:37 GMT connect deprecated limit: Restrict request size at location of read at node_modules/express/node_modules/connect/lib/middleware/multipart.js:86:15
2017-02-21T14:51:37.656950+00:00 app[web.1]: The default `sails-disk` adapter is not designed for use as a production database;
2017-02-21T14:51:37.657085+00:00 app[web.1]: Instead, please use another adapter; e.g. sails-postgresql or sails-mongo.
2017-02-21T14:51:37.657042+00:00 app[web.1]: (it stores the entire contents of your database in memory)
2017-02-21T14:51:37.657116+00:00 app[web.1]: For more info, see: http://sailsjs.org/documentation/concepts/deployment
2017-02-21T14:51:37.657131+00:00 app[web.1]: To hide this warning message, enable `sails.config.orm.skipProductionWarnings`.
2017-02-21T14:51:37.657481+00:00 app[web.1]:
2017-02-21T14:51:37.657506+00:00 app[web.1]: A project-wide `sails.config.models.migrate` setting has not been configured for this app.
2017-02-21T14:51:37.657550+00:00 app[web.1]: Since the NODE_ENV env variable is set to "production", auto-migration will be disabled automatically.
2017-02-21T14:51:37.657575+00:00 app[web.1]: (i.e. `migrate: 'safe'`)
2017-02-21T14:51:39.409768+00:00 app[web.1]: ** Grunt :: An error occurred. **
2017-02-21T14:51:39.410163+00:00 app[web.1]:
2017-02-21T14:51:39.410166+00:00 app[web.1]: ------------------------------------------------------------------------
2017-02-21T14:51:39.410167+00:00 app[web.1]: Aborted due to warnings.
2017-02-21T14:51:39.410168+00:00 app[web.1]: Running "uglify:dist" (uglify) task
2017-02-21T14:51:39.410168+00:00 app[web.1]: JS_Parse_Error {
2017-02-21T14:51:39.410169+00:00 app[web.1]: message: 'SyntaxError: Unexpected token punc «}», expected punc «:»',
2017-02-21T14:51:39.410170+00:00 app[web.1]: filename: '../concat/production.js',
2017-02-21T14:51:39.410171+00:00 app[web.1]: line: 3997,
2017-02-21T14:51:39.410171+00:00 app[web.1]: col: 31,
2017-02-21T14:51:39.410172+00:00 app[web.1]: pos: 284354,
2017-02-21T14:51:39.410187+00:00 app[web.1]: >> Uglifying source .tmp/public/concat/production.js failed.
2017-02-21T14:51:39.410183+00:00 app[web.1]: stack: 'Error\n at new JS_Parse_Error (<anonymous>:1534:18)\n at js_error (<anonymous>:1542:11)\n at croak (<anonymous>:2089:9)\n at token_error (<anonymous>:2097:9)\n at expect_token (<anonymous>:2110:9)\n at expect (<anonymous>:2113:36)\n at eval (<anonymous>:2686:13)\n at eval (<anonymous>:2136:24)\n at expr_atom (<anonymous>:2616:35)\n at maybe_unary (<anonymous>:2792:19)\n at expr_ops (<anonymous>:2827:24)\n at maybe_conditional (<anonymous>:2832:20)\n at maybe_assign (<anonymous>:2856:20)\n at expression (<anonymous>:2875:20)\n at expr_list (<anonymous>:2641:24)\n at subscripts (<anonymous>:2775:30)\n at subscripts (<anonymous>:2752:20)\n at expr_atom (<anonymous>:2628:20)\n at maybe_unary (<anonymous>:2792:19)\n at expr_ops (<anonymous>:2827:24)\n at maybe_conditional (<anonymous>:2832:20)\n at maybe_assign (<anonymous>:2856:20)\n at expression (<anonymous>:2875:20)\n at simple_statement (<anonymous>:2314:55)\n at eval (<anonymous>:2183:19)\n at eval (<anonymous>:2136:24)\n at block_ (<anonymous>:2429:20)\n at eval (<anonymous>:2401:25)\n at function_ (<anonymous>:2407:15)\n at expr_atom (<anonymous>:2622:24)\n at maybe_unary (<anonymous>:2792:19)\n at expr_ops (<anonymous>:2827:24)\n at maybe_conditional (<anonymous>:2832:20)\n at maybe_assign (<anonymous>:2856:20)\n at maybe_assign (<anonymous>:2864:32)\n at expression (<anonymous>:2875:20)\n at simple_statement (<anonymous>:2314:55)\n at eval (<anonymous>:2183:19)\n at eval (<anonymous>:2136:24)\n at block_ (<anonymous>:2429:20)\n at eval (<anonymous>:2401:25)\n at function_ (<anonymous>:2407:15)\n at expr_atom (<anonymous>:2622:24)\n at maybe_unary (<anonymous>:2792:19)\n at expr_ops (<anonymous>:2827:24)\n at maybe_conditional (<anonymous>:2832:20)\n at maybe_assign (<anonymous>:2856:20)\n at expression (<anonymous>:2875:20)\n at expr_list (<anonymous>:2641:24)\n at eval (<anonymous>:2651:23)\n at eval (<anonymous>:2136:24)\n at expr_atom (<anonymous>:2614:35)\n at maybe_unary (<anonymous>:2792:19)\n at expr_ops (<anonymous>:2827:24)\n at maybe_conditional (<anonymous>:2832:20)\n at maybe_assign (<anonymous>:2856:20)\n at expression (<anonymous>:2875:20)\n at expr_list (<anonymous>:2641:24)\n at subscripts (<anonymous>:2775:30)\n at subscripts (<anonymous>:2752:20)\n at subscripts (<anonymous>:2772:20)\n at subscripts (<anonymous>:2752:20)\n at expr_atom (<anonymous>:2628:20)\n at maybe_unary (<anonymous>:2792:19)\n at expr_ops (<anonymous>:2827:24)\n at maybe_conditional (<anonymous>:2832:20)\n at maybe_assign (<anonymous>:2856:20)\n at expression (<anonymous>:2875:20)\n at simple_statement (<anonymous>:2314:55)\n at eval (<anonymous>:2183:19)\n at eval (<anonymous>:2136:24)\n at eval (<anonymous>:2904:23)\n at Object.parse (<anonymous>:2915:7)\n at /app/node_modules/grunt-contrib-uglify/tasks/lib/uglify.js:54:27\n at Array.forEach (native)\n at Object.exports.minify (/app/node_modules/grunt-contrib-uglify/tasks/lib/uglify.js:37:11)\n at /app/node_modules/grunt-contrib-uglify/tasks/uglify.js:156:25\n at Array.forEach (native)\n at Object.<anonymous> (/app/node_modules/grunt-contrib-uglify/tasks/uglify.js:77:16)\n at Object.<anonymous> (/app/node_modules/grunt/lib/grunt/task.js:255:15)\n at Object.thisTask.fn (/app/node_modules/grunt/lib/grunt/task.js:73:16)\n at Object.<anonymous> (/app/node_modules/grunt/lib/util/task.js:294:30)\n at Task.runTaskFn (/app/node_modules/grunt/lib/util/task.js:244:24)\n at Task.<anonymous> (/app/node_modules/grunt/lib/util/task.js:293:12)\n at /app/node_modules/grunt/lib/util/task.js:220:11\n at _combinedTickCallback (internal/process/next_tick.js:67:7)\n at process._tickCallback (internal/process/next_tick.js:98:9)\n' }
2017-02-21T14:51:39.410187+00:00 app[web.1]: Warning: Uglification failed.
2017-02-21T14:51:39.410188+00:00 app[web.1]: SyntaxError: Unexpected token punc «}», expected punc «:».
2017-02-21T14:51:39.410189+00:00 app[web.1]: Line 3997 in .tmp/public/concat/production.js
2017-02-21T14:51:39.410189+00:00 app[web.1]:
2017-02-21T14:51:39.410190+00:00 app[web.1]: ------------------------------------------------------------------------
2017-02-21T14:51:39.410287+00:00 app[web.1]:
2017-02-21T14:51:39.410347+00:00 app[web.1]: Looks like a Grunt error occurred--
2017-02-21T14:51:39.410405+00:00 app[web.1]: Please fix it, then **restart Sails** to continue running tasks (e.g. watching for changes in assets)
2017-02-21T14:51:39.410465+00:00 app[web.1]: Or if you're stuck, check out the troubleshooting tips below.
2017-02-21T14:51:39.410527+00:00 app[web.1]:
2017-02-21T14:51:39.411169+00:00 app[web.1]: Troubleshooting tips:
2017-02-21T14:51:39.411248+00:00 app[web.1]:
2017-02-21T14:51:39.411309+00:00 app[web.1]: *-> Are "grunt" and related grunt task modules installed locally? Run `npm install` if you're not sure.
2017-02-21T14:51:39.411377+00:00 app[web.1]:
2017-02-21T14:51:39.411435+00:00 app[web.1]: *-> You might have a malformed LESS, SASS, CoffeeScript file, etc.
2017-02-21T14:51:39.411489+00:00 app[web.1]:
2017-02-21T14:51:39.411544+00:00 app[web.1]: *-> Or maybe you don't have permissions to access the `.tmp` directory?
2017-02-21T14:51:39.411755+00:00 app[web.1]:
2017-02-21T14:51:39.411678+00:00 app[web.1]: e.g., `/app/.tmp` ?
2017-02-21T14:51:39.411812+00:00 app[web.1]: If you think this might be the case, try running:
2017-02-21T14:51:39.413647+00:00 app[web.1]: sudo chown -R 59060 /app/.tmp
2017-02-21T14:51:39.413728+00:00 app[web.1]:
2017-02-21T14:51:57.381050+00:00 app[web.1]: Error: The hook `grunt` is taking too long to load.
2017-02-21T14:51:57.381063+00:00 app[web.1]: Make sure it is triggering its `initialize()` callback, or else set `sails.config.grunt._hookTimeout to a higher value (currently 20000)
2017-02-21T14:51:57.381064+00:00 app[web.1]: at Timeout.tooLong [as _onTimeout] (/app/node_modules/sails/lib/app/private/loadHooks.js:85:21)
2017-02-21T14:51:57.381066+00:00 app[web.1]: at ontimeout (timers.js:365:14)
2017-02-21T14:51:57.381066+00:00 app[web.1]: at tryOnTimeout (timers.js:237:5)
2017-02-21T14:51:57.381067+00:00 app[web.1]: at Timer.listOnTimeout (timers.js:207:5)
2017-02-21T14:51:57.570097+00:00 heroku[web.1]: State changed from starting to crashed
2017-02-21T14:51:57.553867+00:00 heroku[web.1]: Process exited with status 0
2017-02-21T14:51:58.636986+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.equipomate.com request_id=c24795a8-27d7-490a-87e3-63217a2dce6c fwd="186.153.254.79" dyno= connect= service= status=503 bytes=
2017-02-21T14:51:58.812104+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.equipomate.com request_id=026d9527-41f1-4124-816b-d1a1b5735b4b fwd="186.153.254.79" dyno= connect= service= status=503 bytes=
2017-02-21T14:52:35.751663+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.equipomate.com request_id=d0e1a421-a1ad-4e01-bd95-32cee5e79dcb fwd="186.153.254.79" dyno= connect= service= status=503 bytes=
2017-02-21T14:52:48.270115+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.equipomate.com request_id=e60095d6-0a4c-4e8f-9ed9-04667531ce65 fwd="186.153.254.79" dyno= connect= service= status=503 bytes=
2017-02-21T14:53:59.766514+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.equipomate.com request_id=ba41e862-7e49-4a77-b943-2922b1787660 fwd="186.153.254.79" dyno= connect= service= status=503 bytes=
2017-02-21T14:56:37.383946+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.equipomate.com request_id=8c14b2fa-fde5-428c-a6c3-0bb9690613d9 fwd="186.153.254.79" dyno= connect= service= status=503 bytes=
2017-02-21T14:58:54.174763+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.equipomate.com request_id=273424e6-5eaa-4685-af19-5f8859466e3f fwd="186.153.254.79" dyno= connect= service= status=503 bytes=
2017-02-21T14:59:15.578510+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.equipomate.com request_id=b326c9f4-8552-4934-94c4-db22d0c6d4fa fwd="186.153.254.79" dyno= connect= service= status=503 bytes=
2017-02-21T14:59:17.342443+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=www.equipomate.com request_id=616ce76b-5753-461d-a520-01a2593efc75 fwd="186.153.254.79" dyno= connect= service= status=503 bytes=
I run npm install, and git heroku push again but doesnt happen.
Thanks.
You're going to need to do a little more work to prepare sails to run on Heroku. First, there's a build process inherent in Sails. When you push to Heroku by default the NODE_ENV environment variable is set to production. That will cause npm to not load any of your development dependencies. The quickest fix to see if that's the only error (And I'm not sure it is) is to set your NODE_ENV env variable to staging (or anything else really, as long as it's not production) and try to push again. That should load your dev dependencies, and may get you further.
Ultimately if you're going to serve Sails on Heroku, you'll need to figure out a better way to deploy. I'd suggest checking out this heroku-sails example and package: https://github.com/chadn/heroku-sails
When I deploy a sails.js app to heroku I typically do the following at a minimum -
in your .sailsrc file - you need to turn off grunt (when doing local dev, comment this out)-
{"generators": {"modules": {}},"hooks": {"grunt": false}}
You will then want to configure your static assets to load from a compiled directory when the NODE_ENV is prod, so in /config/env/production.js - add a variable to your exports for -
paths:{public:__dirname+'/../../www/'}
Add that www folder in your project root and run the command 'grunt build' or 'grunt buildProd'. This will then precompile all your assets for heroku since grunt can take a long time to load/run and can keep your application from starting.
There may be some other things you want to do such as ensure your site is setup to use redis or some type of db for sockets and sessions. You may also want to use something like pm2 to actually load your app as if you are on a larger dyno you can then run multiple instances of your sails app on the same dyno.
Checkout http://sailsjs.com/documentation/concepts/deployment/hosting#?deploying-to-heroku for some more info direct from Sails.js

heroku request timeout parse

I migrated my app to heroku + mlab from parse. I would too often get request timeout error on the logs. I turned on verbose and below is what i get when a timeout happens:
2016-05-25T15:27:40.946050+00:00 app[web.1]: [36mverbose[39m: POST /parse/events/AppOpened { host: 'dairy-oneandahalf.herokuapp.com',
2016-05-25T15:27:40.946067+00:00 app[web.1]: connection: 'close',
2016-05-25T15:27:40.946074+00:00 app[web.1]: 'x-parse-app-build-version': '1',
2016-05-25T15:27:40.946084+00:00 app[web.1]: "__type": "Date"
2016-05-25T15:27:41.517425+00:00 app[web.1]: [36mverbose[39m: GET /parse/classes/_User { host: 'dairy-oneandahalf.herokuapp.com',
2016-05-25T15:27:41.517436+00:00 app[web.1]: connection: 'close',
2016-05-25T15:27:41.517445+00:00 app[web.1]: 'x-parse-client-version': 'i1.13.0',
2016-05-25T15:27:41.517448+00:00 app[web.1]: 'x-forwarded-for': '58.152.243.212',
2016-05-25T15:27:40.948269+00:00 heroku[router]: at=info method=POST path="/parse/events/AppOpened" host=dairy-oneandahalf.herokuapp.com request_id=3e9b1390-a1b8-487b-8229-f4c44777b2a4 fwd="58.152.243.212" dyno=web.1 connect=2ms service=6ms status=200 bytes=483
2016-05-25T15:28:12.746545+00:00 app[web.1]: [36mverbose[39m: GET /parse/classes/allPosts { host: 'dairy-oneandahalf.herokuapp.com',
2016-05-25T15:28:12.746591+00:00 app[web.1]: connection: 'close',
2016-05-25T15:28:12.746600+00:00 app[web.1]: 'x-request-id': '84c7c271-4725-42c2-a111-3cf8e2c16d52',
2016-05-25T15:28:12.746602+00:00 app[web.1]: 'total-route-time': '0',
2016-05-25T15:28:12.746605+00:00 app[web.1]: "query": {
2016-05-25T15:28:11.513492+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=POST path="/parse/classes/_User" host=dairy-oneandahalf.herokuapp.com request_id=1260ec0f-3cee-4c43-a87e-9146ef154e29 fwd="58.152.243.212" dyno=web.1 connect=1ms service=30001ms status=503 bytes=0
I'm very new to heroku, can somebody explain to me what is wrong and what I can do about solving it? any help will be greatly appreciated, thanks in advance

Resources