You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[1.7.0-rc2] Connection reset from published ports #13847
The stale arp may be related to docker crashing earlier while I was strace'ing it.
This problem doesn't occur all of the time, as I have another host running 1.7.0 in a less demanding role with no issues. The problem may be related to a process unsuccessfully attempting to create a couple containers every second overnight (1.6.0 handles that fine).
TL;DR of below: port 5000 is bound in and outside of the container. The service responds correctly inside the container, but I just get econnreset from outside.
I don't have much time this week but I'll gather more information if I have some free moments.
[email protected]:~ 56$ docker ps | grep 5000
b6aad66a24a5 10186dca14f8a7373019edf1c049c50c10d2d40db75452fb1ee431ff55a45092 "registry cmd/regist 12 hours ago Up 12 hours 0.0.0.0:5000->5000/tcp borg-registry-docker-registry-1-6177
[email protected]:~ $ borg-enter b6a
root@borg-registry-docker-registry-1:/# curl localhost:5000/v2/
{}
root@borg-registry-docker-registry-1:/# logout
[email protected]:~ $ curl -vvv localhost:5000/v2/
* Hostname was NOT found in DNS cache
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 5000 (#0)
> GET /v2/ HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:5000
> Accept: */*
>
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer
[email protected]:~ 56$
is failing is kind of strange. Because that should not need port forwarding at all since you are trying to reach that purely as a directly connected host.
Trying to repro in my end but so far no luck. As you said it's probably related to those overnight smoke test that you were doing.
@icecrime The fact that @burke is getting a ECONNRESET even as a directly connected host i.e using the private 172.17.0.x IP tells us that iptable rules should not be involved in that path. Only routing via docker0. So I am not confident that duplicate rules are a root cause of this issue. This of course hinges on the fact that he is getting the same failure when he is trying to reach the container IP directly.
@burke can you double confirm what I mentioned above. Also can you let me know what kind of overnight test that you were running in more detail so that I can try it out here?
Yes, correct, some takeaways from my troubleshooting above:
The ECONNRESET is actually not related to the docker-proxy because I get ECONNREFUSED when I directly access 172.17.0.2:5000.
Duplicate rules are one problem, but the connection failure is probably not iptables's fault because the behaviour does not change when I sudo stop ufw, and I don't see an iptables initscript. I'm not exactly sure how/whether ufw interacts with iptables...
The overnight "test" is that we had 2-5 initscripts trying to start containers every second, but failing because their images were gone from the registry or something... I'm not sure precisely; this machine is just in a really unhappy state because it has a broken docker and we haven't attempted to keep it in a happy state.
So it was just a stale ARP table line. arp -d 172.17.0.2 fixed the problem (ie. no more ECONNREFUSED, curl works correctly again), but is there some cleanup that's supposed to happen there that isn't?
Reacted by Dennis, Maksim Sadakov, Hevlastka, Chance Zibolski and Alexey Karasev
@burke Thanks for all the info that you provided. With that we can say that there was change in the way we generate mac address which was in 1.6 based on the IP address itself while in 1.7 libnetwork implementation it can be completely random which creates those stale arp entries which affects connectivity. Working on a fix. Most likely a fix should be available in 1.7-rc3
@andrefreitas please open a new issue with more details. This issue was opened with docker 1.6, and a lot has changed, so it's likely to have a different root cause (but the same effect)
Activity
burke commentedon Jun 10, 2015
At 15:22:06 in the capture below, I ran
curl localhost:5000/v2/in another shell.burke commentedon Jun 10, 2015
Oh, interesting:
I don't understand where
172.17.0.1is coming from, or why it's able to hit the registry properly, when nothing else can.EDIT:
Oh, docker just lost track of a process, probably in a crash while I was strace'ing it yesterday:
So that explains why it responded on
172.17.0.1, but not why it won't respond on172.17.0.2even though it responds locally inside that namespace.burke commentedon Jun 10, 2015
Okay, working my way outward here,
Inside the container
Host
iptables -LAlso, I stopped
ufwand it didn't help the situation.burke commentedon Jun 10, 2015
Pinging some people from libnetwork just because it seems likely related: @mavenugo @mrjana @aboch
As an aside, the duplicate iptables rules are curious; I don't see those in 1.6.0.
LK4D4 commentedon Jun 10, 2015
@burke Do you use
--userland-proxy=false?jessfraz commentedon Jun 10, 2015
The duplicate rules is definitely a regression we had fixed that in I want to say 1.3
burke commentedon Jun 10, 2015
@LK4D4 We do not pass
--userland-proxy=anythinganywhere in our stack.LK4D4 commentedon Jun 10, 2015
@burke I suggest you to switch :) But probably it isn't issue(but might be!)
mrjana commentedon Jun 10, 2015
@burke The fact that
is failing is kind of strange. Because that should not need port forwarding at all since you are trying to reach that purely as a directly connected host.
Trying to repro in my end but so far no luck. As you said it's probably related to those overnight smoke test that you were doing.
thaJeztah commentedon Jun 10, 2015
@jfrazelle if this is what you're talking about; added in #6950 and removed in #12437
icecrime commentedon Jun 10, 2015
This has properly been backported to libnetwork, could it be the source of the regression?
mrjana commentedon Jun 10, 2015
@icecrime The fact that @burke is getting a
ECONNRESETeven as a directly connected host i.e using the private 172.17.0.x IP tells us that iptable rules should not be involved in that path. Only routing via docker0. So I am not confident that duplicate rules are a root cause of this issue. This of course hinges on the fact that he is getting the same failure when he is trying to reach the container IP directly.@burke can you double confirm what I mentioned above. Also can you let me know what kind of overnight test that you were running in more detail so that I can try it out here?
jessfraz commentedon Jun 10, 2015
Regardless we should not be creating duplicate rules....
burke commentedon Jun 10, 2015
Yes, correct, some takeaways from my troubleshooting above:
ECONNRESETis actually not related to thedocker-proxybecause I getECONNREFUSEDwhen I directly access172.17.0.2:5000.iptables's fault because the behaviour does not change when Isudo stop ufw, and I don't see aniptablesinitscript. I'm not exactly sure how/whetherufwinteracts withiptables...The overnight "test" is that we had 2-5 initscripts trying to start containers every second, but failing because their images were gone from the registry or something... I'm not sure precisely; this machine is just in a really unhappy state because it has a broken docker and we haven't attempted to keep it in a happy state.
burke commentedon Jun 10, 2015
iptables -LAnd also, dunno if this is helpful, but:
burke commentedon Jun 10, 2015
And...
So it was just a stale ARP table line.
arp -d 172.17.0.2fixed the problem (ie. no moreECONNREFUSED,curlworks correctly again), but is there some cleanup that's supposed to happen there that isn't?mrjana commentedon Jun 10, 2015
@burke Thanks for all the info that you provided. With that we can say that there was change in the way we generate mac address which was in 1.6 based on the IP address itself while in 1.7 libnetwork implementation it can be completely random which creates those stale arp entries which affects connectivity. Working on a fix. Most likely a fix should be available in 1.7-rc3
andrefreitas commentedon Sep 19, 2016
Hi had the same problem in Docker Version 1.12.1. Cleaning the ARP entry for the Container IP fixed.
thaJeztah commentedon Sep 19, 2016
@andrefreitas please open a new issue with more details. This issue was opened with docker 1.6, and a lot has changed, so it's likely to have a different root cause (but the same effect)