SonarLint extension for VSCode is creating way too many tmp folders

I have the SonarLint extension for VS Code configured.

I executed npx npkill to clean up my computer a little with node_modules folders that I don’t use/need anymore, and found all these .sonartmp_xxx folders under C:\Users\<username>\.sonarlint folder, containing exactly the same package (eslint-bridge-bundle) over and over again.

There were more than 75 temp folders in total, with around 75 MB on each, that’s a total of more than 5.5 GB.

I must say that my co-workers don’t have this issue, therefore I am not sure if it is SonarLint’s fault.

I don’t know if there should be any logs that could help for this issue. If so, please let me know, and I will provide them.

Sin título

Thanks,

1 Like

Hello, welcome to the community! And thank you for reporting this.

I noticed a similar behavior on my machine, which went unnoticed due to the use of the ~/.sonarlint folder, which is hidden on Linux. It looks like a regression in the deletion of temporary folders was introduced in a recent version.

Could you please tell us when the oldest one was created on your box? This could help us pinpoint the version in which the regression was introduced.

I have this issue too, it’s very serious, help ~~

Hello,

We just released a new version of SonarLint for VSCode, and we fixed some issues related to process and resource cleanup. The version is on the marketplace, would you mind giving it another try to see if new temporary folders are properly removed ?

Thanks

Maaaan ! What a relief I finally found this post ! Feels great not to be alone !
Anyway, I have Sonarlint v3.13.0 installed, and there’s still those sonarlinttmp folders, multiplying themselves like cockroaches…

So looks like the issue remains.
I’ll try uninstall/reinstall the extension.

EDIT:
So after after uninstall/reinstall the extension, I just noticed that sonarlinttmp folder is deleted automatically as I closed Vscode. So maybe issue’s solved after all.

the same problem, yes it’s 2023 nowwww

The same to me, the folder size is 10Gb OMG, it’s middle 2023 now

Hey :wave: thanks for reporting this issue.

We did some investigation during our current hardening sprint but we have not found a satisfying solution yet - see my comments on the ticket.

There is definitely some code that is responsible for deleting the temporary folders on shutdown, but it seems that the language server’s JVM process exits before it has the time to be executed fully.

There is also a bit of code that cleans up leftover temporary folders at startup if they are older than 21 days; this period might be too long - e.g if someone starts their IDE once per week day, the dangling .sonarlinttmp* folders will still accumulate to 15 × ~166MB, roughly 2.5GB.

For the time being and until this issue is completely sorted out, our recommendation is still to clean the work folder on a regular basis to reclaim some storage.

On the bright side, we identified a few opportunities to avoid having to resort to these temporary folders in the SonarLint context.

1 Like

Is there a way to change where sonarlint saves these temp files?

Hi all! :wave:

We are happy to let you know that the mentioned ticket is now closed and the latest version of SonarLint for VSCode (3.21.0) includes the fix to this issue. Thank you for your continued feedback :hugs:

All the best,
Sophio from :sonarlint:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.