uptane / aktualizr

C++ Uptane Client
Mozilla Public License 2.0
15 stars 15 forks source link

Improve error logging #84

Closed tkfu closed 1 year ago

tkfu commented 1 year ago

This is mostly just scratching a personal itch in the way libaktualizr logs errors in metadata verification. Copying the commit message here by way of explanation:

When we check local metadata, we're normally just checking that whether it needs to be refreshed from the server or not. We indicate that by passing the prefetch bool. If we encounter a verification failure in that case, it's not actually an error, so we should not be logging it as such.

I'm changing this because I'm sick of seeing a bunch of messages like these in aktualizr logs:

Jul 15 23:55:12 colibri-imx7-emmc-06476398 aktualizr-torizon[756]: Image repo Snapshot verification failed: Snapshot metadata hash verification failed
Jul 15 23:55:13 colibri-imx7-emmc-06476398 aktualizr-torizon[756]: Signature verification for Image repo Targets metadata failed
Jul 15 23:55:13 colibri-imx7-emmc-06476398 aktualizr-torizon[756]: Image repo Target verification failed: Hash metadata mismatch

They confuse end users, and make it sound like there's something wrong when it's actually just a perfectly normal update cycle.

tkfu commented 1 year ago

D'oh...I was wondering why it passed the check on my machine....and it was because I didn't have clang-format installed, which apparently makes cmake skip the step (and pass!) instead of failing/warning. Fixed now; I'm gonna go ahead and merge once the tests pass since the only change is the formatting.