Sonar-scanner java.nio.file.InvalidPathException on scanning C++ sources

Hi,
I got an error on running my sonar-scanner sources:

java.nio.file.InvalidPathException: Trailing char < > at index 75: E:\BuildAgent\work\c76803df29afe460\KE\sources\\\Common\KEService_defines.h

and I see that in build log trailing space in the of a file, but it is missing in the filename.
The error is reproduced on sonar-scanner v4.6.2.2472 and v4.7.0.2747.
Can someone help?

What version of SonarQube are you using?

  • Enterprise Edition
  • Version 9.5 (build 56709)

[14:03:24] : [Step 6/7] 14:03:24.764 DEBUG: ‘KE\sources\Common\KEService_defines.h’ indexed with language ‘cpp’

[14:03:42] : [Step 6/7] 14:03:42.522 DEBUG: ‘KE/sources/Common/KEService_defines.h’ generated metadata with charset ‘UTF-8’

In build log I see that path with correct filename

Take a look at this thread – it may not be the file names on the filesystem that is the issue

Thank you for help!
The root cause was really in the whitespace in #include this file, we found it and verify fix and now build status is green.

1 Like

Thanks for the follow-up! I can also let you know that in the next release of SonarQube, we’ll make sure this no longer fails the analysis.

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