Gunicorn deployment failing

Working on a python flask backend and long story short I need async / await for a chatbot so I decided to upgrade to gunicorn so i could use threading-- but now deploy doesn’t work

my .replit file currently looks like this

run = "poetry run gunicorn -w 4 -k uvicorn.workers.UvicornWorker -b app:app"
modules = ["python-3.10:v25-20230920-d4ad2e4"]

channel = "stable-23_05"

run = [
  "poetry run gunicorn -w 4 -k uvicorn.workers.UvicornWorker -b app:app",
deploymentTarget = "cloudrun"
disableGuessImports = true
build = ["sh", "-c", "poetry install"]

in the deploy tab i see:
2024-03-05T05:38:41Z error: The deployment failed to initialize due to a configuration or code error. Check the logs tab for more information. For additional support, please post on and a staff member will take a look.

in the logs it looks like the server started correctly. when i hit run it seems to start fine locally as well. not sure how to debug further… suspect it’s some kind of port forwarding thing but unsure how to fix.

Welcome to Ask @plitvak!

What type of deployment are you deploying your repl as?

Autoscale./ Dedicated VM !

Web server or Background worker?

It’s a web server! Running with autoscale

Can you please provide a link to the repl?

Also see this guide on how to share your code:

1 Like