grype db status
doesn't always check the db's checksum and validity
#1648
Milestone
8000
grype db status
doesn't always check the db's checksum and validity
#1648
What happened:
A coworker was getting this output from Grype:
This error is originating from the sqlite driver, and it looks like other Grype users encounter it on occasion, e.g. #1150. The underlying cause is that the database has been corrupted (somehow).
But... I asked them to run
grype db status
, and here's what they got:This could be way more helpful than it currently is, especially when debugging database issues like this one.
It's not actually checking the real database's checksum, or the real database's validity. It's just reporting what's in the metadata JSON file. This makes it harder to find out why Grype isn't working correctly, when it's a database issue. This is frustrating for users, too, because such database issues usually render Grype inoperable until you run
grype db delete && grype db update
or something (which the average user doesn't know about).What you expected to happen:
From talking on Anchore Slack, it sounds like the config check used during the execution of
grype db status
should become a non-conditional, "always do the check" execution path.grype/grype/db/curator.go
Line 323 in d5ced7f
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Environment:
grype version
:cat /etc/os-release
or similar):The text was updated successfully, but these errors were encountered: