-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Scanning of Java Images broken: Java DB update failed: Java DB client not initialized #3794
Comments
yeah for me it looks like its not possible to use offline scan anymore, it does not matter is offline false or true. It always fails if java db is not in place |
@zetaab I get the same error message when running without the |
Might be related to the breaking change in 0.37.2? |
Hello @very-doge-wow , @zetaab We created #3810 to fix this problem. Changes will be included in v0.38.3, which is planned to be released early next week. Regards, Dmitriy |
I have the exact same error with Version: 0.41.0 . I'm using below command:
I get the below output ` [2023-05-11T08:31:32.533Z] 2023-05-11T08:31:32.001Z WARN '--security-checks' is deprecated. Use '--scanners' instead. [2023-05-11T08:31:36.721Z] 2023-05-11T08:31:36.363Z INFO Vulnerability scanning is enabled [2023-05-11T08:31:59.010Z] 2023-05-11T08:31:55.483Z INFO JAR files found [2023-05-11T08:31:59.015Z] 2023-05-11T08:31:55.765Z ERROR Unable to initialize the Java DB: Java DB update failed: Java DB update error: Java DB metadata error: unable to decode metadata: EOF [2023-05-11T08:31:59.015Z] 2023-05-11T08:31:55.997Z FATAL image scan error: scan error: scan failed: failed analysis: analyze error: failed to analyze layer (sha256:sha_here): post analysis error: post analysis error: Java DB update failed: Java DB update error: Java DB metadata error: unable to decode metadata: EOF ` Do we have a solution? |
Hello @sourabhgupta385 |
@DmitriyLewen Thank you for immediate response. I manually cleared my cache and deleted all the DB files. And then again pulled them using oras and then things worked fine. I am working in a air-gapped environment and that's the process I followed. |
looks like |
@DmitriyLewen we are getting the same issue with v0.46.0 but it's very inconsistent. Sometimes scan is successful, and sometimes getting the following error. Running
We reverted to v0.45.1 and our pipelines seem to be stable with it. Should I submit a separate bug issue for it? |
Hello @trapeznikov
How did you fix this error? |
Hi @DmitriyLewen
metadata.json:
Running scan right after that was successful. And metadata.json file stayed the same after the successful scan.
With 0.45.1 every scan is successful. Full log:
|
@trapeznikov i created #5441 for your issue. |
@DmitriyLewen thank you! |
Description
I'm trying to scan an image which contains a java application. I'm using the latest trivy version (0.38.2).
Both in air-gapped mode as well as locally using the same version, I can't scan the image, as it fails with the error message:
Things I have tried:
--skip-java-db-update
flagCan't share the image which I'm trying to scan as it is inner source of my corporation, however this actually happens when scanning any image which contains a java application/jar file as far as I can tell.
What did you expect to happen?
Trivy scans the image
What happened instead?
Error message and run terminates
Output of run with
-debug
:Output of
trivy -v
:Additional details (base image name, container registry info...):
Container Registry is hosted in an Artifactory instance (corporate network).
Base Image is irrelevant, as it happens both in a containerized run (air-gapped) in a CI/CD pipeline as well as locally (debugging purposes).
The text was updated successfully, but these errors were encountered: