这是我运行heroku应用程序时遇到的错误。
[2019-12-03 15:18:17 +0000] [11] [INFO] Booting worker with pid: 11
2019-12-03T15:18:17.611154+00:00 app[web.1]: [2019-12-03 15:18:17 +0000] [11] [ERROR] Exception in worker process
2019-12-03T15:18:17.611158+00:00 app[web.1]: Traceback (most recent call last):
2019-12-03T15:18:17.611161+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2019-12-03T15:18:17.611163+00:00 app[web.1]: worker.init_process()
2019-12-03T15:18:17.611165+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/base.py", line 119, in init_process
2019-12-03T15:18:17.611167+00:00 app[web.1]: self.load_wsgi()
2019-12-03T15:18:17.611169+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
2019-12-03T15:18:17.611171+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2019-12-03T15:18:17.611173+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2019-12-03T15:18:17.611175+00:00 app[web.1]: self.callable = self.load()
2019-12-03T15:18:17.611177+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2019-12-03T15:18:17.611179+00:00 app[web.1]: return self.load_wsgiapp()
2019-12-03T15:18:17.611180+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
2019-12-03T15:18:17.611182+00:00 app[web.1]: return util.import_app(self.app_uri)
2019-12-03T15:18:17.611184+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/util.py", line 358, in import_app
2019-12-03T15:18:17.611186+00:00 app[web.1]: mod = importlib.import_module(module)
2019-12-03T15:18:17.611188+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/importlib/__init__.py", line 127, in import_module
2019-12-03T15:18:17.611190+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2019-12-03T15:18:17.611192+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
2019-12-03T15:18:17.611194+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 983, in _find_and_load
2019-12-03T15:18:17.611196+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
2019-12-03T15:18:17.611198+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2019-12-03T15:18:17.611200+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
2019-12-03T15:18:17.611202+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 983, in _find_and_load
2019-12-03T15:18:17.611204+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
2019-12-03T15:18:17.611206+00:00 app[web.1]: ModuleNotFoundError: No module named 'src'
2019-12-03T15:18:17.611389+00:00 app[web.1]: [2019-12-03 15:18:17 +0000] [11] [INFO] Worker exiting (pid: 11)
2019-12-03T15:18:17.682066+00:00 app[web.1]: Traceback (most recent call last):
2019-12-03T15:18:17.682075+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 209, in run
2019-12-03T15:18:17.682711+00:00 app[web.1]: self.sleep()
2019-12-03T15:18:17.682714+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 357, in sleep
2019-12-03T15:18:17.683195+00:00 app[web.1]: ready = select.select([self.PIPE[0]], [], [], 1.0)
2019-12-03T15:18:17.683198+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
2019-12-03T15:18:17.683532+00:00 app[web.1]: self.reap_workers()
2019-12-03T15:18:17.683539+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
2019-12-03T15:18:17.684765+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2019-12-03T15:18:17.684769+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2019-12-03T15:18:17.684771+00:00 app[web.1]:
2019-12-03T15:18:17.684774+00:00 app[web.1]: During handling of the above exception, another exception occurred:
2019-12-03T15:18:17.684775+00:00 app[web.1]:
2019-12-03T15:18:17.684778+00:00 app[web.1]: Traceback (most recent call last):
2019-12-03T15:18:17.684780+00:00 app[web.1]: File "/app/.heroku/python/bin/gunicorn", line 11, in <module>
2019-12-03T15:18:17.685663+00:00 app[web.1]: sys.exit(run())
2019-12-03T15:18:17.685666+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 58, in run
2019-12-03T15:18:17.686708+00:00 app[web.1]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2019-12-03T15:18:17.686711+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/base.py", line 228, in run
2019-12-03T15:18:17.687947+00:00 app[web.1]: super().run()
2019-12-03T15:18:17.687954+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/base.py", line 72, in run
2019-12-03T15:18:17.688618+00:00 app[web.1]: Arbiter(self).run()
2019-12-03T15:18:17.688624+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 229, in run
2019-12-03T15:18:17.692222+00:00 app[web.1]: self.halt(reason=inst.reason, exit_status=inst.exit_status)
2019-12-03T15:18:17.692225+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 342, in halt
2019-12-03T15:18:17.692484+00:00 app[web.1]: self.stop()
2019-12-03T15:18:17.692489+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 393, in stop
2019-12-03T15:18:17.692757+00:00 app[web.1]: time.sleep(0.1)
2019-12-03T15:18:17.692760+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 242, in handle_chld
2019-12-03T15:18:17.693025+00:00 app[web.1]: self.reap_workers()
2019-12-03T15:18:17.693056+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 525, in reap_workers
2019-12-03T15:18:17.693363+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2019-12-03T15:18:17.693428+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2019-12-03T15:18:17.783942+00:00 heroku[web.1]: Process exited with status 1
2019-12-03T15:18:18.661670+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=book-flask-project.herokuapp.com request_id=77ef0e67-9aa4-4c7e-bad7-63a4ad0d146e fwd="157.50.238.41" dyno= connect= service= status=503 bytes= protocol=https
2019-12-03T15:18:21.272486+00:00 heroku[web.1]: Starting process with command `gunicorn src.application:app --log-file=-`
2019-12-03T15:18:23.809346+00:00 heroku[web.1]: State changed from starting to crashed
2019-12-03T15:18:23.786956+00:00 heroku[web.1]: Process exited with status 3
2019-12-03T15:18:23.658571+00:00 app[web.1]: [2019-12-03 15:18:23 +0000] [4] [INFO] Starting gunicorn 20.0.4
2019-12-03T15:18:23.659177+00:00 app[web.1]: [2019-12-03 15:18:23 +0000] [4] [INFO] Listening at: http://0.0.0.0:54503 (4)
2019-12-03T15:18:23.659288+00:00 app[web.1]: [2019-12-03 15:18:23 +0000] [4] [INFO] Using worker: sync
2019-12-03T15:18:23.664936+00:00 app[web.1]: [2019-12-03 15:18:23 +0000] [10] [INFO] Booting worker with pid: 10
2019-12-03T15:18:23.671054+00:00 app[web.1]: [2019-12-03 15:18:23 +0000] [10] [ERROR] Exception in worker process
2019-12-03T15:18:23.671057+00:00 app[web.1]: Traceback (most recent call last):
2019-12-03T15:18:23.671068+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/arbiter.py", line 583, in spawn_worker
2019-12-03T15:18:23.671070+00:00 app[web.1]: worker.init_process()
2019-12-03T15:18:23.671071+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/base.py", line 119, in init_process
2019-12-03T15:18:23.671073+00:00 app[web.1]: self.load_wsgi()
2019-12-03T15:18:23.671074+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/workers/base.py", line 144, in load_wsgi
2019-12-03T15:18:23.671076+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2019-12-03T15:18:23.671080+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2019-12-03T15:18:23.671082+00:00 app[web.1]: self.callable = self.load()
2019-12-03T15:18:23.671083+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load
2019-12-03T15:18:23.671085+00:00 app[web.1]: return self.load_wsgiapp()
2019-12-03T15:18:23.671086+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 39, in load_wsgiapp
2019-12-03T15:18:23.671088+00:00 app[web.1]: return util.import_app(self.app_uri)
2019-12-03T15:18:23.671089+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/util.py", line 358, in import_app
2019-12-03T15:18:23.671090+00:00 app[web.1]: mod = importlib.import_module(module)
2019-12-03T15:18:23.671092+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/importlib/__init__.py", line 127, in import_module
2019-12-03T15:18:23.671094+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2019-12-03T15:18:23.671095+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
2019-12-03T15:18:23.671096+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 983, in _find_and_load
2019-12-03T15:18:23.671098+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
2019-12-03T15:18:23.671099+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
2019-12-03T15:18:23.671101+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
2019-12-03T15:18:23.671102+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 983, in _find_and_load
2019-12-03T15:18:23.671103+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlocked
2019-12-03T15:18:23.671105+00:00 app[web.1]: ModuleNotFoundError: No module named 'src'
2019-12-03T15:18:23.671247+00:00 app[web.1]: [2019-12-03 15:18:23 +0000] [10] [INFO] Worker exiting (pid: 10)
2019-12-03T15:18:23.706640+00:00 app[web.1]: [2019-12-03 15:18:23 +0000] [4] [INFO] Shutting down: Master
2019-12-03T15:18:23.706652+00:00 app[web.1]: [2019-12-03 15:18:23 +0000] [4] [INFO] Reason: Worker failed to boot.
2019-12-03T15:18:24.445327+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=book-flask-project.herokuapp.com request_id=4800d152-dbf8-4ff7-b2fc-7b3ff66441e4 fwd="157.50.238.41" dyno= connect= service= status=503 bytes= protocol=https
这是我的Procfile。 我都尝试过
web: gunicorn src.application:app --log-file=-
和
web:gunicorn application:app --log-file -
我不知道为什么会这样。在没有网络服务器运行之前,我得到了应用程序崩溃错误。我应该怎么做才能摆脱这种情况?
我什至尝试了heroku ps:scale web = 1
我已经推了20多次,但仍然遇到错误。更改Procfile超过40次。 我的构建限制也已超出。