0

I have this weird problem, normally I deployed an API using FastAPI inside a docker, my configuration is like below:

command: bash -c "wait-for my_services_container:50005 -- uvicorn rest_api:app --host 0.0.0.0 --port 9001"

Now suddenly, the API doesn't return any response, I checked logs and see it still processes incoming requests (just doesn't return results).

I logged into the docker and call localhost:9001, still the same, so I guess it's not about docker port mapping, something to do with FastAPI and Uvicorn. Anyway, does anyone get an idea where to check? Thanks

dac.le
  • 75
  • 1
  • 6
  • Whats your ouput when you run a command line version of the request, (not the browser), use curl, wget or httpie – Matt Seymour Aug 14 '22 at 06:29
  • can you send the boot file : `server.py` or `app.py` (or whatever you called it) that contains the different routes ? – jossefaz Aug 14 '22 at 07:30
  • Sorry, I found a problem with my DB call. I update DB after completing the process and before returning the response. And it hangs when updating DB. – dac.le Aug 15 '22 at 07:11
  • You could use a `BakcgroundTask`, as described in [this answer](https://stackoverflow.com/a/71221061/17865804). – Chris Aug 18 '22 at 07:22

0 Answers0