plotly / dash

Data Apps & Dashboards for Python. No JavaScript Required.
https://plotly.com/dash
MIT License
21.54k stars 2.08k forks source link

Dash crashes when I deploy it with Gunicorn #2569

Open manumartinm opened 1 year ago

manumartinm commented 1 year ago

Describe your context

Describe the bug

I am trying to deploy a dash app to production using Nginx and Ubuntu 22.04, also I am using gunicorn to deploy it.

The problem comes when I try access my domain and dash gives an Internal Server Error due to Flask

TypeError: Flask.__call__() missing 1 required positional argument: 'start_response'

I have not found too much information about this error, and I think it is an internal error

Expected behavior

The app should work fine as in my local machine it work correctly, but when I use it in combination with Gunicorn, it crashes

alexcjohnson commented 1 year ago

I haven’t seen that error before. What is the gunicorn command you’re using to run the app, and what variable is it pointing to in the app file?

manumartinm commented 1 year ago

I am using this command

gunicorn main:server -k uvicorn.workers.UvicornWorker

The server function is a variable that I defined as

server = app.server