Reputation: 309
I am getting an issue with deploying my dash app to azure.
I've named the file application.py and I have the following at the start of my code, what else am I missing?
app = dash.Dash()
server = app.server
2020-07-15T02:10:24.794459675Z A P P S E R V I C E O N L I N U X
2020-07-15T02:10:24.794463776Z
2020-07-15T02:10:24.794467576Z Documentation: http://aka.ms/webapp-linux
2020-07-15T02:10:24.794471676Z Python 3.7.7
2020-07-15T02:10:24.794475676Z Note: Any data outside '/home' is not persisted
2020-07-15T02:10:25.516192798Z Starting OpenBSD Secure Shell server: sshd.
2020-07-15T02:10:25.598758328Z App Command Line not configured, will attempt auto-detect
2020-07-15T02:10:25.599342840Z Launching oryx with: create-script -appPath /home/site/wwwroot -output /opt/startup/startup.sh -virtualEnvName antenv -defaultApp /opt/defaultsite -bindPort 8000
2020-07-15T02:10:26.005607153Z Found build manifest file at '/home/site/wwwroot/oryx-manifest.toml'. Deserializing it...
2020-07-15T02:10:26.017403300Z Build Operation ID: |dIT9rOZuwzA=.7809ead2_
2020-07-15T02:10:26.035129571Z Oryx Version: 0.2.20200522.2, Commit: bf724c0e83f3da74487f55cd304c63331dab7067, ReleaseTagName: 20200522.2
2020-07-15T02:10:27.985241432Z Detected an app based on Flask
2020-07-15T02:10:28.468481213Z Generating `gunicorn` command for 'application:app'
2020-07-15T02:10:29.130746361Z Writing output script to '/opt/startup/startup.sh'
2020-07-15T02:10:29.846009569Z Found virtual environment .tar.gz archive.
2020-07-15T02:10:29.846799084Z Removing existing virtual environment directory /antenv...
2020-07-15T02:10:29.888516619Z Extracting to directory /antenv...
2020-07-15T02:11:09.888367018Z Using packages from virtual environment antenv located at /antenv.
2020-07-15T02:11:09.971225254Z Updated PYTHONPATH to ':/antenv/lib/python3.7/site-packages'
2020-07-15T02:11:12.262498667Z [2020-07-15 02:11:12 +0000] [42] [INFO] Starting gunicorn 20.0.4
2020-07-15T02:11:12.265001320Z [2020-07-15 02:11:12 +0000] [42] [INFO] Listening at: http://0.0.0.0:8000 (42)
2020-07-15T02:11:12.265446929Z [2020-07-15 02:11:12 +0000] [42] [INFO] Using worker: sync
2020-07-15T02:11:12.282967396Z [2020-07-15 02:11:12 +0000] [45] [INFO] Booting worker with pid: 45
2020-07-15T02:11:18.319408889Z Application object must be callable.
2020-07-15T02:11:18.320327008Z [2020-07-15 02:11:18 +0000] [45] [INFO] Worker exiting (pid: 45)
2020-07-15T02:11:18.640154710Z [2020-07-15 02:11:18 +0000] [42] [INFO] Shutting down: Master
2020-07-15T02:11:18.640571018Z [2020-07-15 02:11:18 +0000] [42] [INFO] Reason: App failed to load.
2020-07-15T02:11:20.084Z ERROR - Container regionals3_0_1ebe0cd6 for site regionals3 has exited, failing site start
2020-07-15T02:11:20.162Z ERROR - Container regionals3_0_1ebe0cd6 didn't respond to HTTP pings on port: 8000, failing site start. See container logs for debugging.
Upvotes: 2
Views: 1544
Reputation: 6024
Based on this line in your error log
2020-07-15T02:10:28.468481213Z Generating `gunicorn` command for 'application:app'
it seems that the generated gunicorn command expects the Flask server to be named app
. Hence if you change you code to
dash_app = dash.Dash()
app = dash_app.server
i guess it should work. Alternatively, you would have to change the (generated) gunicorn command to application:server
.
Upvotes: 3