Working with a local DB defined in a docker-compose file makes life much easier than spinning up a virtual machine. It also is much easier than manually running a docker command to spin up the said database. You can just spin up and tear down a database in an instant, especially when using tools like Liquibase or Flyway that allow building back up your database schema within seconds.
Sometimes you rely on tools that make your life so much easier, especially in software development. And yes, sometimes it works great. Then there are these days that cancel your time savings. Last Friday was one of these days.
While I was running a spike, which is basically exploring potential solutions for a given problem, I hit a wall. I had a configuration error on one of the containers while exploring the various configs we could use to figure a certain problem. That configuration error made the container crash and since it was restarting automatically, I got into a crash-loop situation. At some point, IntelliJ, which I ran my docker-compose file through, froze. From there, I decided to kill it in a mostly peaceful way. This happened a couple of times but one of the times led me to a world of pain. The compose-up command didn’t work anymore. I was stuck with the following message: “driver failed programming external connectivity on endpoint”.
I tried quite a few things like running the compose-up command in the terminal, killing and restarting IntelliJ and even the laptop but nothing.
“driver failed programming external connectivity on endpoint”
The message remains, taunting me almost. Eventually I figured that the message means that the port is occupied by another process. However, the only process that ever used that port is the one I’m trying to spawn through the compose-up command. This where I went through all the diagnostic commands I knew to check whether the port was occupied and nothing. No other process is using that port so it must me a Docker cock-up.
From there, I start searching through DuckDuckGo and I find some stuff on StackOverflow but nothing works or is something I’ve already tried. Eventually, I decided to figure a way to kill Docker efficiently on mac and found a StackOverflow entry that worked. Also, I found an issue on Docker’s GitHub from 2016 describing the same symptoms but long closed. Surprisingly though, a lot of people keep commenting that this happens to them which is why I believe it might just be a symptom of something else. Still, in case you run into a similar issue, here is the command I ran to escape this pain:
killall Docker && open /Applications/Docker.app
Yes, it works only for Mac OS but I’m sure there’s something similar for Windows and I’ll add it if I find it.
Thank you for reading and don’t hesitate to share this post with your peers. Feel free to check out my previous post right here.
Cover by Tima Miroshnichenko from Pexels