SonarLint Eclipse error during C files analysis: AccessDeniedException on

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,\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:
    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:

    * if you do not want to enable multithreading
      please explicitly disable it
      by setting the following property to your analysis:

    * 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:

    * to enable cache please specify the following 2 options:

    * 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:
    	at com.sonar.cpp.plugin.CFamilySensor.createReproducerArchive(
    	at com.sonar.cpp.plugin.CFamilySensor.process(
    	at com.sonar.cpp.plugin.CFamilySensor.execute(
    	at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.executeSensor(
    	at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.execute(
    	at org.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.doAfterStart(
    	at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(
    	at org.sonarsource.sonarlint.core.container.ComponentContainer.execute(
    	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.lambda$analyze$0(
    	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(
    	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.withReadLock(
    	at org.sonarsource.sonarlint.core.ConnectedSonarLintEngineImpl.analyze(
    	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.lambda$13(
    	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.withEngine(
    	at org.sonarlint.eclipse.core.internal.engine.connected.ConnectedEngineFacade.runAnalysis(
    Caused by: java.nio.file.AccessDeniedException:
    	at java.base/sun.nio.fs.WindowsException.translateToIOException(
    	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(
    	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(
    	at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(
    	at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(
    	at java.base/java.nio.file.Files.newOutputStream(
    	at com.sonar.cpp.plugin.CFamilySensor.createReproducerArchive(
    	... 23 more

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

Thanks in advance for any help to solve that issue.


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:
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.