aquasecurity / vscode-tfsec

vscode extension for tfsec
https://tfsec.dev
MIT License
30 stars 7 forks source link

Error: spawnSync C:\Windows\system32\cmd.exe ENOBUFS #16

Closed watsonjm closed 2 years ago

watsonjm commented 2 years ago

Describe the bug Running tfsec in VSCode does provide results (thanks!), but also has an error Error: spawnSync C:\Windows\system32\cmd.exe ENOBUFS in the output, and I'm not sure if it is affecting anything since I haven't used this extension before.

Here is the complete output from 1 run:

Running tfsec to update results
command: C:\ProgramData\chocolatey\lib\tfsec\tools\tfsec.exe --force-all-dirs --exclude-downloaded-modules --verbose --format json --out "c:\Users\jwats\AppData\Roaming\Code\User\workspaceStorage\a12513ba4cd57fff989735ae9e9c3ad1\tfsec.tfsec\.tfsec_results.json" d:\Git\Bitbucket\terraform-infrastructure
Error: spawnSync C:\Windows\system32\cmd.exe ENOBUFS
Reloading the treeview

Desktop (please complete the following information):

Additional context I've tried the usual running as admin, and also some research shows the error is usually related to cmd not being in the PATH, but it is there and it is also in the system32 folder.

owenrumney commented 2 years ago

Hey @watsonjm - I'll take a look at this shortly, I don't get it on my Windows VM using scoop so I'll give it a go with Chocolately install and see if I can reproduce. If you're getting results then it should be okay, but would rather handle the error if possible

owenrumney commented 2 years ago

Hey @watsonjm - seems this error is the limitation in the buffer size for the ExecSync we use to run tfsec. I've rewritten that in 1.6.0 to use a different mechanism and stream the output to Output window.

1.6.0 has this fix and is building now