FastAPI Python Web Service Timeout even with correct Host/Port

My FastAPI web service deploy is getting stuck on Finished Server Process on the Oregon US West server

I noticed other people had similar problems and their issue was fixed by placing

if __name__ == "__main__":
    import uvicorn

    uvicorn.run(app, host="0.0.0.0", port=10000)

and starting the server with the host and port specified to 0.0.0.0 and 10000

uvicorn main:app --host 0.0.0.0 --port 10000

but the deploy is still getting stuck and eventually timing out after a while.

Is there anything else I’m missing?

Hi,

From what you’ve shared, it looks like it should be fine.

Have you set a PORT env var anywhere?

Alan

1 Like

Ahh, I had the PORT env variable set to something different. It’s working now, thank you!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.