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
I hate filing issues like this (ie we don't yet know exactly how to reproduce the problem) but @sosiouxme, @sdodson, @thoraxe and I have hit an edge case where the router liveness check will fail which results in a tight loop of "destroy the router / launch the router".
Right now we mostly want to raise awareness of this problem to see if anyone is hitting it upstream. The code we're testing with is rarely ever more than a half a day old or so. I'm fairly certain we're dealing with an odd edge case. Any advice for debugging the problem the next time we see it would be appreciated. For starters:
How is the default router port 80 tcp liveness probe run? Does it run from the Master or the Node?
What ip does it hit? (I'm assuming it's using the published endpoints but I'm not sure where it's being run from).
I don't think the timeout is relevant here as it's not waiting a second for the socket, it fires off the three checks in just 1ms based on the output above so the port must be closed. There doesn't seem to be any sleep time between checks which is probably a problem too but I think something else is going on here. Yesterday we tried setting initialDelaySeconds=10 and, at least in my testing, this did not improve the situation.
What's really interesting is I can think of no good reason for that check to fail. The router should be reusing sockets, which means this is a true failure of the router somewhere. Three checks right after each other also sound wrong but we'll need to run that down upstream.
I don't think the timeout is relevant here as it's not waiting a second for the socket, it fires off the three checks in just 1ms based on the output above so the port must be closed. There doesn't seem to be any sleep time between checks which is probably a problem too but I think something else is going on here. Yesterday we tried setting initialDelaySeconds=10 and, at least in my testing, this did not improve the situation.
Anything at all in the router logs? I don't think the verbose logging is on by default in the image, you may want to add --loglevel=4 to the image you rebuilt to see if it gives any more clues.
One other thing that may be worth trying is to create the container, allow it to start coming up and then kill openshift to see if you can diagnose the issue before k8s starts killing and restarting things.
Or creating the container manually to see if there are any issues. The easiest way to do that is to get the env that the ex router command would use and plop it into a plain old pod definition. So openshift ex router --create -o json --credentials="$KUBECONFIG", copy and paste into https://gist.github.com/pweil-/3bd200f9ad17e77543df and osc create -f <your file>. That will bring a router up without the probe so you can check it out
Now I've gone back to it the router seems to have started now & running fine... there are about 350 terminated containers before this one started successfully though!
My next debugging step would be to eliminate the probe from the ex command in case there is a bug there somewhere. If the router is really the issue it shouldn't come back up magically unless there is an issue with how config is loaded that works on the 350th try (unless you took a different action in between 349 & 350 like making a service or route)
@pweil- Adding the kinds in to the output JSON & removing the livenessProbe all works fine so I'd say it's something wrong with livenessProbes being over eager. Adding in a initialDelaySeconds to the descriptor should do it.
That means the output is not versioned which means it not even an api version. This likely broke in the last rebase, or was never right in the first place.
The root object has to be converted to a version before any output.
@smarterclayton - this is obviously pretty critical functionality for anything that you want to expose externally. Would really appreciate this being looked at ASAP. This & #1469 are our top 2 issues right now.
Activity
brenton commentedon Mar 30, 2015
After working for almost an hour my router just went in to the liveness probe failure loop. After several minutes of looping it came back.
sdodson commentedon Mar 30, 2015
I put in a bit of instrumentation.
And this is what I get
smarterclayton commentedon Mar 31, 2015
Probes are always run from the node. I would increase the timeout.
sdodson commentedon Apr 1, 2015
I don't think the timeout is relevant here as it's not waiting a second for the socket, it fires off the three checks in just 1ms based on the output above so the port must be closed. There doesn't seem to be any sleep time between checks which is probably a problem too but I think something else is going on here. Yesterday we tried setting initialDelaySeconds=10 and, at least in my testing, this did not improve the situation.
@pweil- relevant to your interests
smarterclayton commentedon Apr 2, 2015
What's really interesting is I can think of no good reason for that check to fail. The router should be reusing sockets, which means this is a true failure of the router somewhere. Three checks right after each other also sound wrong but we'll need to run that down upstream.
jimmidyson commentedon Apr 2, 2015
I'm seeing this on a clean 0.4.2 install. Anything I can add to help diagnose?
pweil- commentedon Apr 2, 2015
The last significant change to the router was the reaper which is started by the command. I don't think it is the cause but to rule it out, if you can reproduce this can you try commenting out https://github.com/openshift/origin/blob/master/pkg/cmd/infra/router/router.go#L86 and see what happens?
jimmidyson commentedon Apr 2, 2015
@pweil- no that didn't help... updated code, rebuilt image, copied over to server having the problem & still couldn't start router.
This works fine on my laptop, just not on the cleanly built server I'm running.
Any more ideas?
pweil- commentedon Apr 2, 2015
Anything at all in the router logs? I don't think the verbose logging is on by default in the image, you may want to add
--loglevel=4to the image you rebuilt to see if it gives any more clues.One other thing that may be worth trying is to create the container, allow it to start coming up and then kill openshift to see if you can diagnose the issue before k8s starts killing and restarting things.
Or creating the container manually to see if there are any issues. The easiest way to do that is to get the env that the ex router command would use and plop it into a plain old pod definition. So
openshift ex router --create -o json --credentials="$KUBECONFIG", copy and paste into https://gist.github.com/pweil-/3bd200f9ad17e77543df andosc create -f <your file>. That will bring a router up without the probe so you can check it outjimmidyson commentedon Apr 2, 2015
Now I've gone back to it the router seems to have started now & running fine... there are about 350 terminated containers before this one started successfully though!
jimmidyson commentedon Apr 2, 2015
Even with loglevel 4 the container terminates with no log output
pweil- commentedon Apr 2, 2015
hrm, well that is frustrating :-\
jimmidyson commentedon Apr 2, 2015
Thing is that the container that started did so with same image as those 350 previous failures so must be something timing wise
pweil- commentedon Apr 2, 2015
My next debugging step would be to eliminate the probe from the ex command in case there is a bug there somewhere. If the router is really the issue it shouldn't come back up magically unless there is an issue with how config is loaded that works on the 350th try (unless you took a different action in between 349 & 350 like making a service or route)
jimmidyson commentedon Apr 2, 2015
Wondering if the health check which is think just tcp connects port 80 is just happening too quickly while container is coming up?
OK I'll get rid of health check & see if it works.
2 remaining items
jimmidyson commentedon Apr 2, 2015
@pweil- interestingly the output from
-o jsondoesn't work withcreate -f- missing kind for one thing. In fact no kind on any objects...jimmidyson commentedon Apr 2, 2015
This is the output from
openshift ex router --create --credentials=openshift.local.certificates/openshift-router/.kubeconfig -o json:jimmidyson commentedon Apr 2, 2015
@pweil- Adding the
kinds in to the output JSON & removing thelivenessProbeall works fine so I'd say it's something wrong withlivenessProbes being over eager. Adding in ainitialDelaySecondsto the descriptor should do it.smarterclayton commentedon Apr 2, 2015
That means the output is not versioned which means it not even an api version. This likely broke in the last rebase, or was never right in the first place.
The root object has to be converted to a version before any output.
jimmidyson commentedon Apr 2, 2015
@smarterclayton - this is obviously pretty critical functionality for anything that you want to expose externally. Would really appreciate this being looked at ASAP. This & #1469 are our top 2 issues right now.
pweil- commentedon May 12, 2015
@brenton - is this ready to be closed?
brenton commentedon May 12, 2015
Yeah.
smarterclayton commentedon May 12, 2015
We still need to reintroduce the probe.
Squashed 'cmd/service-catalog/go/src/github.com/kubernetes-incubator/…
Follow up from openshift#1450 and openshift#1444 (openshift#1504)