Unable to execute Analysis because of special characters: java.nio.file.InvalidPathException

  • Versions used: SonarQube Server 7.9.1.27448, Scanner 4.0.0.1744-linux, SonarQube Jenkins Plugin 2.8.1

In an evaluation process we tried to scan the OWASP Juice Shop, but it failed with the following error:
ERROR: Error during SonarQube Scanner execution
java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: frontend/src/assets/public/images/uploads/my-rare-collectors-item!-[???$???(???-???-???-???)???$???]-1572603645543.jpg

This is the project that shall be scanned:

I can’t propose a possible workaround, the filenames have to be parsed correctly.

  • Scanner command: sonar-scanner -Dsonar.host.url=$SONAR_HOST_URL -Dsonar.projectKey=$SONAR_PROJECTKEY -Dsonar.login=$SONAR_AUTH_TOKEN

Hi,

Welcome to the community!

Your best bet here is to configure some exclusions. Off-hand, it looks like **/*.jpg would be a good start. It’s easiest to manage long-term if you configure exclusions at the Project level in the UI. If your project doesn’t exist in SonarQube yet, you can bootstrap that by provisioning it.

 
HTH,
Ann

this doesn’t help

INFO: Indexing files...
INFO: Project configuration:
INFO: Excluded sources: **/*.jpg, **/*.png
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 14.552s
INFO: Final Memory: 6M/27M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: images/banner - ??????????.png

I know it’s just a workaround - and not an absolute solution - but in this case you can directly exclude **/images/**/*. This stands of course if there is no “images” folder with source code to analyze.