Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grype db status reports "valid" when the DB is missing #2077

Open
luhring opened this issue Aug 22, 2024 · 2 comments
Open

grype db status reports "valid" when the DB is missing #2077

luhring opened this issue Aug 22, 2024 · 2 comments
Labels
bug Something isn't working
Milestone

Comments

@luhring
Copy link
Contributor

luhring commented Aug 22, 2024

What happened:

$ grype db update
 ✔ Vulnerability DB                [updated]
Vulnerability database updated to latest version!
$ grype db status
Location:  /Users/dan/Library/Caches/grype/db/5
Built:     2024-08-22 01:31:37 +0000 UTC
Schema:    5
Checksum:  sha256:a11915b8368897dd446ad5cbb855414870297841f8bccc3b466c5c5e9ba5539b
Status:    valid

So far so good — and then...

$ rm -v /Users/dan/Library/Caches/grype/db/5/vulnerability.db
/Users/dan/Library/Caches/grype/db/5/vulnerability.db
$ grype db status
Location:  /Users/dan/Library/Caches/grype/db/5
Built:     2024-08-22 01:31:37 +0000 UTC
Schema:    5
Checksum:  sha256:a11915b8368897dd446ad5cbb855414870297841f8bccc3b466c5c5e9ba5539b
Status:    valid

What you expected to happen:

Some indication that the Grype DB is not valid — that it could not be verified because it could not be found.

How to reproduce it (as minimally and precisely as possible):

(See above)

Anything else we need to know?:

I don't expect this is a common scenario, FWIW. I got into this state while debugging another DB issue. But still, that this is possible seems not ideal.

Environment:

  • Output of grype version:
  • OS (e.g: cat /etc/os-release or similar):
@luhring luhring added the bug Something isn't working label Aug 22, 2024
@luhring
Copy link
Contributor Author

luhring commented Aug 22, 2024

Possibly related to #1648

@kzantow
Copy link
Contributor

kzantow commented Aug 22, 2024

Thanks for the report; I've seen this along with other oddities in some of the database handling, since we've been looking at solving download issues users have reported, if I get around to rewriting bits of it, I'll try to make sure to address this stuff too.

@wagoodman wagoodman added this to the DB v6 milestone Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Backlog
Development

No branches or pull requests

3 participants