Skip to content

[DO NOT MERGE] Add hostname to IP resolution to all Dockerfiles that use yum - #9230

Closed
stevekuznetsov wants to merge 1 commit into
openshift:masterfrom
stevekuznetsov:skuznets/yum-debug
Closed

stevekuznetsov wants to merge 1 commit into
openshift:masterfrom
stevekuznetsov:skuznets/yum-debug

Conversation

@stevekuznetsov

Copy link
Copy Markdown
Contributor

Signed-off-by: Steve Kuznetsov [email protected]

/cc @wshearn

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

[test]

Comment thread Dockerfile Outdated
ENV GOPATH=/go \
PATH=$PATH:$GOROOT/bin:$GOPATH/bin

RUN getent hosts mirrorlist.centos.org

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't we want a single RUN statement for all of these to avoid adding another layer? I would expect this command &&-ed with the other commands

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we want to avoid the layer?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking we wouldn't merge this but just kick it until it failed -- was merging this and making it part of the images for a while a possiblity?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't realize this was non-merging debug code

@stevekuznetsov stevekuznetsov changed the title Add hostname to IP resolution to all Dockerfiles that use yum [DO NOT MERGE] Add hostname to IP resolution to all Dockerfiles that use yum Jun 9, 2016
@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

re[test]

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

@wshearn we have our first hit:

--> RUN getent hosts mirrorlist.centos.org
2a01:c0:2:4:0:acff:fe1e:1e52 mirrorlist.centos.org
--> RUN mkdir $TMPDIR &&     INSTALL_PKGS="gcc zip mercurial" &&     yum install -y $INSTALL_PKGS &&     rpm -V $INSTALL_PKGS &&     yum clean all &&     curl https://storage.googleapis.com/golang/go$VERSION.linux-amd64.tar.gz | tar -C /usr/local -xzf - &&     go get golang.org/x/tools/cmd/cover github.com/tools/godep github.com/golang/lint/golint &&     touch /os-build-image
Loaded plugins: fastestmirror, ovl
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras&infra=stock error was
12: Timeout on http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras&infra=stock: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')


 One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Disable the repository, so yum won't use it by default. Yum will then
        just ignore the repository until you permanently enable it again or use
        --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>

     4. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

Cannot find a valid baseurl for repo: extras/7/x86_64

re[test]

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 13, 2016
@jperrin

jperrin commented Jun 13, 2016

Copy link
Copy Markdown

So in this instance you're attempting to pull the mirrorlist info over ipv6. I was under the impression that ec2 lacked ipv6 support, but I don't regularly use aws so I could be mistaken, or working from older information.

@stevekuznetsov

stevekuznetsov commented Jun 13, 2016 •

Copy link
Copy Markdown
Contributor Author

@jperrin my debug statement seems to be resolving an IPv6 host but that may be an error on my part ... the IP resolved by curl is IPv4 and

$ getent hosts mirrorlist.centos.org
2a01:c0:2:4:0:acff:fe1e:1e52 mirrorlist.centos.org

$ curl -g -6 "http://[2a01:c0:2:4:0:acff:fe1e:1e52]"
curl: (7) Failed to connect to 2a01:c0:2:4:0:acff:fe1e:1e52: Network is unreachable

$ ping -c 1 mirrorlist.centos.org
PING mirrorlist.centos.org (108.61.16.227) 56(84) bytes of data.
...

$ curl 108.61.16.227
...
<address>Apache/2.2.15 (CentOS) Server at 108.61.16.227 Port 80</address>
</body></html>

I can switch over to using getent ahostsv4 to see which are available and the ping to see which we connect to.

@openshift-bot openshift-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 13, 2016
@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

@danmcp is this a vagrant plugin timeout on a command firing?

Running transaction
  Installing : mpfr-3.1.1-4.el7.x86_64                                     1/10 
  Installing : libmpc-1.0.1-3.el7.x86_64                                   2/10Timeout occurred while running ssh/sudo command: 
echo "Building base images..."
set -e
pushd /data/src/github.com/openshift/origin
  hack/build-base-images.sh
popd
Build step 'Execute shell' marked build as failure

@danmcp

danmcp commented Jun 13, 2016

Copy link
Copy Markdown

@stevekuznetsov Yes

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

re[test]

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

flake, gosh darn it

re[test]

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

Forcing the flake is somehow seeming fruitless ... @wshearn is there a more targeted test I could do with the output from getent ahostsv4 mirror.centos.org? Are we just looking to see if it's a specific server that is having connection difficulties?

re[test]

@jperrin

jperrin commented Jun 14, 2016

Copy link
Copy Markdown

