sonarlint cli scan fails when scanning symlinks to directories

52 views
Skip to first unread message

sandrac...@googlemail.com

unread,
Feb 17, 2017, 5:18:21 AM2/17/17
to SonarLint

When the source path being scanned contains a symbolic link to another directory then the scan is failing with error

ERROR: Fail to read file '/proj/new/src/cnf/symlink' with encoding 'UTF-8'
ERROR: Caused by: /proj/new/src/cnf/symlink (Is a directory)


The scan is failing with Sonarlint cli 2.0 and 2.1.  It works fine with Sonarlint cli 1.0
If source path contains symbolic links to files it works fine.

----------------------- full log -------------------------


INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 16.077s
INFO: Final Memory: 6M/496M
INFO: ------------------------------------------------------------------------
ERROR: Error executing SonarLint
java.lang.IllegalStateException: Fail to read file '/proj/new/src/cnf/symlink' with encoding 'UTF-8'
    at org.sonarsource.sonarlint.core.container.analysis.filesystem.FileMetadata.readFile(FileMetadata.java:163)
    at org.sonarsource.sonarlint.core.container.analysis.filesystem.FileMetadata.readMetadata(FileMetadata.java:139)
    at org.sonarsource.sonarlint.core.container.analysis.filesystem.InputFileBuilder.create(InputFileBuilder.java:49)
    at org.sonarsource.sonarlint.core.container.analysis.filesystem.FileIndexer.indexFile(FileIndexer.java:85)
    at org.sonarsource.sonarlint.core.container.analysis.filesystem.FileIndexer.indexFiles(FileIndexer.java:80)
    at org.sonarsource.sonarlint.core.container.analysis.filesystem.FileIndexer.index(FileIndexer.java:68)
    at org.sonarsource.sonarlint.core.container.analysis.filesystem.SonarLintFileSystem.index(SonarLintFileSystem.java:39)
    at org.sonarsource.sonarlint.core.analyzer.sensor.PhaseExecutor.execute(PhaseExecutor.java:42)
    at org.sonarsource.sonarlint.core.container.analysis.AnalysisContainer.doAfterStart(AnalysisContainer.java:143)
    at org.sonarsource.sonarlint.core.container.ComponentContainer.startComponents(ComponentContainer.java:125)
    at org.sonarsource.sonarlint.core.container.ComponentContainer.execute(ComponentContainer.java:110)
    at org.sonarsource.sonarlint.core.container.standalone.StandaloneGlobalContainer.analyze(StandaloneGlobalContainer.java:118)
    at org.sonarsource.sonarlint.core.StandaloneSonarLintEngineImpl.analyze(StandaloneSonarLintEngineImpl.java:93)
    at org.sonarsource.sonarlint.core.StandaloneSonarLintEngineImpl.analyze(StandaloneSonarLintEngineImpl.java:83)
    at org.sonarlint.cli.analysis.StandaloneSonarLint.doAnalysis(StandaloneSonarLint.java:47)
    at org.sonarlint.cli.analysis.SonarLint.runAnalysis(SonarLint.java:68)
    at org.sonarlint.cli.Main.runOnce(Main.java:104)
    at org.sonarlint.cli.Main.run(Main.java:91)
    at org.sonarlint.cli.Main.execute(Main.java:167)
    at org.sonarlint.cli.Main.main(Main.java:134)
Caused by: java.io.FileNotFoundException: /proj/new/src/cnf/symlink (Is a directory)
    at java.io.FileInputStream.open0(Native Method)
    at java.io.FileInputStream.open(FileInputStream.java:195)
    at java.io.FileInputStream.<init>(FileInputStream.java:138)
    at org.sonarsource.sonarlint.core.container.analysis.filesystem.FileMetadata.readFile(FileMetadata.java:158)
    ... 19 more
ERROR:
ERROR: Re-run SonarLint using the -X switch to enable full debug logging.

janos....@sonarsource.com

unread,
Feb 17, 2017, 5:54:24 AM2/17/17
to SonarLint, sandrac...@googlemail.com
Hi,

Thanks for reporting this. I created a ticket, you can track its progress here: https://jira.sonarsource.com/browse/SLCLI-36

Janos
Reply all
Reply to author
Forward
0 new messages