Trivy in an air-gapped runner fails with `failed to download vulnerability DB` even though you copied `db.tar.gz`
AdvancedTroubleshootingContainer image and IaC scanning
Answer
Likely causes → The DB is not extracted into the expected cache layout, metadata is too old, or the Java DB is still being fetched for JAR scanning.
Diagnose →
ls ~/.cache/trivy/db/ # expect trivy.db and metadata.json
cat ~/.cache/trivy/db/metadata.json
Fix →
mkdir -p ~/.cache/trivy/db && tar -xzf db.tar.gz -C ~/.cache/trivy/db
trivy image --skip-db-update --skip-java-db-update --offline-scan myapp:1.4
Prevent → Automate a daily DB export (oras pull ghcr.io/aquasecurity/trivy-db:2) into the internal artifact store and alert when metadata.json UpdatedAt is older than 48 hours.
More on Container image and IaC scanning
Trivy fails the build on 14 HIGH/CRITICAL CVEs in the base image, all with "Fixed Version" emptyBeginner`FATAL ... failed to download vulnerability DB: ... TOOMANYREQUESTS: retry-after` from Trivy in CIIntermediateTrivy and Grype report different CVE counts for the same imageIntermediate`.trivyignore` entries are ignored and the build still fails on the same CVEBeginnerTrivy reports a critical CVE in a Go binary built from your own code, in package `stdlib`IntermediateImage scan passes in CI but the registry scanner (ECR enhanced scanning / Harbor) shows criticals a week laterBeginner