for-linux icon indicating copy to clipboard operation
for-linux copied to clipboard

Can't start container when I use --publish argument. Getting an error with failed to start docker-proxy

Open thespirit61 opened this issue 9 months ago • 6 comments

If I try to run a container and use the --publish argument I do get following error: docker: Error response from daemon: failed to set up container networking: driver failed programming external connectivity on endpoint nextcloud-aio-mastercontainer (f80ac1d079ef11d3d09ddd92aa60f4bd57db28713d280b18b990b4036194a0e2): failed to start userland proxy for port mapping 0.0.0.0:80:172.17.0.2:80/tcp: failed to start docker-proxy, check that the current version is in your $PATH

This is true for different ports, not just 80. If I use the --network host I can run the container.

So somehow my bridge network is broken. Tried to create a new bridge network, but same issue.

I could not find any post on google to that error message. Can someone help me?

Thanks, Furkan

thespirit61 avatar Mar 12 '25 15:03 thespirit61

Can anyone help me here? I can provide more data if needed :)

thespirit61 avatar Mar 14 '25 11:03 thespirit61

Hey @thespirit61 are you using Docker Desktop?

I've also come across this and will try direct to the relevant people.

Have you tried completely re-installing Docker?

Benehiko avatar Mar 19 '25 12:03 Benehiko

Hello @Benehiko ,

no I am not running Docker Desktop at all. Yes I tried to re-install Docker, didn't work for me.

My solution was to downgrade the docker version, which solved the problem. So somehow the newest release of my Docker version broke something.

thespirit61 avatar Mar 19 '25 12:03 thespirit61

Hi @thespirit61 - the important part of the error message is failed to start docker-proxy, check that the current version is in your $PATH ...

The moby 28.x version of the docker-proxy binary takes an extra argument that older versions won't understand. I think your dockerd is probably running with a $PATH that picks up an older version?

You can check the version of a docker-proxy binary like this ...

# docker-proxy --version
docker-proxy (commit bbd0a17) version 28.0.1

If you can't find an older version, or it's not clear what PATH the daemon is running with - you could try adding the correct path to your /etc/docker/daemon.json config file. Something like this, but with the path to the docker-proxy installed with version 28.x (which might be /usr/bin/docker-proxy) ...

"userland-proxy-path": "/path/to/my/docker-proxy"

Hopefully that'll sort things out - but, do let us know.

robmry avatar Mar 19 '25 13:03 robmry

Hey @robmry , many many thanks for your detailed answer. I did read about the moby thing in some other Reddit post. I am just confused, should that not be updated automatically wiht the docker package itself? Or do you think this is just some error happening on my side? I will try why you did suggested and see how it goes.

thespirit61 avatar Mar 19 '25 15:03 thespirit61

Yes, the new version of docker-proxy would normally be installed along with dockerd (although you've not mentioned what OS you're using, or how you installed docker).

But, even if the new docker-proxy was installed, perhaps there's an old version of docker on your host and its docker-proxy is getting picked up from the $PATH instead of the new one.

robmry avatar Mar 19 '25 15:03 robmry

Update: After updating my docker engine I got the same error. Did run: docker-proxy --version and could see that it is showing me a version with 27.x Did run: /usr/bin/docker-proxy --version and could see the version 28.x

Did run: which docker-proxy and deleted the file it showed me (/usr/local/bin/docker-proxy)

After restart of the machine, the containers did start successfully. Thanks for your help here @robmry !

By the way I am running a Debian 12 here.

thespirit61 avatar Apr 11 '25 09:04 thespirit61

Great! Thank you for the update.

robmry avatar Apr 11 '25 09:04 robmry