Flask部署到heroku错误



当我试图打开我的网站时https://pomocnikprofesora.herokuapp.com/它不起作用。这是我的日志我不知道我还能说什么,但如果没有更多的普通文本,我就不能提出这个问题。任何建议和帮助对我都很好。感谢

$ heroku logs --tail
»   Warning: heroku update available from 7.37.0 to 7.47.3.
2020-11-30T16:12:03.048409+00:00 app[api]: Initial release by user rozplochowskipawel9@gmail.com
2020-11-30T16:12:03.048409+00:00 app[api]: Release v1 created by user rozplochowskipawel9@gmail.com
2020-11-30T16:12:03.170216+00:00 app[api]: Release v2 created by user rozplochowskipawel9@gmail.com
2020-11-30T16:12:03.170216+00:00 app[api]: Enable Logplex by user rozplochowskipawel9@gmail.com
2020-11-30T16:12:22.236825+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=fathomless-coast-67373.herokuapp.com request_id=49dbe3e9-8b50-49cc-94b0-9ec7fde34228 fwd="31.60.48.45" dyno= connect= service= status=502 bytes= protocol=https
2020-11-30T16:12:22.983607+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/favicon.ico" host=fathomless-coast-67373.herokuapp.com request_id=4b30a4cb-d870-42eb-9834-b5aaa006c1b5 fwd="31.60.48.45" dyno= connect= service= status=502 bytes= protocol=https
2020-11-30T16:13:57.834416+00:00 heroku[router]: at=info code=H81 desc="Blank app" method=GET path="/" host=pomoncikprofesora.herokuapp.com request_id=ca16ec59-2bf7-4741-a873-67096832462f fwd="31.60.48.45" dyno= connect= service= status=502 bytes= protocol=https
2020-11-30T16:16:16.950761+00:00 app[web.1]: Traceback (most recent call last):
2020-11-30T16:16:16.950764+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 209, in run
2020-11-30T16:16:16.951127+00:00 app[web.1]: self.sleep()
2020-11-30T16:16:16.951128+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 357, in sleep
2020-11-30T16:16:16.951411+00:00 app[web.1]: ready = select.select([self.PIPE[0]], [], [], 1.0)
2020-11-30T16:16:16.951412+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
2020-11-30T16:16:16.951616+00:00 app[web.1]: self.reap_workers()
2020-11-30T16:16:16.951617+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 528, in reap_workers
2020-11-30T16:16:16.951902+00:00 app[web.1]: raise HaltServer(reason, self.APP_LOAD_ERROR)
2020-11-30T16:16:16.951941+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'App failed to load.' 4>
2020-11-30T16:16:16.951944+00:00 app[web.1]:
2020-11-30T16:16:16.951944+00:00 app[web.1]: During handling of the above exception, another exception occurred:
2020-11-30T16:16:16.951945+00:00 app[web.1]:
2020-11-30T16:16:16.951945+00:00 app[web.1]: Traceback (most recent call last):
2020-11-30T16:16:16.951949+00:00 app[web.1]: File "/app/.heroku/python/bin/gunicorn", line 8, in <module>
2020-11-30T16:16:16.952070+00:00 app[web.1]: sys.exit(run())
2020-11-30T16:16:16.952071+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 58, in run
2020-11-30T16:16:16.952219+00:00 app[web.1]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2020-11-30T16:16:16.952220+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 228, in run
2020-11-30T16:16:16.952395+00:00 app[web.1]: super().run()
2020-11-30T16:16:16.952396+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py", line 72, in run
2020-11-30T16:16:16.952520+00:00 app[web.1]: Arbiter(self).run()
2020-11-30T16:16:16.952521+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 229, in run
2020-11-30T16:16:16.952689+00:00 app[web.1]: self.halt(reason=inst.reason, exit_status=inst.exit_status)
2020-11-30T16:16:16.952691+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 342, in halt
2020-11-30T16:16:16.952897+00:00 app[web.1]: self.stop()
2020-11-30T16:16:16.952898+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 393, in stop
2020-11-30T16:16:16.953149+00:00 app[web.1]: time.sleep(0.1)
2020-11-30T16:16:16.953150+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
2020-11-30T16:16:16.953324+00:00 app[web.1]: self.reap_workers()
2020-11-30T16:16:16.953325+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py", line 528, in reap_workers
2020-11-30T16:16:16.953633+00:00 app[web.1]: raise HaltServer(reason, self.APP_LOAD_ERROR)
2020-11-30T16:16:16.953634+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'App failed to load.' 4>
2020-11-30T16:16:17.052618+00:00 heroku[web.1]: Process exited with status 1
2020-11-30T16:16:17.117406+00:00 heroku[web.1]: State changed from starting to crashed
2020-11-30T17:01:23.850624+00:00 heroku[web.1]: State changed from crashed to starting
2020-11-30T17:01:30.144003+00:00 heroku[web.1]: Starting process with command `gunicorn app:PomocnikProfesora.py`
2020-11-30T17:01:33.283660+00:00 app[web.1]: [2020-11-30 17:01:33 +0000] [4] [INFO] Starting gunicorn 20.0.4
2020-11-30T17:01:33.291826+00:00 app[web.1]: [2020-11-30 17:01:33 +0000] [4] [INFO] Listening at: http://0.0.0.0:43889 (4)
2020-11-30T17:01:33.300878+00:00 app[web.1]: [2020-11-30 17:01:33 +0000] [10] [INFO] Booting worker with pid: 10
2020-11-30T17:01:33.318087+00:00 app[web.1]: [2020-11-30 17:01:33 +0000] [11] [INFO] Booting worker with pid: 11
2020-11-30T17:01:34.497407+00:00 app[web.1]: Failed to parse 'PomocnikProfesora.py' as an attribute name or function call.
2020-11-30T17:01:34.498343+00:00 app[web.1]: [2020-11-30 17:01:34 +0000] [11] [INFO] Worker exiting (pid: 11)
2020-11-30T17:01:34.520370+00:00 app[web.1]: Failed to parse 'PomocnikProfesora.py' as an attribute name or function call.
2020-11-30T17:01:34.521180+00:00 app[web.1]: [2020-11-30 17:01:34 +0000] [10] [INFO] Worker exiting (pid: 10)
2020-11-30T17:01:34.690436+00:00 app[web.1]: [2020-11-30 17:01:34 +0000] [4] [INFO] Shutting down: Master
2020-11-30T17:01:34.690611+00:00 app[web.1]: [2020-11-30 17:01:34 +0000] [4] [INFO] Reason: App failed to load.
2020-11-30T17:01:34.770227+00:00 heroku[web.1]: Process exited with status 4
2020-11-30T17:01:34.808969+00:00 heroku[web.1]: State changed from starting to crashed

根据日志,您的应用程序在加载时崩溃:

2020-11-30T16:21:28.904773+00:00 heroku[router]: at=error code=H10 desc="App crashed"

该错误还表示无法解析文件PomocnikProfesora.py:

Failed to parse 'PomocnikProfesora.py' as an attribute name or function call
  1. 检查此文件是否正确执行

  2. 还要检查您是如何实例化gunicorn的。如果这是你的应用程序的入口点,请在Procfile中尝试:

    web:gunicorn应用程序:PomocnikProfesora

您的应用程序似乎因解析以下文件失败而崩溃:

Failed to parse 'PomocnikProfesora.py' as an attribute name or function call

尝试解决该问题并解决依赖关系。