grype: Grype scan command appears to hang when downloading db or listing file
What happened: Grype command gets stuck and I get the error after 3 hours failed to load vulnerability db: unable to update vulnerability database: unable to download db: stream error: stream ID 1; INTERNAL_ERROR; received from peer What you expected to happen: Grype scan should get completed in under a minute How to reproduce it (as minimally and precisely as possible): Occurs randomly, can’t reproduce Anything else we need to know?:
Environment:
-
Output of
grype version: Application: grype Version: 0.74.5 BuildDate: 2024-02-07T21:34:47Z GitCommit: 74780902eda090afa5ca36699da2453f2df2e655 GitDescription: v0.74.5 Platform: linux/amd64 GoVersion: go1.21.6 Compiler: gc Syft Version: v0.104.0 Supported DB Schema: 5 -
OS (e.g:
cat /etc/os-releaseor similar): PRETTY_NAME=“Debian GNU/Linux 11 (bullseye)” NAME=“Debian GNU/Linux” VERSION_ID=“11” VERSION=“11 (bullseye)” VERSION_CODENAME=bullseye ID=debian HOME_URL=“https://www.debian.org/” SUPPORT_URL=“https://www.debian.org/support” BUG_REPORT_URL=“https://bugs.debian.org/”
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 29 (16 by maintainers)
It’s also working for us now. Thank you for your speedy action.
I was also experiencing this issue with download of todays db not completing.
Workaround: I was able to manually download yesterdays vulnerability db and import it.
I did the following:
to obtain links to dbs:
grype db listto import:grype db import <my_dl>to check status:grype db statusHope this helps until the root issue is resolved.
Confirming it works now for me.
Hi all, we’ve made a change to our database hosting that we believe should fix these issues, there is some more information on Discourse
For those affected by this issue, the team deployed the changes to how the grype vulnerability database is served late last night (UK time). So, runs should now no longer exhibit the same network stalling.
Please report if you see any further issues.
@jonathanbro yes, the action supports all grype settings via
GRYPE_-prefixed environment variables. For example:Run:
grype configto get a full list of the configuration.scan-actionshould be using the latest Grype.There seem to be continued issues downloading the database. See also: https://github.com/anchore/scan-action/issues/306.
As noted earlier, we believe that a change in the size of the file has solved the issues while downloading the listing, but it’s not possible to shrink the size of the database in a similar manner, which is now where the failures have moved.
@sparrowt we have not been able to identify any specific issues that are within our power to fix with the current CDN hosting setup we have, unfortunately. We do have a number of options to pursue. But are you using the latest version of Grype? There should be a significantly shorter timeout than 2 hours.
Hey everyone! Check out the latest release of grype where we now have default timeouts included (user configurable as well).
PR that was merged: https://github.com/anchore/grype/pull/1777
We’re currently looking into why the CDN that hosts the listing and db files ever gets into the state where it connects, but fails to transfer the bytes.