balena-os / meta-balena

A collection of Yocto layers used to build balenaOS images
https://www.balena.io/os
971 stars 115 forks source link

Work around uuid file corruption in balenaEngine health check #3409

Closed lmbarros closed 1 month ago

lmbarros commented 2 months ago

We have detected one more way in which the uuid file used by containerd can get corrupted. This time, the file is not empty, but doesn't contain a valid UUID either.

This commit thus extends the existing workaround to also handle this case.

See https://github.com/balena-os/balena-engine/issues/322

Testing

I tested this manually only. I built balenaOS for raspberrypi3-64 using my branch of meta-balena and flashed it to a device. Then I tried to manually change the contents of the uuid file and run the health check to see the results:

In other words, no form of bad uuid should not cause the Engine healthcheck to fail after this change.

Regarding automated tests: I believe it should be possible to add some automated test cases for that -- basically automate the kind of manual testing I described above. I am not so sure this would add significant value, though. (FWIW, we don't have automated tests for the current version of this workaround)


Contributor checklist

Reviewer Guidelines

lmbarros commented 1 month ago

@resin-jenkins retest this please

lmbarros commented 1 month ago

@resin-jenkins retest this please

klutchell commented 1 month ago

@resin-jenkins retest this please