SonarQube Scanner for MSBuild Long File Path Bug v4+

411 views
Skip to first unread message

redt...@gmail.com

unread,
Jan 31, 2018, 8:43:08 PM1/31/18
to SonarQube
We recently upgraded our TeamCity Build Server to use v4.0.2.892 of the SonarQube Scanner for MSBuild (https://github.com/SonarSource/sonar-scanner-msbuild/releases). After the upgrade all MSBuild SonarQube projects failed on the sonarqube step mentioning the file path is to long (See below errors). We have been running v3.0.2.656 of MsBuild Scanner with no issues for quite some time now. Something in the v4 branch seems to have broken MSBuild SonarQube scans for us. Also further down in the errors makes mention of .NET v4.5.2 not being installed. Our Build Agents have pretty much all the versions of .NET installed.




[19:33:39][Step 6/9] ERROR:
[19:33:39][Step 6/9] ERROR: Unhandled Exception: System.IO.PathTooLongException: The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
[19:33:39][Step 6/9] ERROR: at System.IO.PathHelper.GetFullPathName()
[19:33:39][Step 6/9] ERROR: at System.IO.Path.LegacyNormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
[19:33:39][Step 6/9] ERROR: at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength, Boolean expandShortPaths)
[19:33:39][Step 6/9] ERROR: at System.IO.Path.GetFullPathInternal(String path)
[19:33:39][Step 6/9] ERROR: at System.IO.FileInfo.Init(String fileName, Boolean checkHost)
[19:33:39][Step 6/9] ERROR: at System.IO.FileInfo..ctor(String fileName)
[19:33:39][Step 6/9] ERROR: at SonarLint.Helpers.ParameterLoader.ConfigurationFilePathMatchesExpected(String path)
[19:33:39][Step 6/9] ERROR: at SonarLint.Runner.Configuration..ctor(String path, AnalyzerLanguage language)
[19:33:39][Step 6/9] ERROR: at SonarLint.Runner.Program.Main(String[] args)
[19:33:40][Step 6/9] INFO: ------------------------------------------------------------------------
[19:33:40][Step 6/9] INFO: EXECUTION FAILURE
[19:33:40][Step 6/9] INFO: ------------------------------------------------------------------------
[19:33:40][Step 6/9] INFO: Total time: 17.388s
[19:33:40][Step 6/9] INFO: Final Memory: 57M/352M
[19:33:40][Step 6/9] ERROR: Error during SonarQube Scanner execution
[19:33:40][Step 6/9] INFO: ------------------------------------------------------------------------
[19:33:40][Step 6/9] java.lang.IllegalStateException: The .NET analyzer failed with exit code: 255 - Verify that the .NET Framework version 4.5.2 at least is installed.
[19:33:40][Step 6/9] at org.sonar.plugins.csharp.CSharpSensor.analyze(CSharpSensor.java:149)
[19:33:40][Step 6/9] at org.sonar.plugins.csharp.CSharpSensor.analyse(CSharpSensor.java:108)
[19:33:40][Step 6/9] at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:58)
[19:33:40][Step 6/9] at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:50)
[19:33:40][Step 6/9] at org.sonar.batch.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:83)
[19:33:40][Step 6/9] at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
[19:33:40][Step 6/9] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[19:33:40][Step 6/9] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[19:33:40][Step 6/9] at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:241)
[19:33:40][Step 6/9] at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:236)
[19:33:40][Step 6/9] at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:234)
[19:33:40][Step 6/9] at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:226)
[19:33:40][Step 6/9] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[19:33:40][Step 6/9] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[19:33:40][Step 6/9] at org.sonar.batch.task.ScanTask.execute(ScanTask.java:47)
[19:33:40][Step 6/9] at org.sonar.batch.task.TaskContainer.doAfterStart(TaskContainer.java:86)
[19:33:40][Step 6/9] at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:142)
[19:33:40][Step 6/9] at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:127)
[19:33:40][Step 6/9] at org.sonar.batch.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:106)
[19:33:40][Step 6/9] at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:119)
[19:33:40][Step 6/9] at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
[19:33:40][Step 6/9] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[19:33:40][Step 6/9] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[19:33:40][Step 6/9] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[19:33:40][Step 6/9] at java.lang.reflect.Method.invoke(Method.java:498)
[19:33:40][Step 6/9] at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
[19:33:40][Step 6/9] at com.sun.proxy.$Proxy0.execute(Unknown Source)
[19:33:40][Step 6/9] at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
[19:33:40][Step 6/9] at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
[19:33:40][Step 6/9] at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
[19:33:40][Step 6/9] at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
[19:33:40][Step 6/9] at org.sonarsource.scanner.cli.Main.main(Main.java:61)
[19:33:40][Step 6/9] ERROR:
[19:33:40][Step 6/9] ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
[19:33:40][Step 6/9] The SonarQube Scanner did not complete successfully
[19:33:40][Step 6/9] 19:33:40.643 Creating a summary markdown file...
[19:33:40][Step 6/9] 19:33:40.647 Post-processing failed. Exit code: 1
[19:33:40][Step 6/9] Process exited with code 1
[19:33:40][Step 6/9] Process exited with code 1
[19:33:40][Step 6/9] Step End .NET SonarQube Analysis (Command Line) failed
[19:33:40][Step 6/9] Error message is logged

Julien HENRY

unread,
Feb 1, 2018, 8:25:55 AM2/1/18
to SonarQube
Hi,

Can you precise what is the version of the SonarC# plugin on your SonarQube server? For me it seems to be outdated, because recent versions of the SonarC# Sensor rely on Roslyn being run during the msbuild step, and no more try to run Roslyn itself (was named the "MSBuild 12 mode").

Regards,

Julien

redt...@gmail.com

unread,
Feb 7, 2018, 7:49:42 AM2/7/18
to SonarQube
We are currently running v5.0 of the C# plugin. Is that version not supported with v4.x of the MSBuild Scanner?

Amaury Leve

unread,
Feb 9, 2018, 8:13:07 AM2/9/18
to redt...@gmail.com, SonarQube
Hi,

I am a bit surprised by your logs as they show "SonarLint" namespaces. Regarding the plugin it is recommended to try to use the latest versions (be careful about the changes on major versions) because we did a lot of improvement not only on the analyzer but also on the interaction with SonarQube.

Could you provide the full log with the verbose mode activated (/d:sonar.verbose=true), also could you provide the content of the out and conf folders under the .sonarqube folder.

Thanks,
Amaury

On Wed, Feb 7, 2018 at 1:49 PM <redt...@gmail.com> wrote:
We are currently running v5.0 of the C# plugin. Is that version not supported with v4.x of the MSBuild Scanner?

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/c03c5420-75f4-47e5-871f-d8dd70c75354%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Amaury Levé | SonarSource

Software Developer - .Net Team

http://sonarsource.com


Are you using SonarLint in your IDE? 
Reply all
Reply to author
Forward
0 new messages