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

Trivy - The first run cannot skip downloading DB #4408

Open
lassehastrup opened this issue Dec 18, 2024 · 1 comment
Open

Trivy - The first run cannot skip downloading DB #4408

lassehastrup opened this issue Dec 18, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@lassehastrup
Copy link

Describe the bug
We're using oxsecurity/megalinter:latest in our devOps pipeline.
Previously we've had issues with trivy with the error described below, as it seems to be a general issue from their side regarding "downloading DB".

It's important to state, that it's far from every time we encounter this issue. This might only be on 5% of our pipeline runs.

From my understanding, your team have made changes to the way trivy was downloaded by caching trivy in the docker image, so that it didn't have to download from trivy on every run.

** Error received **

[Trivy] Hit TOOMANYREQUESTS: try again
[Trivy] Hit TOOMANYREQUESTS 5 times: Run trivy with --skip-db-update and --skip-check-update
❌ Linted [REPOSITORY] files with [trivy]: Found 1 error(s) - (22.18s)

  • Using [trivy v0.57.1] https://megalinter.io/8.3.0/descriptors/repository_trivy
  • MegaLinter key: [REPOSITORY_TRIVY]
  • Rules config: identified by [trivy]
  • Commands:
    [trivy fs --scanners vuln,misconfig --exit-code 1 .]
    [trivy fs --scanners vuln,misconfig --exit-code 1 .]
    [trivy fs --scanners vuln,misconfig --exit-code 1 .]
    [trivy fs --scanners vuln,misconfig --exit-code 1 .]
    [trivy fs --scanners vuln,misconfig --exit-code 1 .]
    [trivy fs --scanners vuln,misconfig --exit-code 1 .]
    [trivy fs --scanners vuln,misconfig --exit-code 1 . --skip-db-update --skip-check-update]
    --Error detail:
    2024-12-17T19:07:10Z ERROR [vulndb] The first run cannot skip downloading DB
    2024-12-17T19:07:10Z FATAL Fatal error init error: DB error: database error: --skip-update cannot be specified on the first run

docker pull oxsecurity/megalinter:latest | docker run

@lassehastrup lassehastrup added the bug Something isn't working label Dec 18, 2024
@nvuillam
Copy link
Member

@lassehastrup damn, they were supposed to have fixed the problem with a new mirror gcr.io :/

aquasecurity/trivy#7668

I wonder if the fact that we try to call trivy unsuccessfully just before makes the workaround fail... :/

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
None yet
Development

No branches or pull requests

2 participants