Repository navigation
Description
-
Your Windows build number:
Microsoft Windows [Version 10.0.17134.48] -
What you're doing and what's happening:
Download kubectl Linux binary, try to connect to cluster:
$ kubectl version -v9
I0722 21:30:48.428020 13284 loader.go:359] Config loaded from file /home/cape/.kube/config
I0722 21:30:48.429146 13284 round_trippers.go:386] curl -k -v -XGET -H "Accept: application/json, */*" -H "User-Agent: kubectl/v1.11.1 (linux/amd64) kubernetes/b1b2997" 'https://<cluster>/version?timeout=32s'
E0722 21:30:48.429167 13284 round_trippers.go:375] CancelRequest not implemented
I0722 21:30:48.429509 13284 round_trippers.go:405] GET https://<cluster>/version?timeout=32s in 0 milliseconds
I0722 21:30:48.429795 13284 round_trippers.go:411] Response Headers:
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.1", GitCommit:"b1b29978270dc22fecc592ac55d903350454310a", GitTreeState:"clean", BuildDate:"2018-07-17T18:53:20Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
I0722 21:30:48.430235 13284 helpers.go:219] Connection error: Get https://<cluster>/version?timeout=32s: context deadline exceeded (Client.Timeout exceeded while awaiting headers)
F0722 21:30:48.430434 13284 helpers.go:119] Unable to connect to the server: context deadline exceeded (Client.Timeout exceeded while awaiting headers)
glog: Flush took longer than 10s
Trying many times, there's a few different causes reported:
Unable to connect to the server: dial tcp <cluster-ip>:443: i/o timeoutdial tcp: lookup <cluster> on <dns-server>:53: no such host
Notice the very short span of time executing, vs the timeouts claimed - ~2.414ms, while it says it waits 32s for the version call, and glog claims 10+s. Something seems to be off with how time is calculated, and given it is a Go program I'd guess that the reading of the monotonic clock doesn't work?
Note that the curl call mentioned in the log output works well if executed manually. Also, the Windows binary of kubectl works (even from within WSL).
-
What's wrong / what should be happening instead:
It should work -
Strace of the failing command, if applicable:
kubectl.strace
Activity
therealkenc commentedon Jul 22, 2018
The
stracelog here appears to be single threaded. Needstrace -f -o kubectl.strace strace kubectl version -v9and CLI repro steps. That said, this looks configy to me from 40,000 feet. It appears to be using the literal stringhttps://<cluster>/version?timeout=32s. Chances of that being due to a syscall diverge is nonzero but small.carlpett commentedon Jul 23, 2018
Oops, sorry. Updated the gist with correct trace.
Also, the
<cluster>thing was a redaction, apologies for not making that clear. As I mentioned in the end there, the url works if I call it from curl in WSL for example. And the same config+command works with kubectl.exe, so I'm quite confident this is not config-related.Repro steps:
.kube/config.carlpett commentedon Jul 23, 2018
Actually, I have an even simpler repo pointing to the monotonic timer. Compile and run this Go program:
This should print current time, sleep 10 s, then print current time. This is the output in WSL:
Not 10 seconds. I'm not familiar with the low level Linux calls, but is this line really right?
clock_gettime(CLOCK_MONOTONIC, {tv_sec=-2059958, tv_nsec=18446744073122952616})Should
tv_secbe negative?Trace is here.
therealkenc commentedon Jul 23, 2018
Nice dig. This went from "looks like silly config thing" to "yeah, that ain't right" in no time flat.
Nope. Smells a little like #3252 if you know you have a few weeks uptime. Could be something different. Either way, yeah "there's your problem".
therealkenc commentedon Jul 23, 2018
Yep. Behaves here, but I've only been up since Wednesday.
Appreciate your persistence.
carlpett commentedon Jul 23, 2018
Ah, right. Windows claims uptime of 63 days, and WSL...
Thanks, will track #3252 then!