OSError: [Errno 99] Cannot assign requested address when starting Dockerized web app

Are you trying to run a web app inside a docker image and getting this error?

File “/usr/local/lib/python3.7/site-packages/tornado/netutil.py”, line 174, in bind_socketsss
>> sock.bind(sockaddr)
OSError: [Errno 99] Cannot assign requested address

Solution:

  1. Close all processes that may be running on your port number. Assuming you are running on port 8000: lsof -t -i tcp:8000 | xargs kill -9

2. You are probably using an app adress as “localhost” or “127.0.0.1”
Change it to “0.0.0.0”

I write myself out. Code Chef | Athlete | I Dance and Love travelling. I’m diving into Data Science.

I write myself out. Code Chef | Athlete | I Dance and Love travelling. I’m diving into Data Science.