简体   繁体   English

Heroku 应用程序成功部署,但在加载站点时收到应用程序错误

[英]Heroku app successfully deploying, but receiving an application error when loading site

The message is that the app was successfully deployed but when I load the app it display this error:消息是应用程序已成功部署,但当我加载应用程序时显示此错误:

An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command

My logs are indicating some errors but what is that I am doing wrong?我的日志显示了一些错误,但我做错了什么?

when run:运行时:

$ heroku logs -a disastresponse --tail $ heroku logs -a disastresponse --tail

this is the output:这是 output:

2022-02-11T04:06:42.642514+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.9/importlib/__init__.py", line 127, in import_module
2022-02-11T04:06:42.642515+00:00 app[web.1]: return _bootstrap._gcd_import(name[level:], package, level)
2022-02-11T04:06:42.642516+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
2022-02-11T04:06:42.642516+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
2022-02-11T04:06:42.642516+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
2022-02-11T04:06:42.642517+00:00 app[web.1]: ModuleNotFoundError: No module named 'app'
2022-02-11T04:06:42.642579+00:00 app[web.1]: [2022-02-11 04:06:42 +0000] [10] [INFO] Worker exiting (pid: 10)
2022-02-11T04:06:42.676775+00:00 app[web.1]: [2022-02-11 04:06:42 +0000] [4] [WARNING] Worker with pid 10 was terminated due to signal 15
2022-02-11T04:06:42.776963+00:00 app[web.1]: [2022-02-11 04:06:42 +0000] [4] [INFO] Shutting down: Master
2022-02-11T04:06:42.777013+00:00 app[web.1]: [2022-02-11 04:06:42 +0000] [4] [INFO] Reason: Worker failed to boot.

Procfile:简介:

web: gunicorn app:run

requirements.txt要求.txt

flask==2.0.2
gunicorn==20.1.0
joblib==1.1.0
nltk==3.6.5
plotly==5.1.0
numpy==1.22.2
pandas==1.4.0
pip==21.2.4
regex==2021.8.3
scikit-learn==1.0.1
scipy==1.7.3
sqlalchemy==1.4.27

Here all my run.py imports:这是我所有的 run.py 进口:

import json
import plotly
import pandas as pd
import numpy as np
import os

from nltk.stem import WordNetLemmatizer
from nltk.tokenize import word_tokenize

from flask import Flask
from flask import render_template, request, jsonify
from plotly.graph_objs import Bar
# from sklearn.externals import joblib
import joblib
from sqlalchemy import create_engine

app = Flask(__name__)

Am I missing something?我错过了什么吗?

Your Gunicorn argument is backwards.你的 Gunicorn 论点是倒退的。

Since your app object is called app and it is in a file called run.py , you should launch Gunicorn like this:由于您的应用程序 object 名为app并且位于名为run.py的文件中,因此您应该像这样启动 Gunicorn:

web: gunicorn run:app

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Heroku 应用成功部署,但加载站点时收到应用程序错误 - Heroku app successfully deploying, but receiving application error when loading site Heroku 应用程序成功部署,但在加载站点时收到应用程序错误。 但我似乎可以找到一个错误 - Heroku app successfully deploying, but receiving application error when loading site. But I can seem to find an error 应用程序错误:我的 Flask-web-app 已成功部署在 Heroku 上,但在加载站点时收到应用程序错误 - Application error: My Flask-web-app is successfully deploy on Heroku but receiving application error when loading site Heroku 应用成功部署,但收到应用错误 - Heroku app successfully deploying, but receiving application error Heroku 应用程序成功部署,但打开应用程序时收到应用程序错误 - Heroku app successfully deployed, but receiving application error when opening app 部署 Dash 应用程序时出现 Heroku 应用程序错误 - Heroku Application Error when deploying Dash app Heroku 部署 Flask 应用程序时出现“应用程序错误” - Heroku "Application error" when deploying Flask app 成功部署 Django API 到 Heroku 后应用程序错误 - Application Error after successfully deploying Django API to Heroku Heroku 应用部署成功但应用报错 - Heroku app deployed successfully but Application Error 将 Django 应用程序部署到 Heroku 时未加载图像 - Images not loading when deploying Django app to Heroku
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM