what are you trying to achieve
Just complete the command # dotnet sonarscanner end
without an error
what have you tried so far to achieve this
We have tried to enforce UTF-8 coding for the Java with the: "export JAVA_OPTS="-Dsun.jnu.encoding=UTF-8 -Dfile.encoding=UTF-8"
We have tried to rebuild the system locale
We have tried to exclude the “tools/somedir” path with the -d:sonar.exclusions=dependency-check-report.*,tools/**/*.*,**/tools/**/*.* options
I’m not surprised to hear something went awry with another character set.
It would be really helpful to know what the scanner was doing when it threw this error… so what was happening in the ... before the InvalidPathException
Thank you for the reply. Sorry, was not available to respond.
Well… actually not too much information before the exception, check it (I only masked some “private” information with ***:
$ dotnet sonarscanner end
SonarScanner for MSBuild 5.9.1
Using the .NET Core version of the Scanner for MSBuild
Post-processing started.
Calling the SonarScanner CLI...
INFO: Scanner configuration file: /root/.dotnet/tools/.store/dotnet-sonarscanner/5.9.1/dotnet-sonarscanner/5.9.1/tools/net5.0/any/sonar-scanner-4.7.0.2747/conf/sonar-scanner.properties
INFO: Project root configuration file: /builds/autofollow/fintarget/.sonarqube/out/sonar-project.properties
INFO: SonarScanner 4.7.0.2747
INFO: Java 11.0.16 Debian (64-bit)
INFO: Linux 5.4.179-1.el7.elrepo.x86_64 amd64
INFO: User cache: /root/.sonar/cache
INFO: Scanner configuration file: /root/.dotnet/tools/.store/dotnet-sonarscanner/5.9.1/dotnet-sonarscanner/5.9.1/tools/net5.0/any/sonar-scanner-4.7.0.2747/conf/sonar-scanner.properties
INFO: Project root configuration file: /builds/autofollow/fintarget/.sonarqube/out/sonar-project.properties
INFO: Analyzing on SonarQube server 9.5.0.56709
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=292ms
INFO: Server id: 86E1FA4D-AV_3CWdGVPLo9hr60r57
INFO: User cache: /root/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=43ms
INFO: Load/download plugins (done) | time=8698ms
INFO: Loaded core extensions: developer-scanner
INFO: Process project properties
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 12.548s
INFO: Final Memory: 27M/744M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ClassRealm{javascript}-org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl': Unsatisfied dependency expressed through constructor parameter 4; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'AnalysisTempFolder' defined in org.sonar.scanner.analysis.AnalysisTempFolderProvider: Unsatisfied dependency expressed through method 'provide' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'DefaultInputProject' defined in org.sonar.scanner.scan.InputProjectProvider: Unsatisfied dependency expressed through method 'provide' parameter 2; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ProjectReactor' defined in org.sonar.scanner.scan.MutableProjectReactorProvider: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.sonar.api.batch.bootstrap.ProjectReactor]: Factory method 'provide' threw exception; nested exception is java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: /builds/autofollow/fintarget/tests/HS.Tests/Resources/???????? ?????????.txt
Thanks you for the quick reply. I appreciate it.
Indeed, the file is the reason. I mentioned in the original post “We have faced and error which were caused by the Cyrillic symbols in file names during the execution”.
This is normal file BUT with the Cyrillic symbols in its name.
Please be noted that if I run (for instance) the command ls -la the result will be normal and the filename will be displayed as it is, without any question marks. I have tried running ls -la under the same user that was used to run the above dotnet commands.
Sorry, I did a bad job reading your full post and just focused on the stacktrace I’ll blame it on the holidays.
I went ahead and tried scanning a file name with Cyrillic symbols – файл.txt… and it didn’t give me any trouble. I still couldn’t reproduce it even when following a colleague’s advice who debugged a similar issue.
Still… I would expect this is an issue of having the encoding set correctly. Where is it that are you adjusting the locale (and then running the locale command from)? Within the docker container, or only on the machine hosting the docker engine?
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘ProjectReactor’ defined in org.sonar.scanner.scan.MutableProjectReactorProvider: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.sonar.api.batch.bootstrap.ProjectReactor]: Factory method ‘provide’ threw exception; nested exception is java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: /home/jenkins/agent/workspace/Projeto-2024-Build-HML-teste/ProjetoTeste2024.UI/wwwroot/images/2024/desempenho/lider/n?o.svg