Sonarsource/sonarqube-scan-action@v3 - charset issue

Must-share information (formatted with Markdown):

  • which versions are you using
    ** SonarQube Enterprise 9.9.1 LTS
    ** sonarsource/sonarqube-scan-action@master (as of now v3.0.0)
  • how is SonarQube deployed: zip
  • what are you trying to achieve: SonarQube scan via GitHub workflow action
  • what have you tried so far to achieve this

Since today 14/08/2024, we have an issue with scanner action in github.
SonarSource/sonarqube-scan-action (github.com)

Setup:

      - name: SonarQube Scan
        uses: sonarsource/sonarqube-scan-action@master
        env:
          SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }}
          SONAR_HOST_URL: ${{ vars.SONARQUBE_HOST_URL }}
          SONAR_SCANNER_OPTS: -Xmx6500m
        with:
          projectBaseDir: core
          args: >
            -Dsonar.projectBaseDir=/github/workspace/core
            -Dsonar.working.directory=/github/workspace/core/.scannerwork
            -Dsonar.java.skipUnchanged=true

Error we receive now:

07:06:47.998 INFO    Excluded tests: *test/**/*.*, **/test/**/*.*, **/itest/**/*.*, **/test/**
07:06:48.455 INFO  EXECUTION FAILURE
07:06:48.461 INFO  Total time: 19.226s
07:06:48.462 ERROR Error during SonarScanner CLI execution
java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: XXXX/documents/Excel/Template/Int??r??t et Frais.xlsx
	at java.base/sun.nio.fs.UnixPath.encode(Unknown Source)
	at java.base/sun.nio.fs.UnixPath.<init>(Unknown Source)
	at java.base/sun.nio.fs.UnixFileSystem.getPath(Unknown Source)
	at java.base/java.nio.file.Path.resolve(Unknown Source)
	at org.sonar.scm.git.IncludedFilesRepository.collectFiles(IncludedFilesRepository.java:72)
	at org.sonar.scm.git.IncludedFilesRepository.collectFilesIterative(IncludedFilesRepository.java:79)
	at org.sonar.scm.git.IncludedFilesRepository.indexFiles(IncludedFilesRepository.java:51)
	at org.sonar.scm.git.IncludedFilesRepository.<init>(IncludedFilesRepository.java:41)
	at org.sonar.scm.git.GitIgnoreCommand.init(GitIgnoreCommand.java:37)
	at org.sonar.scanner.scan.filesystem.ProjectFileIndexer.index(ProjectFileIndexer.java:114)
	at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:363)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
	at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:137)
	at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
	at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
	at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
	at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
	at org.sonarsource.scanner.lib.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:41)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.sonarsource.scanner.lib.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:62)
	at jdk.proxy3/jdk.proxy3.$Proxy2.execute(Unknown Source)
	at org.sonarsource.scanner.lib.InProcessScannerEngineFacade.doAnalyze(InProcessScannerEngineFacade.java:39)
	at org.sonarsource.scanner.lib.ScannerEngineFacade.analyze(ScannerEngineFacade.java:61)
	at org.sonarsource.scanner.cli.Main.analyze(Main.java:77)
	at org.sonarsource.scanner.cli.Main.main(Main.java:63)
07:06:48.464 ERROR 
07:06:48.464 ERROR Re-run SonarScanner CLI using the -X switch to enable full debug logging.

Actual filename:

Intérêt et Frais.xlsx

This file is present for months and has been scanned countless times without any issue. It has not been touched since.

Mitigation strategy:
Fix to previous version, v2, that worked, instead of latest (currently not greatest) version.

  • Old value: sonarsource/sonarqube-scan-action@master
  • New value: sonarsource/sonarqube-scan-action@v2

If you need anymore information to resolve this issue, let me know!

Hi Dennis,

Thank you for reporting this issue, and we’re sorry for the inconvenience. We have reverted the changes, so the master should be clean now. However, as best practice, we recommend keeping the fixed version tag (v2) and changing it deliberately. Changes on the master can have breaking changes that may impact your workflow.

I have also created a ticket, which we will tackle before re-releasing the GHA with an upgraded Scanner CLI docker version. [SCANDOCKER-40] - Jira

Thanks
Csaba

1 Like

@Csaba_Feher If this is our position, we have got to update the in-product tutorials

1 Like

Hi, same issue for us running SonarQube Community edition on GitLab. It seems like this is an issue with the newer versions of the SonarScanner docker image (10.X & 11.X) where the LANG environment variable is missing. Setting export LANG=C.UTF-8 resolved the issue for us.

In the 5.x image tags, this setting was exported by Sonar:

In the newer images, this is not the case anymore:

It would be great if this could be fixed in the docker image directly, for now we are simply exporting the lang variable in our pipeline

1 Like

Hi All,

this should be fixed in the new version of the docker image.
Please let us know if the issues reappear.

Thanks
Csaba

1 Like

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