yes. I would need to know if it's a specific centos.org machine that's acting up, or if it's something in amazon's networking. If it's one of ours then we can address it, but we've had no other complaints like this. My immediate reaction is to blame amazon's network, but I'd like to have proof one way or the other.

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

Woooo! Flake:

--> RUN getent ahostsv4 mirrorlist.centos.org && ping -c 1 mirrorlist.centos.org
107.158.252.36  STREAM mirrorlist.centos.org
107.158.252.36  DGRAM  
107.158.252.36  RAW    
108.61.16.227   STREAM 
108.61.16.227   DGRAM  
108.61.16.227   RAW    
84.22.180.89    STREAM 
84.22.180.89    DGRAM  
84.22.180.89    RAW    
88.150.173.218  STREAM 
88.150.173.218  DGRAM  
88.150.173.218  RAW    
PING mirrorlist.centos.org (88.150.173.218) 56(84) bytes of data.

...

Cannot find a valid baseurl for repo: updates/7/x86_64
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates&infra=stock error was
12: Timeout on http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates&infra=stock: (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')

re[test]

@openshift-bot

Copy link
Copy Markdown
Contributor

Evaluated for origin test up to 230c799

@jperrin

jperrin commented Jun 14, 2016

Copy link
Copy Markdown

Using the ip above, I set this in my local dns, and ran the following
for i in {1..100} ; do { time curl 'http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates&infra=stock' ; } &>>foo ; done

In 100 iterations, the one query stood out as the slowest, at 1.270s, everything else averages 0.28 seconds. I don't think 1.2 seconds should be enough for yum to time out.

I'll continue to test, but I don't see anything amazingly abnormal on this end.

@jperrin

jperrin commented Jun 14, 2016

Copy link
Copy Markdown

Discussing this with our infra guy, and it appears this is likely related to another issue. https://bugs.centos.org/view.php?id=10685

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

Running this 1000 times in EC2 I see the following times (top thirty longest) in seconds for real from time:

.267
.268
.269
.272
.274
.276
.277
.280
.281
.285
.289
1.027
1.027
1.028
1.029
1.044
1.072
1.106
1.122
1.123
1.123
1.125
1.126
1.128
1.131
1.162
1.172
1.178
1.178
1.235
1.321
3.126
5.635
6.034
6.432
8.179
9.050
10.871
17.044
63.443

@stevekuznetsov

stevekuznetsov commented Jun 14, 2016 •

Copy link
Copy Markdown
Contributor Author

I can stick strace on the calls if you want to confirm it's that bug.

Here's the log from the most egregious failure:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   410  100   410    0     0      6      0  0:01:08  0:01:03  0:00:05    97
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>503 Service Temporarily Unavailable</title>
</head><body>
<h1>Service Temporarily Unavailable</h1>
<p>The server is temporarily unable to service your
request due to maintenance downtime or capacity
problems. Please try again later.</p>
<hr>
<address>Apache/2.2.15 (CentOS) Server at mirrorlist.centos.org Port 80</address>
</body></html>

real    1m3.443s
user    0m0.009s
sys 0m0.005s

@jperrin

jperrin commented Jun 14, 2016

Copy link
Copy Markdown

yup. that's consistent with what was reported in our bugtracker.

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

Is there any way to configure yum to re-try the connection to the mirror list so we can be more resilient to this failure?

@openshift-bot

Copy link
Copy Markdown
Contributor

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

For reference, we have the following yum.conf:

[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=0
plugins=1
installonly_limit=3
retries=20
timeout=120

@jperrin

jperrin commented Jun 14, 2016

Copy link
Copy Markdown

there's no way that I'm aware of to configure yum to retry the connection.

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

@jperrin how can we best approach this? Since I seem to be able to repro it on the EC2 instances... is there other data I can collect for you? That bug report looks like the root cause (of the 503) hasn't been determined

@openshift-bot

Copy link
Copy Markdown
Contributor

Origin Action Required: Pull request cannot be automatically merged, please rebase your branch from latest HEAD and push again

@openshift-bot openshift-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 15, 2016
@arrfab

arrfab commented Jun 16, 2016

Copy link
Copy Markdown

Just to add that we went "live" with the new backend code behind mirrorlist.centos.org and at first sight (on monitoring side/status/response time) the intermittent error should have disappeared. Can you confirm that it fixes the issue for you too ?

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

@arrfab over 5k pings we see this distribution on AWS EC2 (logarithmic scale on frequency axis):

loghist

Long tail, slowest 30 are:

.670
.673
.679
.692
.697
.719
.739
.742
.748
.754
.773
.789
.830
.834
.872
.878
.943
.948
1.010
1.037
1.047
1.081
1.146
1.180
1.355
1.454
1.609
1.630
2.682
3.603

However, nothing that will cause failures I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants