Repository navigation
Closed
Description
From @crawford:
I1129 21:37:29.566704 8105 start.go:51] Version: 3.11.0-278-g628ad5d1-dirty
I1129 21:37:29.567579 8105 start.go:78] starting node writer
I1129 21:37:29.572698 8105 run.go:22] Running captured: chroot /rootfs rpm-ostree status --json
I1129 21:37:29.971743 8105 daemon.go:115] Booted osImageURL: registry.svc.ci.openshift.org/rhcos/maipo@sha256:9c7f465ed8a84ed9d47356258ede44b7aec8b11b4e89defaf3ecee3cef33f0a0 (47.153)
I1129 21:37:30.009173 8105 start.go:127] Calling chroot("/rootfs")
E1129 21:37:30.029005 8105 daemon.go:303] Marking degraded due to: machineconfigs.machineconfiguration.openshift.io "0788cf371d56ac505e5b0e78392ccb14" not found
I1129 21:37:30.044992 8105 start.go:146] Starting MachineConfigDaemon
I1129 21:37:30.045012 8105 daemon.go:187] Enabling Kubelet Healthz Monitor
W1129 21:37:30.804003 8105 reflector.go:341] github.com/openshift/machine-config-operator/vendor/k8s.io/client-go/informers/factory.go:130: watch of *v1.Node ended with: very short watch: github.com/openshift/machine-config-operator/vendor/k8s.io/client-go/informers/factory.go:130: Unexpected watch close - watch lasted less than a second and no items received
E1129 21:37:31.805751 8105 reflector.go:205] github.com/openshift/machine-config-operator/vendor/k8s.io/client-go/informers/factory.go:130: Failed to list *v1.Node: Get https://172.30.0.1:443/api/v1/nodes?limit=500&resourceVersion=0: dial tcp 172.30.0.1:443: connect: connection refused
...
I1129 21:38:09.151806 8105 update.go:489] Rebooting
I1129 21:40:52.851825 5989 start.go:51] Version: 3.11.0-278-g628ad5d1-dirty
I1129 21:40:52.856779 5989 start.go:78] starting node writer
I1129 21:40:52.870226 5989 run.go:22] Running captured: chroot /rootfs rpm-ostree status --json
I1129 21:40:53.263929 5989 daemon.go:115] Booted osImageURL: registry.svc.ci.openshift.org/rhcos/maipo@sha256:9c7f465ed8a84ed9d47356258ede44b7aec8b11b4e89defaf3ecee3cef33f0a0 (47.153)
I1129 21:40:57.364959 5989 start.go:127] Calling chroot("/rootfs")
I1129 21:40:57.387466 5989 daemon.go:293] Node is degraded; going to sleep
Metadata
Metadata
Assignees
Labels
No labels
Activity
abhinavdahiya commentedon Nov 29, 2018
machine-config-operator/pkg/daemon/daemon.go
Lines 421 to 439 in f915a1b
cgwalters commentedon Nov 29, 2018
Let's change
dn.reboot()to take a string that it also logs to the journal.cgwalters commentedon Nov 29, 2018
Offhand it looks like we want to refactor
triggerUpdateWithMachineConfigto gather all the state it can before executing the finalreturn dn.update(currentConfig, desiredConfig)- and any errors before that should be non-fatal and not cause a reboot.kikisdeliveryservice commentedon Nov 29, 2018
@cgwalters is that the full log? or is there more before rebooting??
cgwalters commentedon Nov 29, 2018
Sorry I just noticed I'd duplicated the initial comment here. @crawford can you attach any more info you have? Or even better if this is reproducible let's ensure the person who's going to hack on it has access to an affected cluster.
crawford commentedon Nov 29, 2018
@kikisdeliveryservice Full logs:
crawford commentedon Nov 29, 2018
@kikisdeliveryservice I can reproduce this locally with libvirt. From my new cluster I see the following:
It took quite a while for the MCC to create the MachineConfigs:
A few minutes later:
I'm sure
7f7366afead827ab5aa47ce67d5903c9will show up if I wait a bit longer.The MCC logs show the following:
kikisdeliveryservice commentedon Nov 30, 2018
I've reproduced this locally on libvirt. One of the daemons does seem to have rebooted and now is degraded and the backlogs show the same error coming from reflector.go as in the above logs.
cgwalters commentedon Nov 30, 2018
I am not an expert in this, but one approach would be for the MCD to exit if it can't query the current state - then we'll be respawned as usual when things have hopefully stabilized, and it'll be visible to the cluster as a usual
CrashLoopBackOff.abhinavdahiya commentedon Nov 30, 2018
So MCC has max retries of 15 here on error for an event and i suspect we are hitting the max retries but we only print that on loglevel
2here and therefore a little blind and then MCC will manually resync after20minsherejlebon commentedon Nov 30, 2018
OK, so there's three separate issues here it seems:
triggerUpdateWithMachineConfigerror handling smarter so that we don't mark degraded on transient errors.I can take a look at 2 and 3. Let's split 1 into a separate issue?
/assign
jlebon commentedon Nov 30, 2018
(Just gonna answer here a question from the chat.) Re. "MCD should never set the node to degraded/go to sleep". The key here is distinguishing between fatal and non-fatal errors. On fatal errors, there's not much we can do. E.g. what should it do if the node state isn't reconciled after an update is applied and rebooted? Or if
rpm-ostree statusfails to start? Orpivotfails to update the node? Sure, we could try again a few times, but eventually, we need to notify the cluster that this node is a lost cause and should be torn down by marking it degraded. Once we do that though, there's no point in trying to operate on the node any longer since it's expected to be torn down at any moment, hence the immediate sleep on restart into a degraded node.In this specific instance, we hit a false positive treating a non-fatal error as fatal. Clearly, failing to watch for updates shouldn't cause node degradation. The tricky part is making error handling smart enough at each point to discern between those two.
jlebon commentedon Nov 30, 2018
Split that into #203.
jlebon commentedon Nov 30, 2018
Hmm, I still can't reproduce this yet. I'm running with RHCOS 47.153 and openshift/installer@25757c6.
Though I did hit this on the MCD of the worker node once it comes up:
That eventually fixes itself after the pod restarts a few times.
8 remaining items
yuqi-zhang commentedon Nov 30, 2018
So I don't see the above issues on my newest cluster (but like @ashcrow its probably a race condition that somehow didn't show up until recently). I currently see:
and in the journal on the master it repeats:
But that may be a red herring as mentioned. It doesn't seem to affect cluster operation from what I can tell.
kikisdeliveryservice commentedon Nov 30, 2018
FWIW: I have seen the same logs as jerry and also the below when getting logs for the restarted daemon.
F1130 20:01:46.547130 3322 start.go:123] failed to initialize daemon: Failed to set initial annotations: Unable to update node "test1-worker-0-5259m": Get https://172.30.0.1:443/api/v1/nodes/test1-worker-0-5259m: dial tcp 172.30.0.1:443: connect: no route to hostThe rebooted daemon is not sleeping and has not been marked degraded.
ashcrow commentedon Nov 30, 2018
To round this out, we've crossed two issues in this one. There are two items:
daemon: fix error-handling when marking node degraded
kikisdeliveryservice commentedon Dec 3, 2018
I'm running into this same issue blocking me again today, one of my nodes is degraded and asleep.
cgwalters commentedon Dec 3, 2018
This is confusing me ATM:
Why would we be degraded when our current == desired?
But clearly need more logs out of this situation.
kikisdeliveryservice commentedon Dec 3, 2018
I believe that there is some sort of timeout before it reboots and is marked as degraded. At least in previous runs today, I saw timeouts, with everything taking longer than it should.
cgwalters commentedon Dec 3, 2018
#201 should help a lot here as I think we're being handicapped by the lack of logs from the previous MCD.
(Also, maybe we should change the Degraded annotation to be a string with a rationale?)
kikisdeliveryservice commentedon Dec 3, 2018
@cgwalters
Rerunning and following the logs of the master daemon shows me that it was trying to get the MachineConfig for 5 minutes as per @jlebon 's PR #206 before getting a time out, being marked Degraded and rebooting:
Also agree that Degraded by itself is not particularly helpful.
jlebon commentedon Dec 4, 2018
@kikisdeliveryservice, to confirm, it seems like you're hitting #203, right?
So the main issue reported here was that the daemon was triggering a reboot when setting the degraded annotation. This should be fixed now with #206. But we still do mark as Degraded when an unrecoverable error occurs; we just no longer reboot for it. :)
If no one is experiencing unexplained reboots anymore, let's close this one and follow up in either #203 for the MCC taking a while to create the MCs or #200 for the MCD also logging to the journal?
ashcrow commentedon Dec 4, 2018
Agreed, the above looks like #203.
jlebon commentedon Dec 4, 2018
OK, let's close this then!
daemon: retry for 5 minutes to get MachineConfig
daemon: fix error-handling when marking node degraded