SonarCloud running on CircleCI has started to fail

  • ALM GitHub
  • CI system used Circle CI
  • Languages of the repository : Swift

We’ve no recent changes, but it has started to fail. Any suggestions as to what could have gone wrong?

[08:36:03]: -------------------
[08:36:03]: --- Step: sonar ---
[08:36:03]: -------------------
[08:36:04]: ▸ INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/4.6.2.2472_1/libexec/conf/sonar-scanner.properties
[08:36:04]: ▸ INFO: Project root configuration file: /Users/distiller/project/sonar-project.properties
[08:36:04]: ▸ INFO: SonarScanner 4.6.2.2472
[08:36:04]: ▸ INFO: Java 11.0.12 Homebrew (64-bit)
[08:36:04]: ▸ INFO: Mac OS X 11.5.2 x86_64
[08:36:04]: ▸ INFO: User cache: /Users/distiller/.sonar/cache
[08:36:09]: ▸ INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/4.6.2.2472_1/libexec/conf/sonar-scanner.properties
[08:36:09]: ▸ INFO: Project root configuration file: /Users/distiller/project/sonar-project.properties
[08:36:09]: ▸ INFO: Analyzing on SonarCloud
[08:36:09]: ▸ INFO: Default locale: "en_US", source code encoding: "UTF-8"
[08:36:10]: ▸ INFO: Load global settings
[08:36:10]: ▸ INFO: Load global settings (done) | time=736ms
[08:36:10]: ▸ INFO: Server id: 1BD809FA-AWHW8ct9-T_TB3XqouNu
[08:36:10]: ▸ INFO: User cache: /Users/distiller/.sonar/cache
[08:36:10]: ▸ INFO: Load/download plugins
[08:36:10]: ▸ INFO: Load plugins index
[08:36:11]: ▸ INFO: Load plugins index (done) | time=192ms
[08:37:11]: ▸ INFO: Load/download plugins (done) | time=60475ms
[08:37:12]: ▸ INFO: Loaded core extensions: developer-scanner
[08:37:12]: ▸ INFO: Found an active CI vendor: 'CircleCI'
[08:37:13]: ▸ INFO: Load project settings for component key: '********bytes_ios'
[08:37:13]: ▸ INFO: Load project settings for component key: '********bytes_ios' (done) | time=139ms
[08:37:13]: ▸ INFO: Process project properties
[08:37:13]: ▸ INFO: Execute project builders
[08:37:13]: ▸ INFO: Execute project builders (done) | time=2ms
[08:37:13]: ▸ INFO: Project key: ********bytes_ios
[08:37:13]: ▸ INFO: Base dir: /Users/distiller/project
[08:37:13]: ▸ INFO: Working dir: /Users/distiller/project/.scannerwork
[08:37:13]: ▸ INFO: Load project branches
[08:37:13]: ▸ INFO: Load project branches (done) | time=273ms
[08:37:13]: ▸ INFO: Check ALM binding of project '********bytes_ios'
[08:37:13]: ▸ INFO: Detected project binding: BOUND
[08:37:13]: ▸ INFO: Check ALM binding of project '********bytes_ios' (done) | time=123ms
[08:37:13]: ▸ INFO: Load project pull requests
[08:37:13]: ▸ INFO: Load project pull requests (done) | time=250ms
[08:37:13]: ▸ INFO: Load branch configuration
[08:37:14]: ▸ INFO: Load branch configuration (done) | time=678ms
[08:37:14]: ▸ INFO: Load quality profiles
[08:37:14]: ▸ INFO: Load quality profiles (done) | time=189ms
[08:37:14]: ▸ INFO: Load active rules
[08:37:19]: ▸ INFO: Load active rules (done) | time=5042ms
[08:37:19]: ▸ INFO: Organization key: ********bytes
[08:37:19]: ▸ INFO: Pull request 997 for merge into develop from OX-2753-Address-Int-Bug-Fixes
[08:37:20]: ▸ INFO: Load project repositories
[08:37:20]: ▸ INFO: Load project repositories (done) | time=709ms
[08:37:20]: ▸ INFO: SCM collecting changed files in the branch
[08:37:21]: ▸ INFO: SCM collecting changed files in the branch (done) | time=755ms
[08:37:21]: ▸ INFO: Indexing files...
[08:37:21]: ▸ INFO: Project configuration:
[08:37:21]: ▸ INFO:   Excluded sources: **/build-wrapper-dump.json
[08:37:27]: ▸ INFO: 1736 files indexed
[08:37:27]: ▸ INFO: 0 files ignored because of inclusion/exclusion patterns
[08:37:27]: ▸ INFO: 0 files ignored because of scm ignore settings
[08:37:27]: ▸ INFO: Quality profile for c: Sonar way
[08:37:27]: ▸ INFO: Quality profile for json: SonarQube Way
[08:37:27]: ▸ INFO: Quality profile for objc: Sonar way
[08:37:27]: ▸ INFO: Quality profile for swift: Sonar way
[08:37:27]: ▸ INFO: ------------- Run sensors on module ios
[08:37:27]: ▸ INFO: Load metrics repository
[08:37:27]: ▸ INFO: Load metrics repository (done) | time=142ms
[08:37:34]: ▸ INFO: Sensor IaC CloudFormation Sensor [iac]
[08:37:34]: ▸ INFO: 0 source files to be analyzed
[08:37:34]: ▸ INFO: 0/0 source files have been analyzed
[08:37:34]: ▸ INFO: Sensor IaC CloudFormation Sensor [iac] (done) | time=360ms
[08:37:34]: ▸ INFO: Sensor C# Project Type Information [csharp]
[08:37:34]: ▸ INFO: Sensor C# Project Type Information [csharp] (done) | time=7ms
[08:37:34]: ▸ INFO: Sensor C# Analysis Log [csharp]
[08:37:34]: ▸ INFO: Sensor C# Analysis Log [csharp] (done) | time=52ms
[08:37:34]: ▸ INFO: Sensor C# Properties [csharp]
[08:37:34]: ▸ INFO: Sensor C# Properties [csharp] (done) | time=0ms
[08:37:34]: ▸ INFO: Sensor HTML [web]
[08:37:34]: ▸ INFO: Sensor HTML is restricted to changed files only
[08:37:34]: ▸ INFO: Sensor HTML [web] (done) | time=20ms
[08:37:34]: ▸ INFO: Sensor Text Sensor [text]
[08:37:34]: ▸ INFO: 1245 source files to be analyzed
[08:37:36]: ▸ INFO: 1245/1245 source files have been analyzed
[08:37:36]: ▸ INFO: Sensor Text Sensor [text] (done) | time=1663ms
[08:37:36]: ▸ INFO: Sensor VB.NET Project Type Information [vbnet]
[08:37:36]: ▸ INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=5ms
[08:37:36]: ▸ INFO: Sensor VB.NET Analysis Log [vbnet]
[08:37:36]: ▸ INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=37ms
[08:37:36]: ▸ INFO: Sensor VB.NET Properties [vbnet]
[08:37:36]: ▸ INFO: Sensor VB.NET Properties [vbnet] (done) | time=1ms
[08:37:36]: ▸ INFO: Sensor Swift Code Quality and Security [swift]
[08:37:36]: ▸ INFO: 702 source files to be analyzed
[08:37:46]: ▸ INFO: 109/702 files analyzed, current file: app-ios/CrashLogger.swift
[08:37:56]: ▸ INFO: 276/702 files analyzed, current file: app-ios/Features/Menu/UI/RestaurantMenuViewController.swift
[08:38:06]: ▸ INFO: 418/702 files analyzed, current file: app-ios/DataLayer/Network/Endpoints/AccountEndpoint.swift
[08:38:15]: ▸ INFO: 702/702 source files have been analyzed
[08:38:15]: ▸ INFO: Sensor Swift Code Quality and Security [swift] (done) | time=39586ms
[08:38:15]: ▸ INFO: Sensor JaCoCo XML Report Importer [jacoco]
[08:38:15]: ▸ INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
[08:38:15]: ▸ INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
[08:38:15]: ▸ INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=14ms
[08:38:15]: ▸ INFO: Sensor CSS Rules [javascript]
[08:38:15]: ▸ INFO: Sensor CSS Rules is restricted to changed files only
[08:38:15]: ▸ INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
[08:38:15]: ▸ INFO: Sensor CSS Rules [javascript] (done) | time=6ms
[08:38:15]: ▸ INFO: Sensor ThymeLeaf template sensor [securityjavafrontend]
[08:38:15]: ▸ INFO: Sensor ThymeLeaf template sensor [securityjavafrontend] (done) | time=12ms
[08:38:15]: ▸ INFO: Sensor Serverless configuration file sensor [security]
[08:38:15]: ▸ INFO: 0 Serverless function entries were found in the project
[08:38:15]: ▸ INFO: 0 Serverless function handlers were kept as entrypoints
[08:38:15]: ▸ INFO: Sensor Serverless configuration file sensor [security] (done) | time=15ms
[08:38:15]: ▸ INFO: Sensor AWS SAM template file sensor [security]
[08:38:15]: ▸ INFO: Sensor AWS SAM template file sensor [security] (done) | time=4ms
[08:38:15]: ▸ INFO: Sensor Generic Coverage Report
[08:38:15]: ▸ INFO: Parsing /Users/distiller/project/fastlane/test_output/sonarqube-generic-coverage.xml
[08:38:16]: ▸ INFO: Imported coverage data for 533 files
[08:38:16]: ▸ INFO: Coverage data ignored for 1 unknown files, including:
[08:38:16]: ▸ AppTheme.swift
[08:38:16]: ▸ INFO: Sensor Generic Coverage Report (done) | time=515ms
[08:38:16]: ▸ INFO: Sensor CFamily [cpp]
[08:38:16]: ▸ INFO: CFamily plugin version: 6.33.0.46593
[08:38:16]: ▸ INFO: Using compile commands: /Users/distiller/project/compile_commands.json
[08:38:16]: ▸ INFO: Available processors: 4
[08:38:16]: ▸ INFO: Using 4 threads for analysis.
[08:38:19]: ▸ WARN:
[08:38:19]: ▸ CFamily plugin supports incremental analysis with the use of a cache:
[08:38:19]: ▸ * if you do not want to enable cache
[08:38:19]: ▸ please explicitly disable it
[08:38:19]: ▸ by setting the following property to your analysis:
[08:38:19]: ▸ sonar.cfamily.cache.enabled=false
[08:38:19]: ▸ * to enable cache please specify the following 2 options:
[08:38:19]: ▸ sonar.cfamily.cache.enabled=true
[08:38:19]: ▸ sonar.cfamily.cache.path=relative_or_absolute_path_to_cache_location
[08:38:19]: ▸ * visit the documentation page for more information
[08:38:19]: ▸ https://sonarcloud.io/documentation/analysis/languages/cfamily/
[08:38:20]: ▸ INFO: ------------------------------------------------------------------------
[08:38:20]: ▸ INFO: EXECUTION FAILURE
[08:38:20]: ▸ INFO: ------------------------------------------------------------------------
[08:38:20]: ▸ INFO: Total time: 2:16.605s
[08:38:21]: ▸ INFO: Final Memory: 75M/260M
[08:38:21]: ▸ INFO: ------------------------------------------------------------------------
[08:38:21]: ▸ ERROR: Error during SonarScanner execution
[08:38:21]: ▸ java.lang.IllegalStateException: java.io.IOException: Cannot run program "/Users/distiller/project/.scannerwork/.sonartmp/13016760168792296293/subprocess" (in directory "/Users/distiller/project/app-ios/Model\&DataFetching/WKTString.m"): error=2, No such file or directory
[08:38:21]: ▸ at com.sonar.cpp.driver.ProcessExecutor.execute(ProcessExecutor.java:74)
[08:38:21]: ▸ at com.sonar.cpp.driver.ProcessExecutor.execute(ProcessExecutor.java:45)
[08:38:21]: ▸ at com.sonar.cpp.analyzer.ClangDriver.lambda$probeCompiler$9(ClangDriver.java:619)
[08:38:21]: ▸ at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1133)
[08:38:21]: ▸ at com.sonar.cpp.analyzer.ClangDriver.probeCompiler(ClangDriver.java:609)
[08:38:21]: ▸ at com.sonar.cpp.analyzer.ClangDriver.onCapture(ClangDriver.java:395)
[08:38:21]: ▸ at com.sonar.cpp.analyzer.CompilerDrivers.onCapture(CompilerDrivers.java:35)
[08:38:21]: ▸ at com.sonar.cpp.plugin.CFamilySensor.lambda$process$12(CFamilySensor.java:643)
[08:38:21]: ▸ at com.sonar.cpp.plugin.CompileCommandsReader.readCaptures(CompileCommandsReader.java:61)
[08:38:21]: ▸ at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:640)
[08:38:21]: ▸ at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:411)
[08:38:21]: ▸ at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:190)
[08:38:21]: ▸ at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:62)
[08:38:21]: ▸ at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:75)
[08:38:21]: ▸ at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:51)
[08:38:21]: ▸ at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:64)
[08:38:21]: ▸ at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
[08:38:21]: ▸ at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
[08:38:21]: ▸ at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:440)
[08:38:21]: ▸ at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:436)
[08:38:21]: ▸ at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:394)
[08:38:21]: ▸ at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
[08:38:21]: ▸ at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
[08:38:21]: ▸ at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:128)
[08:38:21]: ▸ at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)
[08:38:21]: ▸ at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)
[08:38:21]: ▸ at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:58)
[08:38:21]: ▸ at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:52)
[08:38:21]: ▸ at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
[08:38:21]: ▸ at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[08:38:21]: ▸ at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[08:38:21]: ▸ at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[08:38:21]: ▸ at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[08:38:21]: ▸ at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
[08:38:21]: ▸ at com.sun.proxy.$Proxy0.execute(Unknown Source)
[08:38:21]: ▸ at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
[08:38:21]: ▸ at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
[08:38:21]: ▸ at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
[08:38:21]: ▸ at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
[08:38:21]: ▸ at org.sonarsource.scanner.cli.Main.main(Main.java:61)
[08:38:21]: ▸ Caused by: java.io.IOException: Cannot run program "/Users/distiller/project/.scannerwork/.sonartmp/13016760168792296293/subprocess" (in directory "/Users/distiller/project/app-ios/Model\&DataFetching/WKTString.m"): error=2, No such file or directory
[08:38:21]: ▸ at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
[08:38:21]: ▸ at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
[08:38:21]: ▸ at com.sonar.cpp.driver.ProcessExecutor.execute(ProcessExecutor.java:58)
[08:38:21]: ▸ ... 39 more
[08:38:21]: ▸ Caused by: java.io.IOException: error=2, No such file or directory
[08:38:21]: ▸ at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
[08:38:21]: ▸ at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:340)
[08:38:21]: ▸ at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:271)
[08:38:21]: ▸ at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
[08:38:21]: ▸ ... 41 more

