I successfully deployed the app in Heroku,but when I visited the given link ( https://telegram-bot-cb.herokuapp.com/ )it shows application error. I read the logs but I’ m unable to find out the error.
The telegram bot is working perfectly fine with ngrok.
Telegram bot not working with Heroku
It seems there’s some error with gunicorn. Here are the logs:
Starting process with command gunicorn app:app
2020-09-27T11:45:56.636713+00:00 app[web.1]: [2020-09-27 11:45:56 +0000] [4] [INFO] Starting gunicorn 20.0.4
2020-09-27T11:45:56.637381+00:00 app[web.1]: [2020-09-27 11:45:56 +0000] [4] [INFO] Listening at: http://0.0.0.0:50294 (4)
2020-09-27T11:45:56.637498+00:00 app[web.1]: [2020-09-27 11:45:56 +0000] [4] [INFO] Using worker: sync
2020-09-27T11:45:56.642005+00:00 app[web.1]: [2020-09-27 11:45:56 +0000] [10] [INFO] Booting worker with pid: 10
2020-09-27T11:45:56.649164+00:00 app[web.1]: [2020-09-27 11:45:56 +0000] [10] [ERROR] Exception in worker process
2020-09-27T11:45:56.649165+00:00 app[web.1]: Traceback (most recent call last):
2020-09-27T11:45:56.649174+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py”, line 583, in spawn_worker
2020-09-27T11:45:56.649174+00:00 app[web.1]: worker.init_process()
2020-09-27T11:45:56.649175+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/base.py”, line 119, in init_process
2020-09-27T11:45:56.649175+00:00 app[web.1]: self.load_wsgi()
2020-09-27T11:45:56.649175+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/base.py”, line 144, in load_wsgi
2020-09-27T11:45:56.649175+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2020-09-27T11:45:56.649176+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/base.py”, line 67, in wsgi
2020-09-27T11:45:56.649176+00:00 app[web.1]: self.callable = self.load()
2020-09-27T11:45:56.649176+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py”, line 49, in load
2020-09-27T11:45:56.649176+00:00 app[web.1]: return self.load_wsgiapp()
2020-09-27T11:45:56.649177+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py”, line 39, in load_wsgiapp
2020-09-27T11:45:56.649177+00:00 app[web.1]: return util.import_app(self.app_uri)
2020-09-27T11:45:56.649177+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.7/site-packages/gunicorn/util.py”, line 358, in import_app
2020-09-27T11:45:56.649177+00:00 app[web.1]: mod = importlib.import_module(module)
2020-09-27T11:45:56.649178+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.7/importlib/init.py”, line 127, in import_module
2020-09-27T11:45:56.649178+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2020-09-27T11:45:56.649178+00:00 app[web.1]: File “”, line 1006, in _gcd_import
2020-09-27T11:45:56.649178+00:00 app[web.1]: File “”, line 983, in _find_and_load
2020-09-27T11:45:56.649179+00:00 app[web.1]: File “”, line 965, in _find_and_load_unlocked
2020-09-27T11:45:56.649179+00:00 app[web.1]: ModuleNotFoundError: No module named ‘app’
2020-09-27T11:45:56.649299+00:00 app[web.1]: [2020-09-27 11:45:56 +0000] [10] [INFO] Worker exiting (pid: 10)
2020-09-27T11:45:56.679251+00:00 app[web.1]: [2020-09-27 11:45:56 +0000] [4] [INFO] Shutting down: Master
2020-09-27T11:45:56.679349+00:00 app[web.1]: [2020-09-27 11:45:56 +0000] [4] [INFO] Reason: Worker failed to boot.
2020-09-27T11:45:56.753052+00:00 heroku[web.1]: Process exited with status 3
2020-09-27T11:45:56.784328+00:00 heroku[web.1]: State changed from starting to crashed
2020-09-27T11:45:56.787122+00:00 heroku[web.1]: State changed from crashed to starting
2020-09-27T11:46:00.511421+00:00 heroku[web.1]: Starting process with command gunicorn app:app
2020-09-27T11:46:01.000000+00:00 app[api]: Build succeeded
2020-09-27T11:46:03.121712+00:00 app[web.1]: [2020-09-27 11:46:03 +0000] [4] [INFO] Starting gunicorn 20.0.4
2020-09-27T11:46:03.122339+00:00 app[web.1]: [2020-09-27 11:46:03 +0000] [4] [INFO] Listening at: http://0.0.0.0:39661 (4)
2020-09-27T11:46:03.122421+00:00 app[web.1]: [2020-09-27 11:46:03 +0000] [4] [INFO] Using worker: sync
2020-09-27T11:46:03.128197+00:00 app[web.1]: [2020-09-27 11:46:03 +0000] [10] [INFO] Booting worker with pid: 10
2020-09-27T11:46:03.133472+00:00 app[web.1]: [2020-09-27 11:46:03 +0000] [10] [ERROR] Exception in worker process
2020-09-27T11:46:03.133473+00:00 app[web.1]: Traceback (most recent call last):
2020-09-27T11:46:03.133490+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py”, line 583, in spawn_worker
2020-09-27T11:46:03.133491+00:00 app[web.1]: worker.init_process()
2020-09-27T11:46:03.133492+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/base.py”, line 119, in init_process
2020-09-27T11:46:03.133492+00:00 app[web.1]: self.load_wsgi()
2020-09-27T11:46:03.133493+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/base.py”, line 144, in load_wsgi
2020-09-27T11:46:03.133493+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2020-09-27T11:46:03.133493+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/base.py”, line 67, in wsgi
2020-09-27T11:46:03.133494+00:00 app[web.1]: self.callable = self.load()
2020-09-27T11:46:03.133494+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py”, line 49, in load
2020-09-27T11:46:03.133495+00:00 app[web.1]: return self.load_wsgiapp()
2020-09-27T11:46:03.133495+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py”, line 39, in load_wsgiapp
2020-09-27T11:46:03.133495+00:00 app[web.1]: return util.import_app(self.app_uri)
2020-09-27T11:46:03.133496+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.7/site-packages/gunicorn/util.py”, line 358, in import_app
2020-09-27T11:46:03.133496+00:00 app[web.1]: mod = importlib.import_module(module)
2020-09-27T11:46:03.133497+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.7/importlib/init.py”, line 127, in import_module
2020-09-27T11:46:03.133497+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2020-09-27T11:46:03.133497+00:00 app[web.1]: File “”, line 1006, in _gcd_import
2020-09-27T11:46:03.133498+00:00 app[web.1]: File “”, line 983, in _find_and_load
2020-09-27T11:46:03.133498+00:00 app[web.1]: File “”, line 965, in _find_and_load_unlocked
2020-09-27T11:46:03.133499+00:00 app[web.1]: ModuleNotFoundError: No module named ‘app’
2020-09-27T11:46:03.133611+00:00 app[web.1]: [2020-09-27 11:46:03 +0000] [10] [INFO] Worker exiting (pid: 10)
2020-09-27T11:46:03.159596+00:00 app[web.1]: [2020-09-27 11:46:03 +0000] [4] [INFO] Shutting down: Master
2020-09-27T11:46:03.159693+00:00 app[web.1]: [2020-09-27 11:46:03 +0000] [4] [INFO] Reason: Worker failed to boot.
2020-09-27T11:46:03.215525+00:00 heroku[web.1]: Process exited with status 3
2020-09-27T11:46:03.250378+00:00 heroku[web.1]: State changed from starting to crashed
2020-09-27T11:46:55.091720+00:00 heroku[router]: at=error code=H10 desc=“App crashed” method=GET path="/" host=telegram-bot-cb.herokuapp.com request_id=86d15270-1564-4f80-afc6-937dde45ef57 fwd=“103.208.55.164” dyno= connect= service= status=503 bytes= protocol=https
2020-09-27T11:46:55.744621+00:00 heroku[router]: at=error code=H10 desc=“App crashed” method=GET path="/favicon.ico" host=telegram-bot-cb.herokuapp.com request_id=85d5e682-1d89-4114-97bf-633a73a7e51a fwd=“103.208.55.164” dyno= connect= service= status=503 bytes= protocol=https
2020-09-27T11:47:18.403097+00:00 heroku[router]: at=error code=H10 desc=“App crashed” method=GET path="/" host=telegram-bot-cb.herokuapp.com request_id=0b746720-124a-46dd-920f-5ffbac66c867 fwd=“103.208.55.164” dyno= connect= service= status=503 bytes= protocol=https
2020-09-27T11:47:18.868243+00:00 heroku[router]: at=error code=H10 desc=“App crashed” method=GET path="/favicon.ico" host=telegram-bot-cb.herokuapp.com request_id=b4d0f4e3-d677-423d-866d-0a9158c68b5e fwd=“103.208.55.164” dyno= connect= service= status=503 bytes= protocol=https
Update: It’s working correctly there was a minor spelling error
hey , @SanchitSayala ,
its really good that you have got the error yourself. Its really good to see that.
I request you to kindly mark this doubt as resolved in your course doubt section and do provide your valuable feedback as it helps us to improve this platform and provide you with better learning experience .
Thank You and Happy Learning .