开发者

Using Herkou, Python, Gunicorn, and Flask trying to host a web application but getting application error

I am using python, heroku, gunicorn, and flask attempting to host a very basic web application. The URL provides me only with the error shown below: enter image description here

Here are the errors in the error log, they are common, ive read as many stack overflow questions about this issue as I can find and none have helped.

2022-12-07T00:43:06.517424+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR) 2022-12-07T00:43:06.517467+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3> 2022-12-07T00:43:06.672564+00:00 heroku[web.1]: Process exited with status 1 2022-12-07T00:43:06.728584+00:00 heroku[web.1]: State changed from up to crashed 2022-12-07T00:43:19.882600+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=spo-bet-an.herokuapp.com request_id=b11bfee6-9bdd-4a2d-a446-92a927818e54 fwd="65.189.83.94" dyno= connect= service= status=503 bytes= protocol=https 2022-12-07T00:43:20.529051+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=spo-bet-an.herokuapp.com request_id=d1e24818-b06e-4cec-b254-11812b71dd9c fwd="65.189.83.94" dyno= connect= service= status=503 bytes= protocol=https

Here are my files for reference:

home.py

import os
from flask import Flask
app = Flask(__name__)

@app.route('/')
def index():
    return 'Hello World'

if __name__ == '__main__':
    port = int(os.environ.get('PORT'))
    app.run(host='0.0.0.0', port=port, debug=True)

Procfile

web: gunicorn --bind 0.0.0.0:${PORT} home:app

I have also tried

web: gunicorn home:app

with the following Procfile

import os
from flask import Flask
app = Flask(__name__)

@app.route('/')
def index():
    return 'Hello World'

if __name__ == '__main__':
    app.run()

I have tried as many changes as i can think of to the Profile and not one thing has helped. I am a software developer and have a decent understanding of things like this and am completely stumped. At this point the only thing that could potentially be affecting it is the requirements.txt Ive seen people say one of their packages was wrong but I have no idea how to determine if any of mine are wrong, after typing this I will most likely comment them out one by one and see if that can isolate the issue. here is said file:

async-generator==1.10
attrs==22.1.0
certifi==2022.9.24
cffi==1.15.1
charset-normalizer==2.1.1
click==8.1.3
colorama==0.4.6
dnspython==2.2.1
Flask==2.2.2
gunicorn==20.1.0
h11==0.14.0
heroku==0.1.4
idna==3.4
itsdangerous==2.1.2
Jinja2==3.1.2
MarkupSafe==2.1.1
outcome==1.2.0
packaging==21.3
pycparser==2.21
pymongo==4.3.3
pyparsing==3.0.9
PySocks==1.7.1
python-dateutil==1.5
python-dotenv==0.21.0
requests==2.28.1
selenium==4.6.1
sniffio==1.3.0
sortedcontainers==2.4.0
tqdm==4.64.1
trio==0.22.0
trio-websocket==0.9.2
urllib3==1.26.13
webdriver-manager==3.8.5
Werkzeug==2.2.2
wsproto==1.2.0
uwsgi
gunicorn

I have tried with and without both the gunicorn and uwsgi, ive made attempts to use uwsgi instead 开发者_高级运维of guniocrn though I dont think I was using it correctly nor think my pip install of uswgi worked, or if it was even needed. For more reference points, I am on windows, I am not using a virtualenv, and I have not changed any system variables because I could not find anyone saying how to change them or what to. All files are in the directory as well. If there are any other files that need to be seen please let me know, or if you have even remotely any idea what could help, it would be greatly greatly appreciated.

Thanks

I am trying to host a flask python application using gunicorn and heroku and am getting an application error.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