2016-07-09 100 views
0

我的Flask應用程序在localhost上運行平穩,但在將它部署到heroku時無法正常工作。 heroku logs也沒有提供太多的信息錯誤。這是我的日誌部署在Heroku上時Flask應用程序無法正常工作

`1:16:23.145279+00:00 app[web.1]:  worker.init_process() 
2016-07-09T21:16:23.172177+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in run 
2016-07-09T21:16:23.145282+00:00 app[web.1]:  self.wsgi = self.app.wsgi() 
2016-07-09T21:16:23.145299+00:00 app[web.1]: ImportError: No module named comprehensive_search 
2016-07-09T21:16:23.172733+00:00 app[web.1]:  self.stop() 
2016-07-09T21:16:23.172424+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 72, in run 
2016-07-09T21:16:23.172842+00:00 app[web.1]:  time.sleep(0.1) 
2016-07-09T21:16:23.145289+00:00 app[web.1]: File "/app/app.py", line 13, in <module> 
2016-07-09T21:16:23.172469+00:00 app[web.1]:  Arbiter(self).run() 
2016-07-09T21:16:23.145285+00:00 app[web.1]:  return self.load_wsgiapp() 
2016-07-09T21:16:23.172910+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 231, in handle_chld 
2016-07-09T21:16:23.172601+00:00 app[web.1]:  self.halt(reason=inst.reason, exit_status=inst.exit_status) 
2016-07-09T21:16:23.173016+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 506, in reap_workers 
2016-07-09T21:16:23.172317+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 192, in run 
2016-07-09T21:16:23.172990+00:00 app[web.1]:  self.reap_workers() 
2016-07-09T21:16:23.145298+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gevent/builtins.py", line 93, in __import__ 
2016-07-09T21:16:23.173286+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3> 
2016-07-09T21:16:23.172490+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 218, in run 
2016-07-09T21:16:23.145742+00:00 app[web.1]: [2016-07-09 21:16:23 +0000] [9] [INFO] Worker exiting (pid: 9) 
2016-07-09T21:16:23.983452+00:00 heroku[web.1]: State changed from starting to crashed 
2016-07-09T21:16:23.968188+00:00 heroku[web.1]: Process exited with status 1 
2016-07-09T21:16:43.235185+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=notes-in-short.herokuapp.com request_id=494cdb87-7e25-4340-992d-19c6a32b7e99 fwd="203.100.73.42" dyno= connect= service= status=503 bytes= 
2016-07-09T21:20:15.679536+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=POST path="/upload" host=notes-in-short.herokuapp.com request_id=19dad39c-d05c-4130-8f69-3fff5b043d19 fwd="27.60.87.185" dyno= connect= service= status=503 bytes= 
2016-07-09T21:22:26.694762+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/upload" host=notes-in-short.herokuapp.com request_id=85e4de0c-175b-45b7-8a41-34f93c1a1940 fwd="203.100.73.42" dyno= connect= service= status=503 bytes= 
2016-07-09T21:22:31.702677+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=notes-in-short.herokuapp.com request_id=afb6d01b-b0ba-4379-a9a4-db4738eb3883 fwd="203.100.73.42" dyno= connect= service= status=503 bytes= 
` 

我試了很多,但我不明白究竟是什麼錯誤。你能幫我調試嗎?

+0

什麼是綜合搜索?你的代碼?第三方代碼? –

+0

comprehensive_search是我克隆的一個目錄,我在我的應用程序中使用它 – Faiz

+0

它被簽入你的git存儲庫並推送到heroku嗎? –

回答

0

您的comprehensive_search模塊未被推送到heroku。它可能還沒有被提交給你的本地git倉庫。

您可以通過創建一個一次性的bash賽道從Heroku的側告訴:

heroku run bash 

你會得到一個遠程shell,你可以發出的Linux命令來查看模塊的代碼是否是你覺得它應該。

從那裏你可以確保你已經檢查目錄到git正確。

相關問題