Thread 1: Fatal error: Address already in use (errno: 48)

Im getting this error “Thread 1: Fatal error: Error raised at top level: bind(descriptor:ptr:bytes:): Address already in use (errno: 48)” right after ran docker then my Xcode:

docker run --name postgres -e POSTGRES_DB=vapor_database \ -e POSTGRES_USER=vapor_username
-e POSTGRES_PASSWORD=vapor_password
-p 5432:5432 -d postgres

I think I am already using a Port but don’t know how to fix this… any suggestions? :confused:

Hey yep that error means something is already using that port. Do you get that error from Docker or Xcode?

If it’s Docker, then make sure you don’t already have a container running or have Postgres locally installed.

If it’s Xcode it might be the annoying bug that’s proving hard to hunt down at the moment which keeps some processes alive. You can either do Debug -> Attach to Process -> Run and stop the process or in terminal run killall Run to kill the existing process

3 Likes

Weird Xcode bug (classic Xcode), worked for me. Thanks Tim.