Welcome to the @Brian_Doyle,

There is a very unusual line in the error, where it suggest that the scanner is trying to run a program from file (not directory):

(in directory "/Users/distiller/project/app-ios/Model\&DataFetching/WKTString.m")

In addition, would it be possible to share the debug analysis log (with -X option) and the compilation database file that is used (/Users/distiller/project/compile_commands.json)? If you think this file contains private information, let us know, and we’ll send you a private message that will allow you to send it privately.

I was able to trigger a very similar error, by creating a malformed compilation database, where both directory and file properties are pointing to a source file. Is this also the case for your project and one of the entries has directory set to "/Users/distiller/project/app-ios/Model\&DataFetching/WKTString.m"?

would it be possible to share the debug analysis log (with -X option) and the compilation database file that is used ( /Users/distiller/project/compile_commands.json )?

Hello Tomasz, just to clarify a few things since I’m not a CI Engineer, just a guy who has to try and fix this issue so I need more context.

  • Do I pass that -X option from where we can SonarCloud in the Fastfile?
  • And the debug analysis log, I will see this in the console when running on the CI or this is a file that should be found somewhere?
  • You want to see the contents of this file: Users/distiller/project/compile_commands.json ?

Thanks
Brian

I was able to trigger a very similar error, by creating a malformed compilation database, where both directory and file properties are pointing to a source file. Is this also the case for your project and one of the entries has directory set to "/Users/distiller/project/app-ios/Model\&DataFetching/WKTString.m" ?

  • Where can I check this for you? Where would I find where these paths are set?

Thank you again Tomasz.

Hi,

For the path to the compilation database, I found it in the log you have attached. This is set by the sonar.cfamily.compile-commands property either in the properties file (/Users/distiller/project/sonar-project.properties according to log) or passed to sonar-scanner invocation.

[08:38:16]: ▸ INFO: Using compile commands: /Users/distiller/project/compile_commands.json

And having the content of this file would be helpful. I can send you a PM, where you will be able to share it privately.

For the debug logs, they will be written to the output (same place as logs you have attached) and the -X flags need to be passed as an argument of the sonar-scanner invocation.