k0sctl icon indicating copy to clipboard operation
k0sctl copied to clipboard

Reset fails to unmount/unlink /var/lib/k0s on alpine

Open kke opened this issue 2 years ago • 3 comments

time="2023-10-06T08:41:06Z" level=debug msg="[ssh] 127.0.0.1:9023: resetting k0s..."
time="2023-10-06T08:41:06Z" level=debug msg="[ssh] 127.0.0.1:9023: executing `/usr/local/bin/k0s reset --data-dir=/var/lib/k0s`"
time="2023-10-06T08:41:07Z" level=debug msg="[ssh] 127.0.0.1:9023: (stderr) time=\"2023-10-06 08:41:07\" level=warning msg=\"failed to unmount /var/lib/k0s\""
time="2023-10-06T08:41:07Z" level=debug msg="[ssh] 127.0.0.1:9023: (stderr) time=\"2023-10-06 08:41:07\" level=warning msg=\"To ensure a full reset, a node reboot is recommended.\""
time="2023-10-06T08:41:07Z" level=debug msg="[ssh] 127.0.0.1:9023: (stderr) Error: errors received during clean-up: [failed to delete /var/lib/k0s. err: unlinkat /var/lib/k0s: device or resource busy]"
time="2023-10-06T08:41:07Z" level=debug msg="[ssh] 127.0.0.1:9023: k0s reset failed: "
time="2023-10-06T08:41:07Z" level=warning msg="[ssh] 127.0.0.1:9023: k0s reported failure: command failed: client exec: ssh session wait: Process exited with status 1"

Could be a k0s issue

kke avatar Oct 06 '23 09:10 kke

Can't understand where the warning comes from, there's no log.Warn in k0s's dir cleanup 🤔

Also can't understand why this doesn't fail with all images, since removing the volume /var/lib/k0s doesn't work on any other image either because it's a volume.

kke avatar Oct 12 '23 07:10 kke

I saw that too, I mounted something to /var/lib/k0s. Maybe delete content of the dir instead when it's a mountpoint?

till avatar Oct 12 '23 10:10 till

@ncopa you had some thoughts about some cgroupv2 thing?

kke avatar Oct 16 '23 12:10 kke