This question already has answers here:
Deploying 'Django for beginners' app to Heroku fails with ModuleNotFoundError: No module named '_tkinter'
(1 answer)
ModuleNotFoundError: No module named '_tkinter' Heroku
(4 answers)
"no module found: tkinter" after deploying in heroku
(1 answer)
Closed 8 months ago.
I get this error in my logs --tail
at=error code=H10 desc="App crashed" method=GET path="/" host=tsuyo-workout.herokuapp.com request_id=069bdbc7-cdb1-4d4e-8cc2-ec8dc55890f5 fwd="184.189.121.138" dyno= connect= service= status=503 bytes= protocol=https
At first I had my port set to 5000 as I was developing locally. I used this question to fix the h10 error. I still have the same error.
I fixed some other errors before this and they were:
Not having a Procfile. I added one.
Procfile:
web: gunicorn app:app
I fixed up my requirements.txt. I added gunicorn.
requirments.txt
click==8.0.3
Flask==2.0.2
itsdangerous==2.0.1
Jinja2==3.0.3
MarkupSafe==2.0.1
Werkzeug==2.0.3
gunicorn==20.0.4
I think the only relevant info in my app.py is this. Let me know if you need more:
app.py
app = Flask(__name__)
port = int(os.getenv('PORT'))
if __name__ == '__main__':
app.run(port=port)
I have a database in this app. Could it be the fact that I have a database?
Some more lines of errors per request.
2022-07-06T20:50:53.695436+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
2022-07-06T20:50:53.695436+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2022-07-06T20:50:53.695437+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
2022-07-06T20:50:53.695437+00:00 app[web.1]: self.callable = self.load()
2022-07-06T20:50:53.695437+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2022-07-06T20:50:53.695437+00:00 app[web.1]: return self.load_wsgiapp()
2022-07-06T20:50:53.695438+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
2022-07-06T20:50:53.695438+00:00 app[web.1]: return util.import_app(self.app_uri)
2022-07-06T20:50:53.695439+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/util.py", line 358, in import_app
2022-07-06T20:50:53.695439+00:00 app[web.1]: mod = importlib.import_module(module)
2022-07-06T20:50:53.695439+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/importlib/__init__.py", line 127, in import_module
2022-07-06T20:50:53.695440+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2022-07-06T20:50:53.695440+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
2022-07-06T20:50:53.695440+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 991, in _find_and_load
2022-07-06T20:50:53.695440+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
2022-07-06T20:50:53.695441+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
2022-07-06T20:50:53.695441+00:00 app[web.1]: File "<frozen importlib._bootstrap_external>", line 843, in exec_module
2022-07-06T20:50:53.695441+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2022-07-06T20:50:53.695441+00:00 app[web.1]: File "/app/app.py", line 5, in <module>
2022-07-06T20:50:53.695442+00:00 app[web.1]: from helper import message, get_db_connection, default, login_required
2022-07-06T20:50:53.695442+00:00 app[web.1]: File "/app/helper.py", line 2, in <module>
2022-07-06T20:50:53.695442+00:00 app[web.1]: from turtle import clear
2022-07-06T20:50:53.695443+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/turtle.py", line 107, in <module>
2022-07-06T20:50:53.695443+00:00 app[web.1]: import tkinter as TK
2022-07-06T20:50:53.695443+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/tkinter/__init__.py", line 36, in <module>
2022-07-06T20:50:53.695444+00:00 app[web.1]: import _tkinter # If this fails your Python may not be configured for Tk
2022-07-06T20:50:53.695444+00:00 app[web.1]: ModuleNotFoundError: No module named '_tkinter'
2022-07-06T20:50:53.695559+00:00 app[web.1]: [2022-07-06 20:50:53 +0000] [11] [INFO] Worker exiting (pid: 11)
2022-07-06T20:50:53.696450+00:00 app[web.1]: [2022-07-06 20:50:53 +0000] [10] [ERROR] Exception in worker process
2022-07-06T20:50:53.696451+00:00 app[web.1]: Traceback (most recent call last):
2022-07-06T20:50:53.696451+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2022-07-06T20:50:53.696452+00:00 app[web.1]: worker.init_process()
2022-07-06T20:50:53.696452+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 119, in init_process
2022-07-06T20:50:53.696452+00:00 app[web.1]: self.load_wsgi()
2022-07-06T20:50:53.696453+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
2022-07-06T20:50:53.696453+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2022-07-06T20:50:53.696454+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/base.py", line 67, in wsgi
2022-07-06T20:50:53.696454+00:00 app[web.1]: self.callable = self.load()
2022-07-06T20:50:53.696454+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2022-07-06T20:50:53.696454+00:00 app[web.1]: return self.load_wsgiapp()
2022-07-06T20:50:53.696455+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
2022-07-06T20:50:53.696455+00:00 app[web.1]: return util.import_app(self.app_uri)
2022-07-06T20:50:53.696455+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/util.py", line 358, in import_app
2022-07-06T20:50:53.696455+00:00 app[web.1]: mod = importlib.import_module(module)
2022-07-06T20:50:53.696456+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/importlib/__init__.py", line 127, in import_module
2022-07-06T20:50:53.696456+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2022-07-06T20:50:53.696457+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
2022-07-06T20:50:53.696457+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 991, in _find_and_load
2022-07-06T20:50:53.696457+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
2022-07-06T20:50:53.696458+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
2022-07-06T20:50:53.696458+00:00 app[web.1]: File "<frozen importlib._bootstrap_external>", line 843, in exec_module
2022-07-06T20:50:53.696458+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2022-07-06T20:50:53.696459+00:00 app[web.1]: File "/app/app.py", line 5, in <module>
2022-07-06T20:50:53.696459+00:00 app[web.1]: from helper import message, get_db_connection, default, login_required
2022-07-06T20:50:53.696459+00:00 app[web.1]: File "/app/helper.py", line 2, in <module>
2022-07-06T20:50:53.696460+00:00 app[web.1]: from turtle import clear
2022-07-06T20:50:53.696462+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/turtle.py", line 107, in <module>
2022-07-06T20:50:53.696462+00:00 app[web.1]: import tkinter as TK
2022-07-06T20:50:53.696463+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/tkinter/__init__.py", line 36, in <module>
2022-07-06T20:50:53.696463+00:00 app[web.1]: import _tkinter # If this fails your Python may not be configured for Tk
2022-07-06T20:50:53.696463+00:00 app[web.1]: ModuleNotFoundError: No module named '_tkinter'
2022-07-06T20:50:53.696580+00:00 app[web.1]: [2022-07-06 20:50:53 +0000] [10] [INFO] Worker exiting (pid: 10)
2022-07-06T20:50:53.745546+00:00 app[web.1]: Traceback (most recent call last):
2022-07-06T20:50:53.745553+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 209, in run
2022-07-06T20:50:53.745765+00:00 app[web.1]: self.sleep()
2022-07-06T20:50:53.745775+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 357, in sleep
2022-07-06T20:50:53.745917+00:00 app[web.1]: ready = select.select([self.PIPE[0]], [], [], 1.0)
2022-07-06T20:50:53.745927+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
2022-07-06T20:50:53.746025+00:00 app[web.1]: self.reap_workers()
2022-07-06T20:50:53.746033+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
2022-07-06T20:50:53.746179+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2022-07-06T20:50:53.746222+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2022-07-06T20:50:53.746223+00:00 app[web.1]:
2022-07-06T20:50:53.746223+00:00 app[web.1]: During handling of the above exception, another exception occurred:
2022-07-06T20:50:53.746223+00:00 app[web.1]:
2022-07-06T20:50:53.746230+00:00 app[web.1]: Traceback (most recent call last):
2022-07-06T20:50:53.746232+00:00 app[web.1]: File "/app/.heroku/python/bin/gunicorn", line 8, in <module>
2022-07-06T20:50:53.746304+00:00 app[web.1]: sys.exit(run())
2022-07-06T20:50:53.746306+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/wsgiapp.py", line 58, in run
2022-07-06T20:50:53.746383+00:00 app[web.1]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2022-07-06T20:50:53.746398+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/base.py", line 228, in run
2022-07-06T20:50:53.746488+00:00 app[web.1]: super().run()
2022-07-06T20:50:53.746489+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/app/base.py", line 72, in run
2022-07-06T20:50:53.746561+00:00 app[web.1]: Arbiter(self).run()
2022-07-06T20:50:53.746563+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 229, in run
2022-07-06T20:50:53.746654+00:00 app[web.1]: self.halt(reason=inst.reason, exit_status=inst.exit_status)
2022-07-06T20:50:53.746656+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 342, in halt
2022-07-06T20:50:53.746772+00:00 app[web.1]: self.stop()
2022-07-06T20:50:53.746773+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 388, in stop
2022-07-06T20:50:53.746893+00:00 app[web.1]: limit = time.time() + self.cfg.graceful_timeout
2022-07-06T20:50:53.746894+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/config.py", line 57, in __getattr__
2022-07-06T20:50:53.746969+00:00 app[web.1]: return self.settings[name].get()
2022-07-06T20:50:53.746971+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
2022-07-06T20:50:53.747058+00:00 app[web.1]: self.reap_workers()
2022-07-06T20:50:53.747068+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.8/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
2022-07-06T20:50:53.747213+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2022-07-06T20:50:53.747235+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2022-07-06T20:50:53.882989+00:00 heroku[web.1]: Process exited with status 1
2022-07-06T20:50:53.927947+00:00 heroku[web.1]: State changed from up to crashed
2022-07-06T21:18:19.470130+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=tsuyo-workout.herokuapp.com request_id=767ea937-4ad8-46f4-ad68-a8fa68f8c15b fwd="184.189.121.138" dyno= connect= service= status=503 bytes= protocol=https
Related
I recently learned to code and built a Flask application which im trying to deploy on Heroku (https://github.com/RoiHirsh/Final-Project.git). The code H10 im getting is generic and im not able to come up with clues as to how to debug this just by looking at the heroku logs. One thing that comes up everywhere is "Exception in worker process" which im not sure what that refers to.
I tried all the variations of the Procfile I saw here on stackoverflow, created the virtual environment, activated it, freezed requirements, installed gunicorn, created the runtime.txt etc.
From what I saw as solutions here on stackoverflow, I know i didnt actively setup a PORT on heroku and therefore overidden the default heroku one, there seems to be 1 dyno working correctly (so the Procfile should be fine), I tried pushing from git multiple times to see if its an issue of some requirements not being installed correctly, etc.
Here is the long Heroku logs, and some of the related files I created:
runtime.txt
python-3.10.6
requirements.txt
cachelib==0.9.0
certifi==2022.6.15
charset-normalizer==2.1.0
click==8.1.3
colorama==0.4.4
cs50==9.2.0
distlib==0.3.4
filelock==3.7.1
Flask==2.1.2
Flask-Session==0.4.0
greenlet==1.1.2
gunicorn==20.0.4
idna==3.3
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.1
platformdirs==2.5.2
requests==2.28.1
six==1.16.0
SQLAlchemy==1.4.37
sqlparse==0.4.2
termcolor==1.1.0
urllib3==1.26.10
virtualenv==20.15.1
Werkzeug==2.1.2
Procfile
web: gunicorn app:app
app.py
from flask import Flask, render_template, request
import inputs # importing all inputs from a separate python file - inputs.py
import sqlite3
app = Flask(__name__)
# some code
#app.route('/')
def home():
#some code
#app.route('/dashboard', methods=['POST','GET'])
def dashboard():
#some code
if __name__ == '__main__':
app.run(debug=True)
And the long Heroku logs --tail message:
» Warning: heroku update available from 7.53.0 to 7.63.4.
2022-09-18T09:50:58.371266+00:00 app[web.1]: [2022-09-18 09:50:58 +0000] [10] [INFO] Booting worker with pid: 10
2022-09-18T09:50:58.710094+00:00 app[web.1]: [2022-09-18 09:50:58 +0000] [10] [ERROR] Exception in worker process
2022-09-18T09:50:58.710114+00:00 app[web.1]: Traceback (most recent call last):
2022-09-18T09:50:58.710115+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2022-09-18T09:50:58.710115+00:00 app[web.1]: worker.init_process()
2022-09-18T09:50:58.710116+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/workers/base.py", line 119, in init_process
2022-09-18T09:50:58.710116+00:00 app[web.1]: self.load_wsgi()
2022-09-18T09:50:58.710117+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
2022-09-18T09:50:58.710117+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2022-09-18T09:50:58.710118+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/app/base.py", line 67, in wsgi
2022-09-18T09:50:58.710118+00:00 app[web.1]: self.callable = self.load()
2022-09-18T09:50:58.710118+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2022-09-18T09:50:58.710119+00:00 app[web.1]: return self.load_wsgiapp()
2022-09-18T09:50:58.710119+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
2022-09-18T09:50:58.710119+00:00 app[web.1]: return util.import_app(self.app_uri)
2022-09-18T09:50:58.710119+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/util.py", line 358, in import_app
2022-09-18T09:50:58.710120+00:00 app[web.1]: mod = importlib.import_module(module)
2022-09-18T09:50:58.710120+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/importlib/__init__.py", line 126, in import_module
2022-09-18T09:50:58.710122+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2022-09-18T09:50:58.710122+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
2022-09-18T09:50:58.710122+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
2022-09-18T09:50:58.710122+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked2022-09-18T09:50:58.710122+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
2022-09-18T09:50:58.710123+00:00 app[web.1]: File "<frozen importlib._bootstrap_external>", line 883, in exec_module
2022-09-18T09:50:58.710123+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
2022-09-18T09:50:58.710123+00:00 app[web.1]: File "/app/app.py", line 2, in <module>
2022-09-18T09:50:58.710123+00:00 app[web.1]: import inputs # importing all inputs from a separate python file - inputs.py
2022-09-18T09:50:58.710123+00:00 app[web.1]: File "/app/inputs.py", line 13, in <module>
2022-09-18T09:50:58.710124+00:00 app[web.1]: cur.execute("SELECT * FROM daily_app_inputs WHERE dt = ?", temp) # fetching all the inputs for today
2022-09-18T09:50:58.710124+00:00 app[web.1]: sqlite3.OperationalError: no such table: daily_app_inputs
2022-09-18T09:50:58.710124+00:00 app[web.1]: [2022-09-18 09:50:58 +0000] [9] [ERROR] Exception in worker process
2022-09-18T09:50:58.710124+00:00 app[web.1]: Traceback (most recent call last):
2022-09-18T09:50:58.710124+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2022-09-18T09:50:58.710125+00:00 app[web.1]: worker.init_process()
2022-09-18T09:50:58.710125+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/workers/base.py", line 119, in init_process
2022-09-18T09:50:58.710125+00:00 app[web.1]: self.load_wsgi()
2022-09-18T09:50:58.710125+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
2022-09-18T09:50:58.710126+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2022-09-18T09:50:58.710126+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/app/base.py", line 67, in wsgi
2022-09-18T09:50:58.710126+00:00 app[web.1]: self.callable = self.load()
2022-09-18T09:50:58.710126+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2022-09-18T09:50:58.710126+00:00 app[web.1]: return self.load_wsgiapp()
2022-09-18T09:50:58.710133+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
2022-09-18T09:50:58.710134+00:00 app[web.1]: return util.import_app(self.app_uri)
2022-09-18T09:50:58.710134+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/util.py", line 358, in import_app
2022-09-18T09:50:58.710134+00:00 app[web.1]: mod = importlib.import_module(module)
2022-09-18T09:50:58.710134+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/importlib/__init__.py", line 126, in import_module
2022-09-18T09:50:58.710134+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2022-09-18T09:50:58.710134+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
2022-09-18T09:50:58.710135+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
2022-09-18T09:50:58.710135+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked2022-09-18T09:50:58.710135+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
2022-09-18T09:50:58.710135+00:00 app[web.1]: File "<frozen importlib._bootstrap_external>", line 883, in exec_module
2022-09-18T09:50:58.710135+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
2022-09-18T09:50:58.710135+00:00 app[web.1]: File "/app/app.py", line 2, in <module>
2022-09-18T09:50:58.710135+00:00 app[web.1]: import inputs # importing all inputs from a separate python file - inputs.py
2022-09-18T09:50:58.710136+00:00 app[web.1]: File "/app/inputs.py", line 13, in <module>
2022-09-18T09:50:58.710136+00:00 app[web.1]: cur.execute("SELECT * FROM daily_app_inputs WHERE dt = ?", temp) # fetching all the inputs for today
2022-09-18T09:50:58.710136+00:00 app[web.1]: sqlite3.OperationalError: no such table: daily_app_inputs
2022-09-18T09:50:58.710196+00:00 app[web.1]: [2022-09-18 09:50:58 +0000] [9] [INFO] Worker exiting (pid: 9)
2022-09-18T09:50:58.710196+00:00 app[web.1]: [2022-09-18 09:50:58 +0000] [10] [INFO] Worker exiting (pid: 10)
2022-09-18T09:50:58.765954+00:00 app[web.1]: Traceback (most recent call last):
2022-09-18T09:50:58.765963+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/arbiter.py", line 209, in run
2022-09-18T09:50:58.766171+00:00 app[web.1]: self.sleep()
2022-09-18T09:50:58.766179+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/arbiter.py", line 357, in sleep
2022-09-18T09:50:58.766297+00:00 app[web.1]: ready = select.select([self.PIPE[0]], [], [], 1.0)
2022-09-18T09:50:58.766305+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
2022-09-18T09:50:58.766407+00:00 app[web.1]: self.reap_workers()
2022-09-18T09:50:58.766415+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
2022-09-18T09:50:58.766534+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2022-09-18T09:50:58.766586+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2022-09-18T09:50:58.766589+00:00 app[web.1]:
2022-09-18T09:50:58.766590+00:00 app[web.1]: During handling of the above exception, another exception occurred:
2022-09-18T09:50:58.766590+00:00 app[web.1]:
2022-09-18T09:50:58.766597+00:00 app[web.1]: Traceback (most recent call last):
2022-09-18T09:50:58.766613+00:00 app[web.1]: File "/app/.heroku/python/bin/gunicorn", line 8, in <module>
2022-09-18T09:50:58.766683+00:00 app[web.1]: sys.exit(run())
2022-09-18T09:50:58.766692+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/app/wsgiapp.py", line 58, in run
2022-09-18T09:50:58.766760+00:00 app[web.1]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2022-09-18T09:50:58.766769+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/app/base.py", line 228, in run
2022-09-18T09:50:58.766854+00:00 app[web.1]: super().run()
2022-09-18T09:50:58.766862+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/app/base.py", line 72, in run
2022-09-18T09:50:58.766929+00:00 app[web.1]: Arbiter(self).run()
2022-09-18T09:50:58.766937+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/arbiter.py", line 229, in run
2022-09-18T09:50:58.767017+00:00 app[web.1]: self.halt(reason=inst.reason, exit_status=inst.exit_status)
2022-09-18T09:50:58.767044+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/arbiter.py", line 342, in halt
2022-09-18T09:50:58.767149+00:00 app[web.1]: self.stop()
2022-09-18T09:50:58.767162+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/arbiter.py", line 393, in stop
2022-09-18T09:50:58.767262+00:00 app[web.1]: time.sleep(0.1)
2022-09-18T09:50:58.767270+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
2022-09-18T09:50:58.767352+00:00 app[web.1]: self.reap_workers()
2022-09-18T09:50:58.767360+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.10/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
2022-09-18T09:50:58.767470+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2022-09-18T09:50:58.767516+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2022-09-18T09:50:58.768416+00:00 heroku[web.1]: State changed from starting to up
2022-09-18T09:50:58.918308+00:00 heroku[web.1]: Process exited with status 1
2022-09-18T09:50:59.020525+00:00 heroku[web.1]: State changed from up to crashed
2022-09-18T09:51:00.000000+00:00 app[api]: Build succeeded
2022-09-18T09:51:13.561288+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=final-project-roi.herokuapp.com request_id=1155ae19-6f42-4e07-be8a-f3e68cebb0dd fwd="77.125.130.159" dyno= connect= service= status=503 bytes= protocol=https
2022-09-18T09:51:14.563562+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=final-project-roi.herokuapp.com request_id=9cb8ca83-bc6d-4b0a-bd66-6ac06c310ea0 fwd="77.125.130.159" dyno= connect= service= status=503 bytes= protocol=https
This is my project folder screenshot:
project folders
Thank you in advance for any thought I might take to try and debug this.
I've been browsing all the options and advice on the internet for 14 days and I can't help it, please help me how to run a properly installed application on Heroku? I'm creating an application on Windows10 and I can't run "gunicorn" there locally, unfortunately, how do I debug or where am I making a mistake...?
2022-03-08T17:05:18.069332+00:00 heroku[web.1]: State changed from up to crashed
2022-03-08T17:05:18.091002+00:00 heroku[web.1]: State changed from crashed to starting
2022-03-08T17:05:17.994885+00:00 heroku[web.1]: Process exited with status 1
2022-03-08T17:05:24.550895+00:00 heroku[web.1]: Starting process with command gunicorn final_sda_project.wsgi --log-file -
2022-03-08T17:05:26.835207+00:00 heroku[web.1]: State changed from starting to up
2022-03-08T17:05:26.291724+00:00 app[web.1]: [2022-03-08 17:05:26 +0000] [4] [INFO] Starting gunicorn 20.1.0
2022-03-08T17:05:26.292294+00:00 app[web.1]: [2022-03-08 17:05:26 +0000] [4] [INFO] Listening at: http://0.0.0.0:12794 (4)
2022-03-08T17:05:26.292350+00:00 app[web.1]: [2022-03-08 17:05:26 +0000] [4] [INFO] Using worker: sync
2022-03-08T17:05:26.296152+00:00 app[web.1]: [2022-03-08 17:05:26 +0000] [9] [INFO] Booting worker with pid: 9
2022-03-08T17:05:26.399828+00:00 app[web.1]: [2022-03-08 17:05:26 +0000] [10] [INFO] Booting worker with pid: 10
2022-03-08T17:05:26.442367+00:00 app[web.1]: [2022-03-08 17:05:26 +0000] [11] [INFO] Booting worker with pid: 11
2022-03-08T17:05:27.924052+00:00 app[web.1]: [2022-03-08 17:05:27 +0000] [11] [ERROR] Exception in worker process
2022-03-08T17:05:27.924073+00:00 app[web.1]: Traceback (most recent call last):
2022-03-08T17:05:27.924074+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
2022-03-08T17:05:27.924074+00:00 app[web.1]: worker.init_process()
2022-03-08T17:05:27.924075+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
2022-03-08T17:05:27.924075+00:00 app[web.1]: self.load_wsgi()
2022-03-08T17:05:27.924075+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
2022-03-08T17:05:27.924076+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2022-03-08T17:05:27.924077+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
2022-03-08T17:05:27.924077+00:00 app[web.1]: self.callable = self.load()
2022-03-08T17:05:27.924077+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
2022-03-08T17:05:27.924077+00:00 app[web.1]: return self.load_wsgiapp()
2022-03-08T17:05:27.924078+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
2022-03-08T17:05:27.924078+00:00 app[web.1]: return util.import_app(self.app_uri)
2022-03-08T17:05:27.924078+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/util.py", line 359, in import_app
2022-03-08T17:05:27.924079+00:00 app[web.1]: mod = importlib.import_module(module)
2022-03-08T17:05:27.924079+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/importlib/init.py", line 127, in import_module
2022-03-08T17:05:27.924079+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2022-03-08T17:05:27.924080+00:00 app[web.1]: File "", line 1030, in _gcd_import
2022-03-08T17:05:27.924080+00:00 app[web.1]: File "", line 1007, in _find_and_load
2022-03-08T17:05:27.924081+00:00 app[web.1]: File "", line 986, in _find_and_load_unlocked
2022-03-08T17:05:27.924081+00:00 app[web.1]: File "", line 680, in _load_unlocked
2022-03-08T17:05:27.924081+00:00 app[web.1]: File "", line 850, in exec_module
2022-03-08T17:05:27.924081+00:00 app[web.1]: File "", line 228, in _call_with_frames_removed
2022-03-08T17:05:27.924082+00:00 app[web.1]: File "/app/final_sda_project/wsgi.py", line 16, in
2022-03-08T17:05:27.924082+00:00 app[web.1]: application = get_wsgi_application()
2022-03-08T17:05:27.924082+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2022-03-08T17:05:27.924082+00:00 app[web.1]: django.setup(set_prefix=False)
2022-03-08T17:05:27.924083+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/init.py", line 19, in setup
2022-03-08T17:05:27.924083+00:00 app[web.1]: configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2022-03-08T17:05:27.924083+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/conf/init.py", line 87, in getattr
2022-03-08T17:05:27.924083+00:00 app[web.1]: self._setup(name)
2022-03-08T17:05:27.924084+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/conf/init.py", line 74, in _setup
2022-03-08T17:05:27.924084+00:00 app[web.1]: self._wrapped = Settings(settings_module)
2022-03-08T17:05:27.924084+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/conf/init.py", line 183, in init
2022-03-08T17:05:27.924084+00:00 app[web.1]: mod = importlib.import_module(self.SETTINGS_MODULE)
2022-03-08T17:05:27.924085+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/importlib/init.py", line 127, in import_module
2022-03-08T17:05:27.924085+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2022-03-08T17:05:27.924085+00:00 app[web.1]: File "", line 1030, in _gcd_import
2022-03-08T17:05:27.924085+00:00 app[web.1]: File "", line 1007, in _find_and_load
2022-03-08T17:05:27.924086+00:00 app[web.1]: File "", line 986, in _find_and_load_unlocked
2022-03-08T17:05:27.924086+00:00 app[web.1]: File "", line 680, in _load_unlocked
2022-03-08T17:05:27.924086+00:00 app[web.1]: File "", line 850, in exec_module
2022-03-08T17:05:27.924086+00:00 app[web.1]: File "", line 228, in _call_with_frames_removed
2022-03-08T17:05:27.924086+00:00 app[web.1]: File "/app/final_sda_project/settings.py", line 154, in
2022-03-08T17:05:27.924087+00:00 app[web.1]: django_heroku.settings(locals())
2022-03-08T17:05:27.924087+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django_heroku/core.py", line 69, in settings
2022-03-08T17:05:27.924087+00:00 app[web.1]: config['DATABASES']['default'] = dj_database_url.config(conn_max_age=MAX_CONN_AGE, ssl_require=True)
2022-03-08T17:05:27.924088+00:00 app[web.1]: TypeError: config() got an unexpected keyword argument 'conn_max_age'
2022-03-08T17:05:27.924305+00:00 app[web.1]: [2022-03-08 17:05:27 +0000] [11] [INFO] Worker exiting (pid: 11)
2022-03-08T17:05:27.935940+00:00 app[web.1]: [2022-03-08 17:05:27 +0000] [10] [ERROR] Exception in worker process
2022-03-08T17:05:27.935942+00:00 app[web.1]: Traceback (most recent call last):
2022-03-08T17:05:27.935942+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
2022-03-08T17:05:27.935943+00:00 app[web.1]: worker.init_process()
2022-03-08T17:05:27.935943+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
2022-03-08T17:05:27.935944+00:00 app[web.1]: self.load_wsgi()
2022-03-08T17:05:27.935944+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
2022-03-08T17:05:27.935945+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2022-03-08T17:05:27.935945+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
2022-03-08T17:05:27.935946+00:00 app[web.1]: self.callable = self.load()
2022-03-08T17:05:27.935946+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
2022-03-08T17:05:27.935946+00:00 app[web.1]: return self.load_wsgiapp()
2022-03-08T17:05:27.935947+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
2022-03-08T17:05:27.935947+00:00 app[web.1]: return util.import_app(self.app_uri)
2022-03-08T17:05:27.935947+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/util.py", line 359, in import_app
2022-03-08T17:05:27.935947+00:00 app[web.1]: mod = importlib.import_module(module)
2022-03-08T17:05:27.935948+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/importlib/init.py", line 127, in import_module
2022-03-08T17:05:27.935948+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2022-03-08T17:05:27.935949+00:00 app[web.1]: File "", line 1030, in _gcd_import
2022-03-08T17:05:27.935949+00:00 app[web.1]: File "", line 1007, in _find_and_load
2022-03-08T17:05:27.935949+00:00 app[web.1]: File "", line 986, in _find_and_load_unlocked
2022-03-08T17:05:27.935949+00:00 app[web.1]: File "", line 680, in _load_unlocked
2022-03-08T17:05:27.935950+00:00 app[web.1]: File "", line 850, in exec_module
2022-03-08T17:05:27.935950+00:00 app[web.1]: File "", line 228, in _call_with_frames_removed
2022-03-08T17:05:27.935950+00:00 app[web.1]: File "/app/final_sda_project/wsgi.py", line 16, in
2022-03-08T17:05:27.935950+00:00 app[web.1]: application = get_wsgi_application()
2022-03-08T17:05:27.935951+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2022-03-08T17:05:27.935951+00:00 app[web.1]: django.setup(set_prefix=False)
2022-03-08T17:05:27.935951+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/init.py", line 19, in setup
2022-03-08T17:05:27.935951+00:00 app[web.1]: configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2022-03-08T17:05:27.935952+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/conf/init.py", line 87, in getattr
2022-03-08T17:05:27.935952+00:00 app[web.1]: self._setup(name)
2022-03-08T17:05:27.935952+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/conf/init.py", line 74, in _setup
2022-03-08T17:05:27.935953+00:00 app[web.1]: self._wrapped = Settings(settings_module)
2022-03-08T17:05:27.935953+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/conf/init.py", line 183, in init
2022-03-08T17:05:27.935953+00:00 app[web.1]: mod = importlib.import_module(self.SETTINGS_MODULE)
2022-03-08T17:05:27.935961+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/importlib/init.py", line 127, in import_module
2022-03-08T17:05:27.935961+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2022-03-08T17:05:27.935961+00:00 app[web.1]: File "", line 1030, in _gcd_import
2022-03-08T17:05:27.935961+00:00 app[web.1]: File "", line 1007, in _find_and_load
2022-03-08T17:05:27.935962+00:00 app[web.1]: File "", line 986, in _find_and_load_unlocked
2022-03-08T17:05:27.935962+00:00 app[web.1]: File "", line 680, in _load_unlocked
2022-03-08T17:05:27.935962+00:00 app[web.1]: File "", line 850, in exec_module
2022-03-08T17:05:27.935962+00:00 app[web.1]: File "", line 228, in _call_with_frames_removed
2022-03-08T17:05:27.935963+00:00 app[web.1]: File "/app/final_sda_project/settings.py", line 154, in
2022-03-08T17:05:27.935963+00:00 app[web.1]: django_heroku.settings(locals())
2022-03-08T17:05:27.935963+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django_heroku/core.py", line 69, in settings
2022-03-08T17:05:27.935964+00:00 app[web.1]: config['DATABASES']['default'] = dj_database_url.config(conn_max_age=MAX_CONN_AGE, ssl_require=True)
2022-03-08T17:05:27.935964+00:00 app[web.1]: TypeError: config() got an unexpected keyword argument 'conn_max_age'
2022-03-08T17:05:27.936163+00:00 app[web.1]: [2022-03-08 17:05:27 +0000] [10] [INFO] Worker exiting (pid: 10)
2022-03-08T17:05:27.946046+00:00 app[web.1]: [2022-03-08 17:05:27 +0000] [9] [ERROR] Exception in worker process
2022-03-08T17:05:27.946048+00:00 app[web.1]: Traceback (most recent call last):
2022-03-08T17:05:27.946049+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
2022-03-08T17:05:27.946050+00:00 app[web.1]: worker.init_process()
2022-03-08T17:05:27.946050+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py", line 134, in init_process
2022-03-08T17:05:27.946051+00:00 app[web.1]: self.load_wsgi()
2022-03-08T17:05:27.946051+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
2022-03-08T17:05:27.946051+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2022-03-08T17:05:27.946052+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/base.py", line 67, in wsgi
2022-03-08T17:05:27.946052+00:00 app[web.1]: self.callable = self.load()
2022-03-08T17:05:27.946053+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
2022-03-08T17:05:27.946054+00:00 app[web.1]: return self.load_wsgiapp()
2022-03-08T17:05:27.946054+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
2022-03-08T17:05:27.946054+00:00 app[web.1]: return util.import_app(self.app_uri)
2022-03-08T17:05:27.946060+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/gunicorn/util.py", line 359, in import_app
2022-03-08T17:05:27.946060+00:00 app[web.1]: mod = importlib.import_module(module)
2022-03-08T17:05:27.946061+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/importlib/init.py", line 127, in import_module
2022-03-08T17:05:27.946061+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2022-03-08T17:05:27.946062+00:00 app[web.1]: File "", line 1030, in _gcd_import
2022-03-08T17:05:27.946062+00:00 app[web.1]: File "", line 1007, in _find_and_load
2022-03-08T17:05:27.946062+00:00 app[web.1]: File "", line 986, in _find_and_load_unlocked
2022-03-08T17:05:27.946063+00:00 app[web.1]: File "", line 680, in _load_unlocked
2022-03-08T17:05:27.946063+00:00 app[web.1]: File "", line 850, in exec_module
2022-03-08T17:05:27.946063+00:00 app[web.1]: File "", line 228, in _call_with_frames_removed
2022-03-08T17:05:27.946064+00:00 app[web.1]: File "/app/final_sda_project/wsgi.py", line 16, in
2022-03-08T17:05:27.946064+00:00 app[web.1]: application = get_wsgi_application()
2022-03-08T17:05:27.946064+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2022-03-08T17:05:27.946065+00:00 app[web.1]: django.setup(set_prefix=False)
2022-03-08T17:05:27.946065+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/init.py", line 19, in setup
2022-03-08T17:05:27.946065+00:00 app[web.1]: configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2022-03-08T17:05:27.946065+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/conf/init.py", line 87, in getattr
2022-03-08T17:05:27.946066+00:00 app[web.1]: self._setup(name)
2022-03-08T17:05:27.946066+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/conf/init.py", line 74, in _setup
2022-03-08T17:05:27.946066+00:00 app[web.1]: self._wrapped = Settings(settings_module)
2022-03-08T17:05:27.946067+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django/conf/init.py", line 183, in init
2022-03-08T17:05:27.946067+00:00 app[web.1]: mod = importlib.import_module(self.SETTINGS_MODULE)
2022-03-08T17:05:27.946067+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/importlib/init.py", line 127, in import_module
2022-03-08T17:05:27.946068+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2022-03-08T17:05:27.946068+00:00 app[web.1]: File "", line 1030, in _gcd_import
2022-03-08T17:05:27.946068+00:00 app[web.1]: File "", line 1007, in _find_and_load
2022-03-08T17:05:27.946069+00:00 app[web.1]: File "", line 986, in _find_and_load_unlocked
2022-03-08T17:05:27.946069+00:00 app[web.1]: File "", line 680, in _load_unlocked
2022-03-08T17:05:27.946069+00:00 app[web.1]: File "", line 850, in exec_module
2022-03-08T17:05:27.946070+00:00 app[web.1]: File "", line 228, in _call_with_frames_removed
2022-03-08T17:05:27.946070+00:00 app[web.1]: File "/app/final_sda_project/settings.py", line 154, in
2022-03-08T17:05:27.946070+00:00 app[web.1]: django_heroku.settings(locals())
2022-03-08T17:05:27.946071+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django_heroku/core.py", line 69, in settings
2022-03-08T17:05:27.946071+00:00 app[web.1]: config['DATABASES']['default'] = dj_database_url.config(conn_max_age=MAX_CONN_AGE, ssl_require=True)
2022-03-08T17:05:27.946071+00:00 app[web.1]: TypeError: config() got an unexpected keyword argument 'conn_max_age'
2022-03-08T17:05:27.946283+00:00 app[web.1]: [2022-03-08 17:05:27 +0000] [9] [INFO] Worker exiting (pid: 9)
2022-03-08T17:05:28.022283+00:00 app[web.1]: [2022-03-08 17:05:28 +0000] [4] [WARNING] Worker with pid 10 was terminated due to signal 15
2022-03-08T17:05:28.026103+00:00 app[web.1]: [2022-03-08 17:05:28 +0000] [4] [WARNING] Worker with pid 9 was terminated due to signal 15
2022-03-08T17:05:28.115867+00:00 app[web.1]: [2022-03-08 17:05:28 +0000] [4] [INFO] Shutting down: Master
2022-03-08T17:05:28.116159+00:00 app[web.1]: [2022-03-08 17:05:28 +0000] [4] [INFO] Reason: Worker failed to boot.
2022-03-08T17:05:28.373912+00:00 heroku[web.1]: Process exited with status 3
2022-03-08T17:05:28.561601+00:00 heroku[web.1]: State changed from up to crashed
Check line 69 in your settings.py file, it is not getting the default database.
As you can see from the error code
08T17:05:27.946071+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/site-packages/django_heroku/core.py", line 69, in settings 2022-03-08T17:05:27.946071+00:00 app[web.1]: config['DATABASES']['default'] =
I need your help colleagues. I am trying to deploy my Django Project on Heroku but I am getting a seemingly simple error but I have struggled to debug it for days. I would appreciate detailed help, I am a newbie. Thanking you in advance.
Background I have hidden foldername because it is also a domainname I want to register.
I have python 3.6.8 and Django 2.1.1 on a windows10 machine and Heroku PaaS. At first I was using Django 2.2 then downgraded to Django 2.1. by command pipenv install djang0==2.1.1
Project works perfectly on local/development server i.e python manage runserver works .
The secret key is set SECRET_KEY = os.environ.get('SECRET'), I have also tried hard coding SECRET_KEY = 'my-secret-key' but no difference.
I have os.environ.setdefault('DJANGO_SETTINGS_MODULE', '*foldername.settings.testing') correctly set in wsgi.py & manage.py
Other Settings
My Procfile for Heroku has web: gunicorn *foldername.wsgi:application --log-file -. I have a requirements and a runtime.txt files.
Error When I run $ heroku run python manage.py migrate
Running python manage.py migrate on ⬢ thawing-thicket-02648... up, run.2948 (Free)
Traceback (most recent call last):
File "manage.py", line 22, in <module>
main()
File "manage.py", line 18, in main
execute_from_command_line(sys.argv)
File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
utility.execute()
File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 224, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/__init__.py", line 36, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/app/.heroku/python/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/app/.heroku/python/lib/python3.6/site-packages/django/core/management/commands/migrate.py", line 14, in <module>
from django.db.migrations.autodetector import MigrationAutodetector
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/migrations/autodetector.py", line 11, in <module>
from django.db.migrations.questioner import MigrationQuestioner
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/migrations/questioner.py", line 9, in <module>
from .loader import MigrationLoader
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/migrations/loader.py", line 8, in <module>
from django.db.migrations.recorder import MigrationRecorder
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 9, in <module>
class MigrationRecorder:
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/migrations/recorder.py", line 22, in MigrationRecorder
class Migration(models.Model):
File "/app/.heroku/python/lib/python3.6/site-packages/django/db/models/base.py", line 87, in __new__
app_config = apps.get_containing_app_config(module)
File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/registry.py", line 249, in get_containing_app_config
self.check_apps_ready()
File "/app/.heroku/python/lib/python3.6/site-packages/django/apps/registry.py", line 131, in check_apps_ready
settings.INSTALLED_APPS
File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 57, in __getattr__
self._setup(name)
File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 44, in _setup
self._wrapped = Settings(settings_module)
File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 126, in __init__
raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
Running $ heroku logs --tail produces
2020-01-29T15:56:40.652606+00:00 app[web.1]: self.reap_workers()
2020-01-29T15:56:40.652609+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
2020-01-29T15:56:40.652893+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2020-01-29T15:56:40.652896+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2020-01-29T15:56:40.745655+00:00 heroku[web.1]: State changed from starting to crashed
2020-01-29T15:56:40.725433+00:00 heroku[web.1]: Process exited with status 1
2020-01-29T16:21:03.239311+00:00 app[api]: Starting process with command `python manage.py migrate` by user developers#email.com
2020-01-29T16:21:11.782005+00:00 heroku[run.2948]: State changed from starting to up
2020-01-29T16:21:11.639515+00:00 heroku[run.2948]: Awaiting client
2020-01-29T16:21:11.664869+00:00 heroku[run.2948]: Starting process with command `python manage.py migrate`
2020-01-29T16:21:16.264816+00:00 heroku[run.2948]: State changed from up to complete
2020-01-29T16:21:16.241764+00:00 heroku[run.2948]: Process exited with status 1
2020-01-29T16:23:33.250194+00:00 heroku[web.1]: State changed from crashed to starting
2020-01-29T16:23:39.991409+00:00 heroku[web.1]: Starting process with command `gunicorn foldername.wsgi --log-file -`
2020-01-29T16:23:42.075462+00:00 app[web.1]: [2020-01-29 16:23:42 +0000] [4] [INFO] Starting gunicorn 20.0.4
2020-01-29T16:23:42.076104+00:00 app[web.1]: [2020-01-29 16:23:42 +0000] [4] [INFO] Listening at: http://0.0.0.0:34607 (4)
2020-01-29T16:23:42.076210+00:00 app[web.1]: [2020-01-29 16:23:42 +0000] [4] [INFO] Using worker: sync
2020-01-29T16:23:42.080161+00:00 app[web.1]: [2020-01-29 16:23:42 +0000] [10] [INFO] Booting worker with pid: 10
2020-01-29T16:23:42.131810+00:00 app[web.1]: [2020-01-29 16:23:42 +0000] [11] [INFO] Booting worker with pid: 11
2020-01-29T16:23:42.302136+00:00 app[web.1]: [2020-01-29 16:23:42 +0000] [10] [ERROR] Exception in worker process
2020-01-29T16:23:42.302140+00:00 app[web.1]: Traceback (most recent call last):
2020-01-29T16:23:42.302160+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2020-01-29T16:23:42.302163+00:00 app[web.1]: worker.init_process()
2020-01-29T16:23:42.302165+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 119, in init_process
2020-01-29T16:23:42.302167+00:00 app[web.1]: self.load_wsgi()
2020-01-29T16:23:42.302169+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
2020-01-29T16:23:42.302171+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2020-01-29T16:23:42.302173+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
2020-01-29T16:23:42.302176+00:00 app[web.1]: self.callable = self.load()
2020-01-29T16:23:42.302178+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2020-01-29T16:23:42.302180+00:00 app[web.1]: return self.load_wsgiapp()
2020-01-29T16:23:42.302182+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
2020-01-29T16:23:42.302184+00:00 app[web.1]: return util.import_app(self.app_uri)
2020-01-29T16:23:42.302186+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/util.py", line 358, in import_app
2020-01-29T16:23:42.302188+00:00 app[web.1]: mod = importlib.import_module(module)
2020-01-29T16:23:42.302190+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/importlib/__init__.py", line 126, in import_module
2020-01-29T16:23:42.302193+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2020-01-29T16:23:42.302195+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 994, in _gcd_import
2020-01-29T16:23:42.302197+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 971, in _find_and_load
2020-01-29T16:23:42.302199+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
2020-01-29T16:23:42.302201+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
2020-01-29T16:23:42.302203+00:00 app[web.1]: File "<frozen importlib._bootstrap_external>", line 678, in exec_module
2020-01-29T16:23:42.302205+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2020-01-29T16:23:42.302207+00:00 app[web.1]: File "/app/foldername/wsgi.py", line 15, in <module>
2020-01-29T16:23:42.302209+00:00 app[web.1]: application = get_wsgi_application()
2020-01-29T16:23:42.302211+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2020-01-29T16:23:42.302213+00:00 app[web.1]: django.setup(set_prefix=False)
2020-01-29T16:23:42.302215+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/__init__.py", line 19, in setup
2020-01-29T16:23:42.302217+00:00 app[web.1]: configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2020-01-29T16:23:42.302219+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 57, in __getattr__
2020-01-29T16:23:42.302221+00:00 app[web.1]: self._setup(name)
2020-01-29T16:23:42.302224+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 44, in _setup
2020-01-29T16:23:42.302226+00:00 app[web.1]: self._wrapped = Settings(settings_module)
2020-01-29T16:23:42.302228+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 126, in __init__
2020-01-29T16:23:42.302230+00:00 app[web.1]: raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
2020-01-29T16:23:42.302240+00:00 app[web.1]: django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
2020-01-29T16:23:42.302620+00:00 app[web.1]: [2020-01-29 16:23:42 +0000] [10] [INFO] Worker exiting (pid: 10)
2020-01-29T16:23:42.322533+00:00 app[web.1]: [2020-01-29 16:23:42 +0000] [11] [ERROR] Exception in worker process
2020-01-29T16:23:42.322537+00:00 app[web.1]: Traceback (most recent call last):
2020-01-29T16:23:42.322539+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2020-01-29T16:23:42.322542+00:00 app[web.1]: worker.init_process()
2020-01-29T16:23:42.322544+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 119, in init_process
2020-01-29T16:23:42.322545+00:00 app[web.1]: self.load_wsgi()
2020-01-29T16:23:42.322547+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
2020-01-29T16:23:42.322549+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2020-01-29T16:23:42.322552+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
2020-01-29T16:23:42.322554+00:00 app[web.1]: self.callable = self.load()
2020-01-29T16:23:42.322556+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2020-01-29T16:23:42.322558+00:00 app[web.1]: return self.load_wsgiapp()
2020-01-29T16:23:42.322560+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
2020-01-29T16:23:42.322562+00:00 app[web.1]: return util.import_app(self.app_uri)
2020-01-29T16:23:42.322564+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/util.py", line 358, in import_app
2020-01-29T16:23:42.322566+00:00 app[web.1]: mod = importlib.import_module(module)
2020-01-29T16:23:42.322568+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/importlib/__init__.py", line 126, in import_module
2020-01-29T16:23:42.322570+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2020-01-29T16:23:42.322572+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 994, in _gcd_import
2020-01-29T16:23:42.322574+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 971, in _find_and_load
2020-01-29T16:23:42.322576+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
2020-01-29T16:23:42.322578+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
2020-01-29T16:23:42.322580+00:00 app[web.1]: File "<frozen importlib._bootstrap_external>", line 678, in exec_module
2020-01-29T16:23:42.322582+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2020-01-29T16:23:42.322584+00:00 app[web.1]: File "/app/foldername/wsgi.py", line 15, in <module>
2020-01-29T16:23:42.322586+00:00 app[web.1]: application = get_wsgi_application()
2020-01-29T16:23:42.322588+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2020-01-29T16:23:42.322590+00:00 app[web.1]: django.setup(set_prefix=False)
2020-01-29T16:23:42.322592+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/__init__.py", line 19, in setup
2020-01-29T16:23:42.322594+00:00 app[web.1]: configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2020-01-29T16:23:42.322596+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 57, in __getattr__
2020-01-29T16:23:42.322598+00:00 app[web.1]: self._setup(name)
2020-01-29T16:23:42.322600+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 44, in _setup
2020-01-29T16:23:42.322602+00:00 app[web.1]: self._wrapped = Settings(settings_module)
2020-01-29T16:23:42.322604+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 126, in __init__
2020-01-29T16:23:42.322606+00:00 app[web.1]: raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
2020-01-29T16:23:42.322609+00:00 app[web.1]: django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
2020-01-29T16:23:42.322958+00:00 app[web.1]: [2020-01-29 16:23:42 +0000] [11] [INFO] Worker exiting (pid: 11)
2020-01-29T16:23:42.449777+00:00 app[web.1]: [2020-01-29 16:23:42 +0000] [4] [INFO] Shutting down: Master
2020-01-29T16:23:42.469241+00:00 app[web.1]: [2020-01-29 16:23:42 +0000] [4] [INFO] Reason: Worker failed to boot.
2020-01-29T16:23:42.572344+00:00 heroku[web.1]: State changed from starting to crashed
2020-01-29T16:23:42.557638+00:00 heroku[web.1]: Process exited with status 3
Normal $ python manage.py migrate without heroku run part does the migrations but app still won't start and error trace back from $ heroku logs --tail still present and the same
See my folder structure & wsgi.py
See my manage.py
Settings just to show secret key is in
Long time has passed but if I had seen this I would have saved a couple hours. I had the same issue as I had forgot to set the SECRET_KEY variable in the Heroku config vars.
I am deploying an e-commerce project to Heroku and seem to be running into constant issues and errors.
My latest error surrounds the below traceback:
2019-11-11T13:35:34.080363+00:00 heroku[web.1]: State changed from crashed to starting
2019-11-11T13:35:40.020789+00:00 heroku[web.1]: Starting process with command `gunicorn fancyfetish.wsgi:application --preload --workers 1`
2019-11-11T13:35:42.589255+00:00 heroku[web.1]: State changed from starting to crashed
2019-11-11T13:35:42.460008+00:00 app[web.1]: Traceback (most recent call last):
2019-11-11T13:35:42.460049+00:00 app[web.1]: File "/app/.heroku/python/bin/gunicorn", line 11, in <module>
2019-11-11T13:35:42.460136+00:00 app[web.1]: sys.exit(run())
2019-11-11T13:35:42.460148+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 58, in run
2019-11-11T13:35:42.460262+00:00 app[web.1]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2019-11-11T13:35:42.460273+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 219, in run
2019-11-11T13:35:42.460434+00:00 app[web.1]: super().run()
2019-11-11T13:35:42.460438+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 72, in run
2019-11-11T13:35:42.460565+00:00 app[web.1]: Arbiter(self).run()
2019-11-11T13:35:42.460571+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 58, in __init__
2019-11-11T13:35:42.460689+00:00 app[web.1]: self.setup(app)
2019-11-11T13:35:42.460692+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 118, in setup
2019-11-11T13:35:42.460823+00:00 app[web.1]: self.app.wsgi()
2019-11-11T13:35:42.460827+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 67, in wsgi
2019-11-11T13:35:42.460978+00:00 app[web.1]: self.callable = self.load()
2019-11-11T13:35:42.460981+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2019-11-11T13:35:42.461083+00:00 app[web.1]: return self.load_wsgiapp()
2019-11-11T13:35:42.461087+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-11T13:35:42.461204+00:00 app[web.1]: return util.import_app(self.app_uri)
2019-11-11T13:35:42.461207+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/util.py", line 331, in import_app
2019-11-11T13:35:42.461388+00:00 app[web.1]: mod = importlib.import_module(module)
2019-11-11T13:35:42.461392+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/importlib/__init__.py", line 126, in import_module
2019-11-11T13:35:42.461529+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2019-11-11T13:35:42.461542+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 994, in _gcd_import
2019-11-11T13:35:42.461664+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 971, in _find_and_load
2019-11-11T13:35:42.461737+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
2019-11-11T13:35:42.461813+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
2019-11-11T13:35:42.461888+00:00 app[web.1]: File "<frozen importlib._bootstrap_external>", line 678, in exec_module
2019-11-11T13:35:42.461983+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2019-11-11T13:35:42.462061+00:00 app[web.1]: File "/app/fancyfetish/wsgi.py", line 17, in <module>
2019-11-11T13:35:42.462171+00:00 app[web.1]: application = get_wsgi_application()
2019-11-11T13:35:42.462176+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/core/wsgi.py", line 12, in get_wsgi_application
2019-11-11T13:35:42.462279+00:00 app[web.1]: django.setup(set_prefix=False)
2019-11-11T13:35:42.462298+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/__init__.py", line 19, in setup
2019-11-11T13:35:42.462381+00:00 app[web.1]: configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2019-11-11T13:35:42.462385+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 79, in __getattr__
2019-11-11T13:35:42.462516+00:00 app[web.1]: self._setup(name)
2019-11-11T13:35:42.462519+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 66, in _setup
2019-11-11T13:35:42.462637+00:00 app[web.1]: self._wrapped = Settings(settings_module)
2019-11-11T13:35:42.462639+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/django/conf/__init__.py", line 176, in __init__
2019-11-11T13:35:42.462783+00:00 app[web.1]: raise ImproperlyConfigured("The SECRET_KEY setting must not be empty.")
2019-11-11T13:35:42.462808+00:00 app[web.1]: django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty.
2019-11-11T13:35:42.575764+00:00 heroku[web.1]: Process exited with status 1
2019-11-11T13:35:47.000000+00:00 app[api]: Build succeeded
2019-11-11T13:36:25.358883+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=fancyfetish.herokuapp.com request_id=4f0e5e77-53c9-443a-8647-c5b88a01ae17 fwd="81.100.164.113" dyno= connect= service= status=503 bytes= protocol=https
2019-11-11T13:36:25.563374+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=fancyfetish.herokuapp.com request_id=3828cca1-593c-4785-9c82-6b614c233dea fwd="81.100.164.113" dyno= connect= service= status=503 bytes= protocol=https
I have got three settings files under the directory settings, outlined below:
|____settings
| |______init__.py
| |____development.py
| |______pycache__
| | |____production.cpython-37.pyc
| | |____base.cpython-37.pyc
| | |____development.cpython-37.pyc
| | |______init__.cpython-37.pyc
| |____base.py
| |____production.py
|______init__.py
|______pycache__
| |____settings.cpython-37.pyc
| |____wsgi.cpython-37.pyc
| |____urls.cpython-37.pyc
| |______init__.cpython-37.pyc
|____urls.py
|____wsgi.py
All three of my settings files (base.py, development.py and production.py) have a SECRET_KEY defined so I am not sure why this error keeps appearing.
The SECRET_KEY is randomly generated. Is this to do with gunicorn?
My wsgi file looks like this:
import os
from django.core.wsgi import get_wsgi_application
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'fancyfetish.settings')
application = get_wsgi_application()
(I am unsure if I even need to import from django.core.wsgi but this seemed to be someone elses solution, it didn't work for me)
My Procfile looks like this:
web: gunicorn fancyfetish.wsgi:application --preload --workers 1
My requirements.txt file looks like this:
beautifulsoup4==4.8.1
Django==2.2.6
django-appconf==1.0.3
django-bootstrap4==1.0.1
django-compressor==2.3
django-libsass==0.7
django-sass-processor==0.7.4
gunicorn==20.0.0
libsass==0.19.3
mysql-connector-python==8.0.18
Pillow==6.2.1
protobuf==3.10.0
pytz==2019.3
rcssmin==1.0.6
rjsmin==1.1.0
six==1.12.0
soupsieve==1.9.5
sqlparse==0.3.0
Is anyone able to see whay I am doing so wrong? Is it a compatibility issue between versions?
Try changing this line in your wsgi file:
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'fancyfetish.settings')
for this:
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'fancyfetish.settings.development') # or .production
Follow the log:
2016-03-05T15:09:05.318884+00:00 app[web.1]: worker.init_process()
2016-03-05T15:09:05.318885+00:00 app[web.1]: self.load_wsgi()
2016-03-05T15:09:05.318888+00:00 app[web.1]: self.callable = self.load()
2016-03-05T15:09:05.318886+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2016-03-05T15:09:05.318888+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
2016-03-05T15:09:05.318890+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2016-03-05T15:09:05.318885+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 122, in init_process
2016-03-05T15:09:05.318893+00:00 app[web.1]: application = get_wsgi_application()
2016-03-05T15:09:05.318895+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/__init__.py", line 17, in setup
2016-03-05T15:09:05.318889+00:00 app[web.1]: return self.load_wsgiapp()
2016-03-05T15:09:05.318891+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 357, in import_app
2016-03-05T15:09:05.318892+00:00 app[web.1]: File "/app/redewebsite/wsgi.py", line 21, in <module>
2016-03-05T15:09:05.319022+00:00 app[web.1]: [2016-03-05 15:09:05 +0000] [9] [INFO] Worker exiting (pid: 9)
2016-03-05T15:09:05.318890+00:00 app[web.1]: return util.import_app(self.app_uri)
2016-03-05T15:09:05.318894+00:00 app[web.1]: django.setup()
2016-03-05T15:09:05.318896+00:00 app[web.1]: configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2016-03-05T15:09:05.318897+00:00 app[web.1]: self._setup(name)
2016-03-05T15:09:05.324196+00:00 app[web.1]: [2016-03-05 15:09:05 +0000] [10] [ERROR] Exception in worker process:
2016-03-05T15:09:05.318892+00:00 app[web.1]: __import__(module)
2016-03-05T15:09:05.318896+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 55, in __getattr__
2016-03-05T15:09:05.324211+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 122, in init_process
2016-03-05T15:09:05.324212+00:00 app[web.1]: self.load_wsgi()
2016-03-05T15:09:05.324213+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 130, in load_wsgi
2016-03-05T15:09:05.324215+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
2016-03-05T15:09:05.318894+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
2016-03-05T15:09:05.318898+00:00 app[web.1]: % (desc, ENVIRONMENT_VARIABLE))
2016-03-05T15:09:05.324216+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2016-03-05T15:09:05.318898+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 41, in _setup
2016-03-05T15:09:05.324216+00:00 app[web.1]: return self.load_wsgiapp()
2016-03-05T15:09:05.324221+00:00 app[web.1]: django.setup()
2016-03-05T15:09:05.324219+00:00 app[web.1]: File "/app/redewebsite/wsgi.py", line 21, in <module>
2016-03-05T15:09:05.318899+00:00 app[web.1]: ImproperlyConfigured: Requested setting LOGGING_CONFIG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
2016-03-05T15:09:05.324222+00:00 app[web.1]: configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2016-03-05T15:09:05.324208+00:00 app[web.1]: Traceback (most recent call last):
2016-03-05T15:09:05.324213+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2016-03-05T15:09:05.324214+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2016-03-05T15:09:05.324210+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 515, in spawn_worker
2016-03-05T15:09:05.324211+00:00 app[web.1]: worker.init_process()
2016-03-05T15:09:05.324218+00:00 app[web.1]: __import__(module)
2016-03-05T15:09:05.324214+00:00 app[web.1]: self.callable = self.load()
2016-03-05T15:09:05.324220+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
2016-03-05T15:09:05.324224+00:00 app[web.1]: self._setup(name)
2016-03-05T15:09:05.324217+00:00 app[web.1]: return util.import_app(self.app_uri)
2016-03-05T15:09:05.324218+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 357, in import_app
2016-03-05T15:09:05.324220+00:00 app[web.1]: application = get_wsgi_application()
2016-03-05T15:09:05.324251+00:00 app[web.1]: self.load_wsgi()
2016-03-05T15:09:05.324225+00:00 app[web.1]: % (desc, ENVIRONMENT_VARIABLE))
2016-03-05T15:09:05.324250+00:00 app[web.1]: worker.init_process()
2016-03-05T15:09:05.324248+00:00 app[web.1]: Traceback (most recent call last):
2016-03-05T15:09:05.324226+00:00 app[web.1]: ImproperlyConfigured: Requested setting LOGGING_CONFIG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
2016-03-05T15:09:05.324252+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 130, in load_wsgi
2016-03-05T15:09:05.324224+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 41, in _setup
2016-03-05T15:09:05.324250+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 515, in spawn_worker
2016-03-05T15:09:05.324255+00:00 app[web.1]: return self.load_wsgiapp()
2016-03-05T15:09:05.324222+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/__init__.py", line 17, in setup
2016-03-05T15:09:05.324223+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 55, in __getattr__
2016-03-05T15:09:05.324255+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2016-03-05T15:09:05.324253+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2016-03-05T15:09:05.324254+00:00 app[web.1]: self.callable = self.load()
2016-03-05T15:09:05.324251+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 122, in init_process
2016-03-05T15:09:05.324252+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2016-03-05T15:09:05.324254+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
2016-03-05T15:09:05.324256+00:00 app[web.1]: return util.import_app(self.app_uri)
2016-03-05T15:09:05.324258+00:00 app[web.1]: application = get_wsgi_application()
2016-03-05T15:09:05.324259+00:00 app[web.1]: django.setup()
2016-03-05T15:09:05.324259+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/core/wsgi.py", line 13, in get_wsgi_application
2016-03-05T15:09:05.324260+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/__init__.py", line 17, in setup
2016-03-05T15:09:05.324261+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 55, in __getattr__
2016-03-05T15:09:05.324257+00:00 app[web.1]: __import__(module)
2016-03-05T15:09:05.324258+00:00 app[web.1]: File "/app/redewebsite/wsgi.py", line 21, in <module>
2016-03-05T15:09:05.324264+00:00 app[web.1]: ImproperlyConfigured: Requested setting LOGGING_CONFIG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
2016-03-05T15:09:05.382734+00:00 app[web.1]: Traceback (most recent call last):
2016-03-05T15:09:05.324257+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 357, in import_app
2016-03-05T15:09:05.324261+00:00 app[web.1]: configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
2016-03-05T15:09:05.324262+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/django/conf/__init__.py", line 41, in _setup
2016-03-05T15:09:05.324262+00:00 app[web.1]: self._setup(name)
2016-03-05T15:09:05.324263+00:00 app[web.1]: % (desc, ENVIRONMENT_VARIABLE))
2016-03-05T15:09:05.383454+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 72, in run
2016-03-05T15:09:05.383456+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 206, in run
2016-03-05T15:09:05.324374+00:00 app[web.1]: [2016-03-05 15:09:05 +0000] [10] [INFO] Worker exiting (pid: 10)
2016-03-05T15:09:05.382767+00:00 app[web.1]: sys.exit(run())
2016-03-05T15:09:05.383460+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 219, in handle_chld
2016-03-05T15:09:05.382753+00:00 app[web.1]: File "/app/.heroku/python/bin/gunicorn", line 11, in <module>
2016-03-05T15:09:05.383455+00:00 app[web.1]: Arbiter(self).run()
2016-03-05T15:09:05.383460+00:00 app[web.1]: time.sleep(0.1)
2016-03-05T15:09:05.383457+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 302, in halt
2016-03-05T15:09:05.382793+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
2016-03-05T15:09:05.383457+00:00 app[web.1]: self.halt(reason=inst.reason, exit_status=inst.exit_status)
2016-03-05T15:09:05.383458+00:00 app[web.1]: self.stop()
2016-03-05T15:09:05.383459+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 347, in stop
2016-03-05T15:09:05.383462+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2016-03-05T15:09:05.382834+00:00 app[web.1]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2016-03-05T15:09:05.382860+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 192, in run
2016-03-05T15:09:05.383453+00:00 app[web.1]: super(Application, self).run()
2016-03-05T15:09:05.383461+00:00 app[web.1]: self.reap_workers()
2016-03-05T15:09:05.383462+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 464, in reap_workers
2016-03-05T15:09:05.383463+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2016-03-05T15:09:06.271890+00:00 heroku[web.1]: Process exited with status 1
2016-03-05T15:09:06.284071+00:00 heroku[web.1]: State changed from starting to crashed
2016-03-05T15:09:08.486440+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=redewebsite.herokuapp.com request_id=083bbcbc-0cac-459b-af5b-c7ea9f59e080 fwd="189.48.111.130" dyno= connect= service= status=503 bytes=
2016-03-05T15:10:17.486279+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=redewebsite.herokuapp.com request_id=64746251-2419-4525-b257-695effd9f15d fwd="189.48.111.130" dyno= connect= service= status=503 bytes=
When I run heroku open, return-me 503 and the message:
An error occurred in the application and your page could not be served. Please try again in a few moments.
If you are the application owner, check your logs for details.
Someone could help me?