Parallel scans utilizing same cache dir failing with 0.66.0 #9472
Unanswered
bluesliverx
asked this question in
Q&A
Replies: 1 comment
-
|
Trivy's standalone mode was not designed to run in parallel, and in the past, it caused confusing errors because it did not explicitly return an error. Since v0.66.0, it explicitly returns an error to prevent users from making such mistakes. For more details, please refer to the following. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
We've been using trivy for about a year and a half in a Jenkins build grid that handled hundreds of parallel builds each day. Not all of these are scanned (since not all create Docker images), but many do. Starting in the last week, we started getting this error when running many parallel builds at the same time:
Our trivy config looks like this (or at least, it's generated from this yaml):
Also note that we use an internal mirror for the ghcr.io registry so we're not hitting rate limits or anything there. Our cache directory is on an NFS mount, which we have been using without issues since last February.
We use the latest docker image for trivy (
aquasec/trivy:latest), and this problem seems to coincide with the0.66.0release this last week. We downgraded to0.65.0, and the issues went away again, so it seems clearly related to something done in the new version.Trying the jobs one at a time fixes things, but that does not work for us, so we've downgraded to 0.65.0 until this issue can be addressed.
Please note I've read through the troubleshooting and see that this may not be recommended. However, before the process waits for some amount of time for the lockfiles to be released and that's worked fine for us. We even have a timeout set at 20m. However, this fails immediately without waiting at all for the lock file to be cleaned up. This feels like the real problem here - it doesn't wait where it used to.
Desired Behavior
The trivy image scan works
Actual Behavior
Fatal error run error: init error: DB error: error in vulnerability DB initialize: vulnerability database may be in use by another process: timeoutReproduction Steps
Target
Container Image
Scanner
Vulnerability
Output Format
JSON
Mode
Standalone
Debug Output
Operating System
Rocky Linux release 8.7 (Green Obsidian)
Version
0.66.0 (included in output above)Checklist
trivy clean --allBeta Was this translation helpful? Give feedback.
All reactions