简体   繁体   中英

Heroku failed to find application app error

Trying to deploy my dash plotly dashboard on Heroku but getting this error:

2020-02-12T20:06:28.207580+00:00 heroku[web.1]: Starting process with command `gunicorn app:server`
2020-02-12T20:06:34.455328+00:00 heroku[web.1]: State changed from starting to up
2020-02-12T20:07:03.644528+00:00 app[web.1]: WORKER TIMEOUT (pid:10)
2020-02-12T20:07:04.647635+00:00 app[web.1]: WORKER TIMEOUT (pid:11)
2020-02-12T20:07:15.625829+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=kalinaxchallenge.herokuapp.com request_id=f2e2ef3e-c454-45fc-a5f0-f3e4fa1f59e1 fwd="197.221.254.77" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0 protocol=https
2020-02-12T20:07:22.939065+00:00 app[web.1]: Failed to find application: 'app'
2020-02-12T20:07:28.354927+00:00 app[web.1]: Failed to find application: 'app'
2020-02-12T20:07:29.073920+00:00 heroku[web.1]: State changed from up to crashed
2020-02-12T20:07:28.813680+00:00 heroku[router]: at=error code=H13 desc="Connection closed without response" method=GET path="/favicon.ico" host=kalinaxchallenge.herokuapp.com request_id=7c1977fe-5495-4327-990f-68a433ed2269 fwd="197.221.254.77" dyno=web.1 connect=1ms service=11173ms status=503 bytes=0 protocol=https
2020-02-12T20:07:29.059525+00:00 heroku[web.1]: Process exited with status 4

my procfile:

web: gunicorn app:server 

and my requirements.txt

dash_core_components==1.5.1
dash==1.6.1
dash_html_components==1.0.2
pandas==0.25.2
plotly==4.2.1
gunicorn==19.0.0
numpy==1.17.4

and my app.py

if __name__ == '__main__':
        app.run_server(debug=True)

The app runs perfectly locally

Seems to be a weird error message, atleast to me because this is the structure of my project

Procfile
app.json
app.py
dataset1
dataset2
requirements.txt

I'm not sure why its failing to find the app application when its right there

NOTE: I don't have a folder named app and deleted app.json

我通过将此行添加到我的 app.py 解决了这个问题

server = app.server

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM