- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我只是第一次将我的应用程序推送到 heroku,但是当我访问该页面时不断收到“应用程序错误”。我不熟悉 heroku,似乎无法在帮助/开发中找到任何引用中心链接。
转到 heroku 日志我得到这个:
C:\Users\XXX\Desktop\xxxxx.folder>heroku logs
2013-10-14T02:32:18.578976+00:00 heroku[api]: Enable Logplex by EMAIL@email.com
2013-10-14T02:32:18.597277+00:00 heroku[api]: Release v2 created by EMAIL@email.com
2013-10-14T02:32:46+00:00 heroku[slug-compiler]: Slug compilation started
2013-10-14T02:33:10.309086+00:00 heroku[api]: Scale to web=1 by EMAIL@email.com
2013-10-14T02:33:10.356490+00:00 heroku[api]: Deploy 9edccd8 by EMAIL@email.com
2013-10-14T02:33:10.375197+00:00 heroku[api]: Release v3 created by EMAIL@email.com
2013-10-14T02:33:10+00:00 heroku[slug-compiler]: Slug compilation finished
2013-10-14T02:33:14.369318+00:00 heroku[web.1]: Starting process with command `gunicorn xxxxx:app`
2013-10-14T02:33:15.336306+00:00 app[web.1]: 2013-10-14 02:33:15 [2] [INFO] Starting gunicorn 18.0
2013-10-14T02:33:15.337257+00:00 app[web.1]: 2013-10-14 02:33:15 [2] [INFO] Listening at: http://0.0.0.0:36245 (2)
2013-10-14T02:33:15.337821+00:00 app[web.1]: 2013-10-14 02:33:15 [2] [INFO] Using worker: sync
2013-10-14T02:33:15.354973+00:00 app[web.1]: 2013-10-14 02:33:15 [7] [INFO] Booting worker with pid: 7
2013-10-14T02:33:15.360482+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
2013-10-14T02:33:15.360482+00:00 app[web.1]: self.callable = self.load()
2013-10-14T02:33:15.360482+00:00 app[web.1]: Traceback (most recent call last):
2013-10-14T02:33:15.360482+00:00 app[web.1]: 2013-10-14 02:33:15 [7] [ERROR] Exception in worker process:
2013-10-14T02:33:15.360482+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
2013-10-14T02:33:15.360482+00:00 app[web.1]: worker.init_process()
2013-10-14T02:33:15.360482+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2013-10-14T02:33:15.360482+00:00 app[web.1]: return self.load_wsgiapp()
2013-10-14T02:33:15.360482+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
2013-10-14T02:33:15.360482+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
2013-10-14T02:33:15.360658+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
2013-10-14T02:33:15.360658+00:00 app[web.1]: return util.import_app(self.app_uri)
2013-10-14T02:33:15.360658+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
2013-10-14T02:33:15.360658+00:00 app[web.1]: ImportError: No module named xxxxx
2013-10-14T02:33:15.360658+00:00 app[web.1]: __import__(module)
2013-10-14T02:33:15.360658+00:00 app[web.1]: Traceback (most recent call last):
2013-10-14T02:33:15.360658+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
2013-10-14T02:33:15.360658+00:00 app[web.1]: worker.init_process()
2013-10-14T02:33:15.360658+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
2013-10-14T02:33:15.360658+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2013-10-14T02:33:15.360814+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
2013-10-14T02:33:15.360814+00:00 app[web.1]: self.callable = self.load()
2013-10-14T02:33:15.360814+00:00 app[web.1]: return util.import_app(self.app_uri)
2013-10-14T02:33:15.360814+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
2013-10-14T02:33:15.360814+00:00 app[web.1]: return self.load_wsgiapp()
2013-10-14T02:33:15.360814+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
2013-10-14T02:33:15.360814+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
2013-10-14T02:33:15.360814+00:00 app[web.1]: __import__(module)
2013-10-14T02:33:15.360814+00:00 app[web.1]: ImportError: No module named xxxxx
2013-10-14T02:33:15.360814+00:00 app[web.1]: 2013-10-14 02:33:15 [7] [INFO] Worker exiting (pid: 7)
2013-10-14T02:33:15.506842+00:00 app[web.1]: 2013-10-14 02:33:15 [2] [INFO] Shutting down: Master
2013-10-14T02:33:15.506842+00:00 app[web.1]: 2013-10-14 02:33:15 [2] [INFO] Reason: Worker failed to boot.
2013-10-14T02:33:16.807631+00:00 heroku[web.1]: Process exited with status 3
2013-10-14T02:33:16.808898+00:00 heroku[web.1]: State changed from starting to crashed
2013-10-14T02:33:16.810378+00:00 heroku[web.1]: State changed from crashed to starting
2013-10-14T02:33:20.292603+00:00 heroku[web.1]: Starting process with command `gunicorn xxxxx:app`
2013-10-14T02:33:21.415595+00:00 app[web.1]: 2013-10-14 02:33:21 [2] [INFO] Starting gunicorn 18.0
2013-10-14T02:33:21.424049+00:00 app[web.1]: 2013-10-14 02:33:21 [2] [INFO] Listening at: http://0.0.0.0:21832 (2)
2013-10-14T02:33:21.424357+00:00 app[web.1]: 2013-10-14 02:33:21 [2] [INFO] Using worker: sync
2013-10-14T02:33:21.451415+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
2013-10-14T02:33:21.451415+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
2013-10-14T02:33:21.446578+00:00 app[web.1]: 2013-10-14 02:33:21 [7] [INFO] Booting worker with pid: 7
2013-10-14T02:33:21.451415+00:00 app[web.1]: 2013-10-14 02:33:21 [7] [ERROR] Exception in worker process:
2013-10-14T02:33:21.451415+00:00 app[web.1]: Traceback (most recent call last):
2013-10-14T02:33:21.451415+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
2013-10-14T02:33:21.451415+00:00 app[web.1]: return self.load_wsgiapp()
2013-10-14T02:33:21.451582+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
2013-10-14T02:33:21.451582+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
2013-10-14T02:33:21.451415+00:00 app[web.1]: self.callable = self.load()
2013-10-14T02:33:21.451415+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
2013-10-14T02:33:21.451582+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 495, in spawn_worker
2013-10-14T02:33:21.451582+00:00 app[web.1]: worker.init_process()
2013-10-14T02:33:21.451582+00:00 app[web.1]: return util.import_app(self.app_uri)
2013-10-14T02:33:21.451582+00:00 app[web.1]: __import__(module)
2013-10-14T02:33:21.451415+00:00 app[web.1]: worker.init_process()
2013-10-14T02:33:21.451765+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 114, in wsgi
2013-10-14T02:33:21.451765+00:00 app[web.1]: return util.import_app(self.app_uri)
2013-10-14T02:33:21.451765+00:00 app[web.1]: 2013-10-14 02:33:21 [7] [INFO] Work
er exiting (pid: 7)
2013-10-14T02:33:21.451582+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 106, in init_process
2013-10-14T02:33:21.451582+00:00 app[web.1]: Traceback (most recent call last):
2013-10-14T02:33:21.451765+00:00 app[web.1]: self.callable = self.load()
2013-10-14T02:33:21.451765+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 62, in load
2013-10-14T02:33:21.451765+00:00 app[web.1]: return self.load_wsgiapp()
2013-10-14T02:33:21.451415+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2013-10-14T02:33:21.451765+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 49, in load_wsgiapp
2013-10-14T02:33:21.451582+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2013-10-14T02:33:21.451765+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 354, in import_app
2013-10-14T02:33:21.451765+00:00 app[web.1]: __import__(module)
2013-10-14T02:33:21.451582+00:00 app[web.1]: ImportError: No module named xxxxx
2013-10-14T02:33:21.451765+00:00 app[web.1]: ImportError: No module named xxxxx
2013-10-14T02:33:21.614863+00:00 app[web.1]: 2013-10-14 02:33:21 [2] [INFO] Shutting down: Master
2013-10-14T02:33:21.614999+00:00 app[web.1]: 2013-10-14 02:33:21 [2] [INFO] Reason: Worker failed to boot.
2013-10-14T02:33:22.891685+00:00 heroku[web.1]: State changed from starting to crashed
2013-10-14T02:33:22.880946+00:00 heroku[web.1]: Process exited with status 3
2013-10-14T02:33:56.309306+00:00 heroku[api]: Scale to web=1 by EMAIL@email.com
2013-10-14T02:34:38.709036+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxxxx.herokuapp.com fwd="68.8.230.232" dyno= connect= service= status=503 bytes=
2013-10-14T02:35:26.497306+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxxxx.herokuapp.com fwd="68.8.230.232" dyno= connect= service= status=503 bytes=
2013-10-14T02:35:29.339881+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxxxx.herokuapp.com fwd="68.8.230.232" dyno= connect= service= status=503 bytes=
2013-10-14T02:34:35.682537+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxxxx.herokuapp.com fwd="68.8.230.232" dyno= connect= service= status=503 bytes=
2013-10-14T02:34:36.970547+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxxxx.herokuapp.com fwd="68.8.230.232" dyno= connect= service= status=503 bytes=
2013-10-14T02:35:27.860267+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxxxx.herokuapp.com fwd="68.8.230.232" dyno= connect= service= status=503 bytes=
2013-10-14T02:36:45.618318+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxxxx.herokuapp.com fwd="68.8.230.232" dyno= connect= service= status=503 bytes=
2013-10-14T02:37:13.316055+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxxxx.herokuapp.com fwd="68.8.230.232" dyno= connect= service= status=503 bytes=
2013-10-14T02:37:16.020891+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxxxx.herokuapp.com fwd="68.8.230.232" dyno= connect= service= status=503 bytes=
2013-10-14T02:37:54.849200+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxxxx.herokuapp.com fwd="68.8.230.232" dyno= connect= service= status=503 bytes=
2013-10-14T02:37:14.772425+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=xxxxx.herokuapp.com fwd="68.8.230.232" dyno= connect= service= status=503 bytes=
我不太确定这些都是什么意思。但我假设它与 gunicorn 连接有关?有人可以帮助指出问题以及我该如何解决这个问题吗?
注意:no ImportError: No module named xxxxx --> xxxxx 是我的应用程序的名称。这也是我在 procfile 中使用的名称(例如 xxxxx:app)。这是问题所在吗?
编辑:这是一个 Flask 应用程序,所以这是我当前的结构
-static
--css
--img
--js
-templates
--index.html
--layout.html
-.gitignore
-Procfile
-requirements.txt
-app.py
我的文件:
web: gunicorn app:app
Edit2:这是我的 app.py 文件
from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def main():
return render_template("index.html")
@app.route('/projects')
def projects():
...
...
if __name__ == '__main__':
app.run()
最佳答案
当你配置你的 Procfile 时:
web: gunicorn xxxxx:app
您正在发出 Heroku 将运行的命令。在您转向 Heroku 之前,您应该确保您可以在您的开发机器上运行这个命令。
您传递给 gunicorn 的“xxxxx”参数是 gunicorn 将导入以获取您的应用程序对象的包或模块。如果您在 app.py 中创建应用程序,那么它应该是“app”(不应包含 .py 扩展名)。出现错误是因为 gunicorn 发出了 import xxxxxx
并且显然失败了,因为您没有定义具有该名称的包或模块。
在冒号的另一边,您必须输入您的应用程序名称。例如,如果您的 app.py 文件中有以下代码:
app = Flask(__name__)
那么你的应用名称就是app
。对于此设置,Procfile 应为:
web: gunicorn app:app
然后gunicorn会发出一个import app
(左边的app
)然后在里面寻找一个名为app
的symbol(右边的)端 app
).
希望对您有所帮助。
关于python - gunicorn 在 heroku 中导致错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19352923/
我尝试了几乎所有命令来杀死 gunicorn 服务器。但没有任何效果。我怎样才能杀死这些进程并释放 80 端口 12652 ? Ss 0:00 sudo gunicorn -b
我正在使用 Apache Airflow,发现 gunicorn-error.log 的大小在 5 个月内增长了超过 50 GB。大多数日志消息都是 INFO 级别的日志,例如: [2018-05-1
我正在使用 在 Digital Ocean 上运行 django gunicorn 和 nginx . Gunicorn 用于为静态文件提供 django 和 nginx。 通过网站上传文件后,我无法
我正在使用 Django 1.8,我想用 gunicorn 运行我的应用程序。 我可以从命令行绑定(bind)到我的 IP 运行它: gunicorn myapp.wsgi:application -
我们正在使用 https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker FastAPI 并且能够使用 gunicorn 日志文件自定义我们
我在 docker 上的 centos7 上运行 Airflow 1.8,但我的网络服务器无法访问浏览器。我通过pip2.7安装了airflow。 Flower ui 显示良好,initdb 运行连接
gunicorn.service cannot open WorkingDirectory and the gunicorn executable. I think it's about per
任何想法为什么我的 gunicorn 服务器无法启动? jeffy@originaldjangster:~$ sudo /home/jeffy/django_files/django_test_ven
我已经安装了gunicorn,但是没有找到gunicorn命令: # pip3.4 install gunicorn Requirement already satisfied (use --upgr
我在有监督的ginicorn部署我的django项目。 我在virtualenv中安装了gunicorn,添加到INSTALL_APPS中。 命令./manage.py run_gunicorn -b
我成功安装了gunicorn: remote: -----> Removing .DS_Store files remote: -----> Python app detected remote: -
Systemd 和 Gunicorn 需要某种 wsgi 文件作为 ExecStart 的最后一个参数:http://docs.gunicorn.org/en/latest/deploy.html?h
我正在尝试将基本应用程序部署到 Amazon EC2使用 Django , Gunicorn , 和 Nginx .我有应用 git clone进入我的AWS Ubuntu实例并正在运行 Django
在更新为使用小型模型中的 spacy_en_core_web_lg 后,我的 fastapi 服务器内存不足。 当运行 fastapi 时,会生成 4 个 gunicorn worker,并且根据内存
我有一个基于这个的 ansible 配置虚拟机 https://github.com/jcalazan/ansible-django-stack但出于某种原因,尝试启动 Gunicorn 会出现以下错
我关注 this如何在 Ubuntu 18.04 指南中使用 Postgres、Nginx 和 Gunicorn 设置 Django。 我创建了以下文件 .socket sudo nano /etc/
我正在尝试按照此 [链接][1] 在 Digital Ocean 上部署简单的 Django 应用程序用 gunicorn 实现它的抛出错误 gunicorn.service: Failed with
这里我想问你,用python运行gunicorn uvicorn,和默认从tiangolo有什么区别? 我尝试使用 JMeter 对这些进行压力测试具有线程属性: 从这些,我得到了结果:: 从上面我尝
因此,我有一个简单的 Flask API 应用程序,它运行在运行 tornado worker 的 gunicorn 上。 gunicorn 命令行是: gunicorn -w 64 --backlo
我已经使用 Gunicorn + Nginx + Supervisor 部署了一个 Django 1.6 应用程序。一切正常,但我的 Gunicorn error.log 一直在发送错误。该文件很大,
我是一名优秀的程序员,十分优秀!