trivy-vscode-extension icon indicating copy to clipboard operation
trivy-vscode-extension copied to clipboard

Trivy extension for VSCode throws a scan error, says to check logs, but logs are empty

Open pcgeek86 opened this issue 3 years ago • 10 comments

Environment

  • Windows 11 Developer Preview
  • VSCode 1.65.2
  • Trivy Extension version 0.3.0

Description

When I run the Trivy Scan command from the Visual Studio Code Command Palette, VSCode throws an error saying "Failed to run Trivy scan, error: 1 check logs for details."

Expected Result

Trivy scan completes successfully against the currently open VSCode workspace. If scan fails, logs should be written to the VSCode Trivy Scan output section (see below screenshot).

Actual Result

Trivy extension throws an error message, saying scan failed, and to check logs VSCode debug logs for Trivy extension are empty.

image

pcgeek86 avatar Mar 18 '22 18:03 pcgeek86

Same Error/Issue I am also facing, Please Help. How to configure or download Trivy for Windows. image

Sumit016 avatar Mar 21 '22 04:03 Sumit016

Unfortunately Trivy doesn't support Windows at the moment - https://github.com/aquasecurity/trivy/pull/1469 is tracking reintroducing this

owenrumney avatar Mar 30 '22 15:03 owenrumney

@owenrumney I'm getting this on Mac too Version: 1.66.2 (Universal) Commit: dfd34e8260c270da74b5c2d86d61aee4b6d56977 Date: 2022-04-11T07:49:20.994Z (2 wks ago) Electron: 17.2.0 Chromium: 98.0.4758.109 Node.js: 16.13.0 V8: 9.8.177.11-electron.0 OS: Darwin arm64 21.2.0

jercle avatar Apr 28 '22 08:04 jercle

Hey @jERCle - if you go to the settings for Trivy, can you confirm that the Trivy binary path is correct?

If Trivy is already on your PATH it will pick it up, otherwise you will likely need to put the full path here -

image

The extension doesn't install Trivy, you need to already have it. https://aquasecurity.github.io/trivy/v0.18.3/installation/

owenrumney avatar Apr 28 '22 08:04 owenrumney

@owenrumney Can confirm: image

And have already been using it through terminal. I installed through homebrew, and tested with that explicit path /opt/homebrew/bin/trivy and still failed. Only error is in the exthost.log file: image

I am currently going through the extension code, so will have a bit more of a play and get back to you - although have to leave the office so will continue shortly

jercle avatar Apr 28 '22 08:04 jercle

Could you check the output of Trivy Scan in the Output Tab

image

owenrumney avatar Apr 28 '22 08:04 owenrumney

@owenrumney Running Trivy Scan from command pallette image This is also after I disabled all other extensions

However, after testing again the run button in Trivy explorer worked image

jercle avatar Apr 28 '22 08:04 jercle

I'm also seeing the same behaviour as jercle.

Running win 10, with wsl2. VSCode started from wsl terminal with code .

Project does contain a dockerfile and "trivy image [image name]" from wsl terminal produces data.

The extension also works fine, finding issue in dockerfile and pom

Anything else I can provide to help troubleshoot this?

ctaggartgla avatar Jun 15 '22 13:06 ctaggartgla

Same for me: image

ProductName:		macOS
ProductVersion:		13.4
BuildVersion:		22F66

VS Code version: 1.78.2

andrew-shevchyk avatar Jun 01 '23 09:06 andrew-shevchyk

Though I couldnt fix the error, what helped was

  • quitting vsc and restarting
  • ">view trivy" and running the scan from the button instead of the command

thuwon avatar Apr 16 '24 07:04 thuwon

THis appears ot no longer be an issue or there are workarounds. Given how long it's been I'm closing and we can have a new ticket if required now the extension is being actively developed

owenrumney avatar Feb 17 '25 13:02 owenrumney