SonarLint Eclipse error during C files analysis: AccessDeniedException on sonar-cfamily-reproducer.zip

Hello,
I’ve been using SonarLint on Eclipse in connected mode for years, but recently I started to get the error showed in the attached console file when opening C files I never opened before.
Some files I worked on in the past generate the same error but I can see the Sonar report (maybe it is in some sort of cache).

    GET 200 https://<Sonar server>/api/developers/search_events?projects=<Project name>&from=2021-05-20T10%3A25%3A59%2B0100 | response time=325ms
    Trigger: EDITOR_OPEN
    Clear markers on 0 excluded files
    SonarLint processing file /cs/core/dbtrig/procedures/procedures.h...
    Wrote build info to: C:\Users\rg\c-workspace\.metadata\.plugins\org.eclipse.core.resources\.projects\cs\org.sonarlint.eclipse.core\sonarlint13268888537619617083\build-wrapper-dump.json
    Connected mode (using configuration of 'Project name' in connection '<Sonar server>')
    Starting analysis with configuration:
    [
      projectKey: <Project name>
      baseDir: C:\Users\rg\git\cs
      extraProperties: {sonar.cfamily.useCache=false, sonar.cfamily.build-wrapper-output=C:\Users\rg\c-workspace\.metadata\.plugins\org.eclipse.core.resources\.projects\cs\org.sonarlint.eclipse.core\sonarlint13268888537619617083}
      inputFiles: [
        file:/C:/Users/rg/git/cs/core/dbtrig/procedures/procedures.h (UTF-8) [c]
      ]
    ]

    TypeScript sensor excluded
    Start analysis
    Index files
    Language of file 'file:/C:/Users/rg/git/cs/core/dbtrig/procedures/procedures.h' is set to 'C'
    1 file indexed
    Available languages:
      * C => "c"
      * C++ => "cpp"
      * Objective-C => "objc"
      * Python => "py"
      * Kotlin => "kotlin"
      * T-SQL => "tsql"
      * JavaScript => "js"
      * TypeScript => "ts"
      * PL/SQL => "plsql"
      * Ruby => "ruby"
      * Scala => "scala"
      * HTML => "web"
      * JSP => "jsp"
      * XML => "xml"
      * PHP => "php"
      * ABAP => "abap"
    Quality profiles:
      * abap: 'Sonar way' (62 rules)
      * c: 'Sonar way' (188 rules)
      * cpp: 'Sonar way' (353 rules)
      * js: 'Sonar way' (130 rules)
      * jsp: 'FindBugs Security JSP' (6 rules)
      * kotlin: 'Sonar way' (29 rules)
    Unable to find the quality profile AWI9eXmn3NjMp-B28h0z in the SonarLint storage. You should update the storage, or ignore this message if the profile is empty.
      * objc: 'Sonar way' (0 rules)
      * php: 'Sonar way' (126 rules)
      * plsql: 'Sonar way' (130 rules)
      * py: 'Sonar way' (126 rules)
      * ruby: 'Sonar way' (28 rules)
      * scala: 'Sonar way' (28 rules)
    Unable to find the quality profile AWIvjwse8gtXPX8nIO7X in the SonarLint storage. You should update the storage, or ignore this message if the profile is empty.
      * ts: 'Sonar way' (0 rules)
      * tsql: 'Sonar way' (53 rules)
      * web: 'Sonar way' (27 rules)
      * xml: 'Sonar way' (4 rules)
    Execute Sensor: CFamily
    CFamily plugin version: 6.17.0.27551
    Using build-wrapper output: C:\Users\rg\c-workspace\.metadata\.plugins\org.eclipse.core.resources\.projects\cs\org.sonarlint.eclipse.core\sonarlint13268888537619617083\build-wrapper-dump.json
    Available processors: 4

    CFamily plugin supports multithreaded analysis:

    * to enable multithreaded analysis
      please specify the number of threads to use
      by setting the following property to your analysis:
      sonar.cfamily.threads=number_of_threads

    * if you do not want to enable multithreading
      please explicitly disable it
      by setting the following property to your analysis:
      sonar.cfamily.threads=1

    * visit the documentation page for more information
      {SonarQube URL}/documentation/analysis/languages/cfamily/

    Using 1 thread for analysis according to value of "sonar.cfamily.threads" property.

    CFamily plugin supports incremental analysis with the use of a cache:

    * if you do not want to enable cache
      please explicitly disable it
      by setting the following property to your analysis:
      sonar.cfamily.cache.enabled=false

    * to enable cache please specify the following 2 options:
      sonar.cfamily.cache.enabled=true
      sonar.cfamily.cache.path=relative_or_absolute_path_to_cache_location

    * visit the documentation page for more information
      {SonarQube URL}/documentation/analysis/languages/cfamily/

    Using build-wrapper-dump.json probe
    [pool-17-thread-1] C:\Users\rg\git\cs\core\dbtrig\procedures\procedures.h
    [pool-17-thread-1] C:\Users\rg\git\cs\core\dbtrig\procedures\procedures.h:8 'dbtrig_procedures.h' file not found
    Initializing metadata of file file:/C:/Users/rg/git/cs/core/dbtrig/procedures/procedures.h
    PCH: unique=0 use=0 (forceInclude=0,throughHeader=0,firstInclude=0) out of 1 (forceInclude=0,throughHeader=0)
    Error during execution of SonarLint analysis
    java.lang.IllegalStateException: java.nio.file.AccessDeniedException: sonar-cfamily-reproducer.zip
    	at com.sonar.cpp.plugin.CFamilySensor.createReproducerArchive(CFamilySensor.java:972)
    	at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:569)
    	at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:358)
    	at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.executeSensor(SensorsExecutor.java:80)
    	at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.execute(SensorsExecutor.java:71)
    	at org.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:132)
    	at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:126)
    	at org.sonarsource.sonarlint.core.container.ComponentContainer.execute(ComponentContainer.java:111)
    	at org.sonarsource.sonarlint.core.container.storage.StorageAnalyzer.analyze(StorageAnalyzer.java:75)
    	at org.sonarsource.sonarlint.core.container.storage.StorageContainerHandler.analyze(StorageContainerHandler.java:83)
    	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$analyze$0(ConnectedSonarLintEngineImpl.java:153)
    	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:352)
    	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(ConnectedSonarLintEngineImpl.java:342)
    	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.analyze(ConnectedSonarLintEngineImpl.java:150)
    	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.lambda$13(ConnectedEngineFacade.java:361)
    	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.withEngine(ConnectedEngineFacade.java:154)
    	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.runAnalysis(ConnectedEngineFacade.java:360)
    	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeConnectedProjectJob.runAnalysis(AnalyzeConnectedProjectJob.java:70)
    	at org.sonarlint.eclipse.core.internal.jobs.AnalyzeConnectedProjectJob.runAnalysis(AnalyzeConnectedProjectJob.java:1)
    	at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.run(AbstractAnalyzeProjectJob.java:390)
    	at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.runAnalysisAndUpdateMarkers(AbstractAnalyzeProjectJob.java:199)
    	at org.sonarlint.eclipse.core.internal.jobs.AbstractAnalyzeProjectJob.doRun(AbstractAnalyzeProjectJob.java:161)
    	at org.sonarlint.eclipse.core.internal.jobs.AbstractSonarProjectJob.run(AbstractSonarProjectJob.java:45)
    	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
    Caused by: java.nio.file.AccessDeniedException: sonar-cfamily-reproducer.zip
    	at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89)
    	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
    	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
    	at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:235)
    	at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:478)
    	at java.base/java.nio.file.Files.newOutputStream(Files.java:222)
    	at com.sonar.cpp.plugin.CFamilySensor.createReproducerArchive(CFamilySensor.java:962)
    	... 23 more

Sonar Scanner server version is 8.7.1 (build 42226)
plugin version SonarLint for Eclipse 5.9.0.31414
Eclipse IDE for C/C++ Developers Version: 2021-03 (4.19.0)

Thanks in advance for any help to solve that issue.

Roberto

Hi @RobertoG ,

you are affected by CPP-3120, as a workaround, you may want to change the folder of invocation of the eclipse process to a folder under your user home.

Hi @mpaladin ,

thanks for your response.
I think I’m already running eclipse from a directory under my user home:
C:\Users\rg\eclipse\cpp-2019-03\eclipse\eclipse.exe
but I’m still getting the error…
or do you mean something different?

Hi @RobertoG ,

I am referring to the process working directory, not the directory where eclipse is located.