The Issue
We are encountering this exception when running analysis on our Swift project. We have files that utilize Swift 6-specific syntax that I understand is not currently supported. However, we just updated to the latest version of SonarQube in the hopes that the recent change to make Swift 6 parsing more lenient would solve our problems. It did prevent the scanner from crashing when it encounters Swift 6 syntax, but now we’re running into this new issue, and we’re not sure if it’s Swift 6 related or not.
I’ve been able to verify that we do not run into this issue when we run analysis on a much older version of our project that does not include any Swift 6 syntax. Though, there may be other things that are different with that older version of the project apart from the Swift 6 syntax, so I can’t confirm that it’s a Swift 6 issue.
We’ve also tried adding analysis exclusion rules for each file that contains Swift 6 syntax, but we still encounter this error.
Let me know if there’s any further information I can provide, or if there are any useful debugging steps we should take next.
Thanks!
17:42:45.873 ERROR Error during SonarScanner Engine execution
java.lang.NullPointerException: null
at java.base/java.io.File.<init>(Unknown Source)
at org.sonar.api.batch.fs.internal.predicates.AbsolutePathPredicate.get(AbsolutePathPredicate.java:51)
at org.sonar.api.batch.fs.internal.predicates.AndPredicate.get(AndPredicate.java:85)
at org.sonar.api.batch.fs.internal.DefaultFileSystem.inputFiles(DefaultFileSystem.java:140)
at org.sonar.scanner.scan.filesystem.MutableFileSystem.inputFiles(MutableFileSystem.java:45)
at org.sonar.api.batch.fs.internal.DefaultFileSystem.inputFile(DefaultFileSystem.java:110)
at org.sonar.scanner.scan.filesystem.MutableFileSystem.inputFile(MutableFileSystem.java:53)
at com.sonar.swift.plugin.B.A(Unknown Source)
at com.sonar.swift.plugin.B.A(Unknown Source)
at com.sonar.swift.plugin.E.A(Unknown Source)
at com.sonar.swift.plugin.E.execute(Unknown Source)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:61)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:79)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:61)
at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:227)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:206)
at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:212)
at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:208)
at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:178)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:227)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:206)
at org.sonar.scanner.bootstrap.SpringScannerContainer.doAfterStart(SpringScannerContainer.java:339)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:227)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:206)
at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:142)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:227)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:206)
at org.sonar.scanner.bootstrap.ScannerMain.runScannerEngine(ScannerMain.java:151)
at org.sonar.scanner.bootstrap.ScannerMain.run(ScannerMain.java:66)
at org.sonar.scanner.bootstrap.ScannerMain.main(ScannerMain.java:52)
Thank you for the detailed report and stack trace. You’re correct that the update to SonarQube did make the Swift 6 parser more lenient, but it’s clear there is still an issue.
As a first step, I would suggest you get more detailed logs to pinpoint exactly which file or step is failing.
You can do this by adding -X to your sonar-scanner command, or setting the following analysis parameter: sonar.verbose=true
This will produce a lot of output, but you should specifically look for lines immediately before the crash or ones mentioning files about to be analyzed.
If there is one specific file, it would be great if you could provide it here.
This is the output close to the exception with sonar.verbose=true (with some things redacted/renamed):
2025-05-06T19:50:38.8705850Z 15:50:38.870 INFO 327 files indexed
2025-05-06T19:50:38.8765770Z 15:50:38.876 INFO Quality profile for c: Sonar way
2025-05-06T19:50:38.8766260Z 15:50:38.876 INFO Quality profile for swift: ProjectName Custom Swift Profile
2025-05-06T19:50:38.8766730Z 15:50:38.876 INFO Quality profile for xml: Sonar way
2025-05-06T19:50:38.8767260Z 15:50:38.876 INFO ------------- Run sensors on module MyProject
2025-05-06T19:50:38.9545180Z 15:50:38.954 INFO Load metrics repository
2025-05-06T19:50:38.9590800Z 15:50:38.958 DEBUG --> GET https://mysonarqubeserver.azurewebsites.net/api/metrics/search?ps=500&p=1
2025-05-06T19:50:38.9985200Z 15:50:38.998 DEBUG <-- 200 OK https://mysonarqubeserver.azurewebsites.net/api/metrics/search?ps=500&p=1 (39ms, unknown-length body)
2025-05-06T19:50:39.0089900Z 15:50:39.008 INFO Load metrics repository (done) | time=54ms
2025-05-06T19:50:39.6334090Z 15:50:39.633 DEBUG 'Import external issues report' skipped because of missing configuration requirements.
2025-05-06T19:50:39.6334770Z Accessed configuration:
2025-05-06T19:50:39.6335060Z - sonar.externalIssuesReportPaths: <empty>
2025-05-06T19:50:39.6369950Z 15:50:39.636 DEBUG 'IaC Ansible Sensor' skipped because there is no related file in current project
2025-05-06T19:50:39.6383930Z 15:50:39.638 DEBUG 'IaC Terraform Sensor' skipped because there is no related file in current project
2025-05-06T19:50:39.6388610Z 15:50:39.638 DEBUG 'IaC CloudFormation Sensor' skipped because there is no related file in current project
2025-05-06T19:50:39.6390280Z 15:50:39.638 DEBUG 'IaC Kubernetes Sensor' skipped because there is no related file in current project
2025-05-06T19:50:39.6391790Z 15:50:39.639 DEBUG 'IaC AzureResourceManager Sensor' skipped because there is no related file in current project
2025-05-06T19:50:39.6407480Z 15:50:39.639 DEBUG 'Import of SwiftLint issues' skipped because of missing configuration requirements.
2025-05-06T19:50:39.6408120Z Accessed configuration:
2025-05-06T19:50:39.6408410Z - sonar.swift.swiftLint.reportPaths: <empty>
2025-05-06T19:50:39.6408760Z - sonar.externalIssuesReportPaths: <empty>
2025-05-06T19:50:39.6414200Z 15:50:39.641 DEBUG 'Generic Test Executions Report' skipped because of missing configuration requirements.
2025-05-06T19:50:39.6414790Z Accessed configuration:
2025-05-06T19:50:39.6415070Z - sonar.swift.swiftLint.reportPaths: <empty>
2025-05-06T19:50:39.6415420Z - sonar.testExecutionReportPaths: <empty>
2025-05-06T19:50:39.6415750Z - sonar.externalIssuesReportPaths: <empty>
2025-05-06T19:50:39.6417390Z 15:50:39.641 DEBUG Sensors : XML Sensor -> JaCoCo XML Report Importer -> Java Config Sensor -> Swift Code Quality and Security -> IaC Docker Sensor -> CFamily -> DeveloperTextAndSecretsSensor
2025-05-06T19:50:39.6434810Z 15:50:39.643 INFO Sensor XML Sensor [xml]
2025-05-06T19:50:39.6567460Z 15:50:39.656 INFO 2 source files to be analyzed
2025-05-06T19:50:39.7295440Z 15:50:39.729 DEBUG 'sonarqube-generic-coverage.xml' generated metadata with charset 'UTF-8'
2025-05-06T19:50:39.9962870Z 15:50:39.995 DEBUG Count lines in file:///Users/administrator/agent/_work/10/s/sonarqube-generic-coverage.xml
2025-05-06T19:50:40.5895890Z 15:50:40.589 DEBUG 'cobertura.xml' generated metadata with charset 'UTF-8'
2025-05-06T19:50:40.8336740Z 15:50:40.833 DEBUG Count lines in file:///Users/administrator/agent/_work/10/s/cobertura.xml
2025-05-06T19:50:41.2820190Z 15:50:41.281 INFO 2/2 source files have been analyzed
2025-05-06T19:50:41.2829770Z 15:50:41.282 INFO Sensor XML Sensor [xml] (done) | time=1639ms
2025-05-06T19:50:41.2833950Z 15:50:41.283 INFO Sensor JaCoCo XML Report Importer [jacoco]
2025-05-06T19:50:41.2895990Z 15:50:41.289 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
2025-05-06T19:50:41.2914990Z 15:50:41.291 INFO No report imported, no coverage information will be imported by JaCoCo XML Report Importer
2025-05-06T19:50:41.2915740Z 15:50:41.291 INFO Sensor JaCoCo XML Report Importer [jacoco] (done) | time=8ms
2025-05-06T19:50:41.2916210Z 15:50:41.291 INFO Sensor Java Config Sensor [iac]
2025-05-06T19:50:41.3237740Z 15:50:41.323 INFO 0 source files to be analyzed
2025-05-06T19:50:41.3238390Z 15:50:41.323 INFO 0/0 source files have been analyzed
2025-05-06T19:50:41.3242260Z 15:50:41.324 INFO Sensor Java Config Sensor [iac] (done) | time=32ms
2025-05-06T19:50:41.3242800Z 15:50:41.324 INFO Sensor Swift Code Quality and Security [swift]
2025-05-06T19:50:41.3293000Z 15:50:41.329 INFO 60 source files to be analyzed
2025-05-06T19:50:41.8941650Z 15:50:41.893 DEBUG 'MyProject/Utility/BuildEnvironment.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:41.9895970Z 15:50:41.989 DEBUG Not enough content in 'MyProject/Utility/BuildEnvironment.swift' to have CPD blocks, it will not be part of the duplication detection
2025-05-06T19:50:41.9924040Z 15:50:41.992 DEBUG 'MyProject/Audio Recording/AudioSession.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:42.0502410Z 15:50:42.049 DEBUG Not enough content in 'MyProject/Audio Recording/AudioSession.swift' to have CPD blocks, it will not be part of the duplication detection
2025-05-06T19:50:42.0513080Z 15:50:42.051 DEBUG 'MyProject/Networking/NSMutableURLRequest+Convenience.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:42.1329070Z 15:50:42.132 DEBUG 'MyProject/Networking/WebService/WebService+Authentication.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:42.1858070Z 15:50:42.185 DEBUG 'MyProject/Audio Recording/AudioFileURLUtilities.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:42.2279180Z 15:50:42.227 DEBUG 'MyProject/Networking/Session Managers/URLSessionManager.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:42.4619150Z 15:50:42.461 DEBUG 'MyProject/Networking/URLSession+Utility.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:42.4885600Z 15:50:42.488 DEBUG Not enough content in 'MyProject/Networking/URLSession+Utility.swift' to have CPD blocks, it will not be part of the duplication detection
2025-05-06T19:50:42.4893840Z 15:50:42.489 DEBUG 'MyProject/Networking/Reachability/ReachabilityStatus.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:42.5343410Z 15:50:42.533 DEBUG 'MyProject/Networking/WebService/WebService+LogsUpload.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:42.5987620Z 15:50:42.598 DEBUG 'MyProject/Audio Recording/AudioSessionInterruptionNotificationData.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:42.6872100Z 15:50:42.686 DEBUG 'MyProject/Persistence/UserDefaults+MyFramework.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:42.8415060Z 15:50:42.841 DEBUG 'MyProject/Utility/Constants/Constants+Analytics.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:42.8749450Z 15:50:42.874 DEBUG Not enough content in 'MyProject/Utility/Constants/Constants+Analytics.swift' to have CPD blocks, it will not be part of the duplication detection
2025-05-06T19:50:42.8810180Z 15:50:42.880 DEBUG 'MyProject/Utility/Logging/Logging.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:42.9509360Z 15:50:42.950 DEBUG 'MyProject/Utility/Analytics/Events.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.0056830Z 15:50:43.005 DEBUG 'MyProject/Networking/WebService/WebService+JobUpload.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.1339790Z 15:50:43.133 DEBUG 'MyProject/Utility/Logging/FileLogger.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.2666420Z 15:50:43.266 DEBUG 'MyProject/Utility/Logging/LogsUploader.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.3420730Z 15:50:43.341 DEBUG 'MyProject/Networking/Reachability/ReachabilityMonitor.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.3745010Z 15:50:43.374 DEBUG 'MyProject/Networking/NetworkRequestLogger.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.4751370Z 15:50:43.474 DEBUG 'MyProject/Audio Recording/AudioRecorder.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.5493630Z 15:50:43.548 DEBUG 'MyProject/Networking/WebService/WebService.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.5936430Z 15:50:43.593 DEBUG 'MyProject/Audio Recording/MicPermissionRequester.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.6036880Z 15:50:43.603 DEBUG 'MyProject/Persistence/PersistableAIJob.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.6169970Z 15:50:43.616 DEBUG 'MyProject/Persistence/Encryption.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.6531620Z 15:50:43.652 DEBUG 'MyProject/MyFramework.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.7561450Z 15:50:43.755 DEBUG 'MyProject/Utility/Constants/Constants+WebKeys.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.7902910Z 15:50:43.789 DEBUG 'MyProject/Utility/Bundle+Utilities.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.8049100Z 15:50:43.804 DEBUG 'MyProject/Audio Recording/AudioFileMerger.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.8477280Z 15:50:43.847 DEBUG 'MyProject/Utility/Logging/LogsDataURLUtilities.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.8599310Z 15:50:43.859 DEBUG Not enough content in 'MyProject/Utility/Logging/LogsDataURLUtilities.swift' to have CPD blocks, it will not be part of the duplication detection
2025-05-06T19:50:43.8600640Z 15:50:43.859 DEBUG 'MyProject/Networking/NetworkError.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.8728720Z 15:50:43.872 DEBUG 'MyProject/Persistence/FileManager+Utilities.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.9056270Z 15:50:43.905 DEBUG 'MyProject/Persistence/Keychain.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.9449680Z 15:50:43.944 DEBUG 'MyProject/Utility/Logging/LogsAutoUploadManager.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.9518630Z 15:50:43.951 DEBUG Not enough content in 'MyProject/Utility/Logging/LogsAutoUploadManager.swift' to have CPD blocks, it will not be part of the duplication detection
2025-05-06T19:50:43.9520070Z 15:50:43.951 DEBUG 'MyProject/Audio Recording/AudioFormat.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.9559890Z 15:50:43.955 DEBUG 'MyProject/Utility/Task+Sleep.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.9588650Z 15:50:43.958 DEBUG Not enough content in 'MyProject/Utility/Task+Sleep.swift' to have CPD blocks, it will not be part of the duplication detection
2025-05-06T19:50:43.9593060Z 15:50:43.959 DEBUG 'MyProject/Utility/Constants/Constants+UserDefaults.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.9639430Z 15:50:43.963 DEBUG Not enough content in 'MyProject/Utility/Constants/Constants+UserDefaults.swift' to have CPD blocks, it will not be part of the duplication detection
2025-05-06T19:50:43.9640890Z 15:50:43.963 DEBUG 'MyProject/Utility/UIDevice+Utilities.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.9728720Z 15:50:43.972 DEBUG 'MyProject/Utility/Optional+Interpolation.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.9768510Z 15:50:43.976 DEBUG Not enough content in 'MyProject/Utility/Optional+Interpolation.swift' to have CPD blocks, it will not be part of the duplication detection
2025-05-06T19:50:43.9769820Z 15:50:43.976 DEBUG 'MyProject/Networking/Reachability/NetworkPath.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.9882350Z 15:50:43.988 DEBUG 'MyProject/Utility/Constants/Constants+ServerEnvironment.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:43.9979140Z 15:50:43.997 DEBUG Not enough content in 'MyProject/Utility/Constants/Constants+ServerEnvironment.swift' to have CPD blocks, it will not be part of the duplication detection
2025-05-06T19:50:43.9985840Z 15:50:43.998 DEBUG 'MyProject/Utility/Constants/Constants.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.0015330Z 15:50:44.001 DEBUG 'MyProject/Networking/HTTPMethod.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.0059230Z 15:50:44.005 DEBUG 'MyProject/Networking/URLConvertible.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.0120810Z 15:50:44.011 DEBUG 'MyProject/Utility/BackgroundTask/BackgroundTask.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.0216900Z 15:50:44.021 DEBUG 'MyProject/Utility/RecordingOrderIndexUtility.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.0269320Z 15:50:44.026 DEBUG 'MyProject/PatientMetadata.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.0349540Z 15:50:44.034 DEBUG 'MyProject/Utility/Constants/Constants+URLProtocol.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.0382340Z 15:50:44.038 DEBUG Not enough content in 'MyProject/Utility/Constants/Constants+URLProtocol.swift' to have CPD blocks, it will not be part of the duplication detection
2025-05-06T19:50:44.0388890Z 15:50:44.038 DEBUG 'MyProject/Utility/Data+Utilities.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.0456190Z 15:50:44.045 DEBUG 'MyProject/Utility/Date+Formatting.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.0609580Z 15:50:44.060 DEBUG 'MyProject/SessionManager.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.0934380Z 15:50:44.093 DEBUG 'MyProject/Networking/NetworkResponse.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.0975900Z 15:50:44.097 DEBUG Not enough content in 'MyProject/Networking/NetworkResponse.swift' to have CPD blocks, it will not be part of the duplication detection
2025-05-06T19:50:44.0978560Z 15:50:44.097 DEBUG 'MyProject/Networking/ExponentialBackoffUploadable.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.1050870Z 15:50:44.104 DEBUG 'MyProject/Utility/Constants/Constants+WebPaths.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.1097100Z 15:50:44.109 DEBUG 'MyProject/Utility/Logging/AppStateChangeLogger.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.1248260Z 15:50:44.124 DEBUG 'MyProject/InternalUploadState.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.1391320Z 15:50:44.138 DEBUG 'MyProject/Networking/ServerEnvironment.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.1521110Z 15:50:44.151 DEBUG 'MyProject/Utility/AtomicCounter.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.1575960Z 15:50:44.157 DEBUG Not enough content in 'MyProject/Utility/AtomicCounter.swift' to have CPD blocks, it will not be part of the duplication detection
2025-05-06T19:50:44.1578700Z 15:50:44.157 DEBUG 'MyProject/Networking/AuthenticationState.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.1600860Z 15:50:44.159 DEBUG Not enough content in 'MyProject/Networking/AuthenticationState.swift' to have CPD blocks, it will not be part of the duplication detection
2025-05-06T19:50:44.1602780Z 15:50:44.160 DEBUG 'MyProject/Networking/WebService/WebService+DefaultHeaders.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.1685210Z 15:50:44.168 DEBUG 'MyProject/Networking/Session Managers/BackgroundURLSessionManager.swift' generated metadata with charset 'UTF-8'
2025-05-06T19:50:44.1904290Z 15:50:44.190 INFO 60/60 source files have been analyzed
2025-05-06T19:50:44.1952660Z 15:50:44.195 INFO Parse coverage report (sonarqube-generic-coverage.xml)
2025-05-06T19:50:44.2396190Z ##[error]15:50:44.233 ERROR Error during SonarScanner Engine execution
java.lang.NullPointerException: null
at java.base/java.io.File.<init>(Unknown Source)
at org.sonar.api.batch.fs.internal.predicates.AbsolutePathPredicate.get(AbsolutePathPredicate.java:51)
at org.sonar.api.batch.fs.internal.predicates.AndPredicate.get(AndPredicate.java:85)
at org.sonar.api.batch.fs.internal.DefaultFileSystem.inputFiles(DefaultFileSystem.java:140)
at org.sonar.scanner.scan.filesystem.MutableFileSystem.inputFiles(MutableFileSystem.java:45)
at org.sonar.api.batch.fs.internal.DefaultFileSystem.inputFile(DefaultFileSystem.java:110)
at org.sonar.scanner.scan.filesystem.MutableFileSystem.inputFile(MutableFileSystem.java:53)
at com.sonar.swift.plugin.B.A(Unknown Source)
at com.sonar.swift.plugin.B.A(Unknown Source)
at com.sonar.swift.plugin.E.A(Unknown Source)
at com.sonar.swift.plugin.E.execute(Unknown Source)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:61)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:79)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:61)
at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:227)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:206)
at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:212)
at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:208)
at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:178)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:227)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:206)
at org.sonar.scanner.bootstrap.SpringScannerContainer.doAfterStart(SpringScannerContainer.java:339)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:227)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:206)
at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:142)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:227)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:206)
at org.sonar.scanner.bootstrap.ScannerMain.runScannerEngine(ScannerMain.java:151)
at org.sonar.scanner.bootstrap.ScannerMain.run(ScannerMain.java:66)
at org.sonar.scanner.bootstrap.ScannerMain.main(ScannerMain.java:52)
2025-05-06T19:50:44.2413950Z 15:50:44.233 ERROR Error during SonarScanner Engine execution
2025-05-06T19:50:44.2414360Z java.lang.NullPointerException: null
2025-05-06T19:50:44.2414670Z at java.base/java.io.File.<init>(Unknown Source)
2025-05-06T19:50:44.2415260Z at org.sonar.api.batch.fs.internal.predicates.AbsolutePathPredicate.get(AbsolutePathPredicate.java:51)
2025-05-06T19:50:44.2416290Z at org.sonar.api.batch.fs.internal.predicates.AndPredicate.get(AndPredicate.java:85)
2025-05-06T19:50:44.2417150Z at org.sonar.api.batch.fs.internal.DefaultFileSystem.inputFiles(DefaultFileSystem.java:140)
2025-05-06T19:50:44.2417860Z at org.sonar.scanner.scan.filesystem.MutableFileSystem.inputFiles(MutableFileSystem.java:45)
2025-05-06T19:50:44.2418530Z at org.sonar.api.batch.fs.internal.DefaultFileSystem.inputFile(DefaultFileSystem.java:110)
2025-05-06T19:50:44.2419260Z at org.sonar.scanner.scan.filesystem.MutableFileSystem.inputFile(MutableFileSystem.java:53)
2025-05-06T19:50:44.2419870Z at com.sonar.swift.plugin.B.A(Unknown Source)
2025-05-06T19:50:44.2420200Z at com.sonar.swift.plugin.B.A(Unknown Source)
2025-05-06T19:50:44.2420570Z at com.sonar.swift.plugin.E.A(Unknown Source)
2025-05-06T19:50:44.2420920Z at com.sonar.swift.plugin.E.execute(Unknown Source)
2025-05-06T19:50:44.2421400Z at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
2025-05-06T19:50:44.2422030Z at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
2025-05-06T19:50:44.2422710Z at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:61)
2025-05-06T19:50:44.2430580Z at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:79)
2025-05-06T19:50:44.2431340Z at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:61)
2025-05-06T19:50:44.2432010Z at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:82)
2025-05-06T19:50:44.2432750Z at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:227)
2025-05-06T19:50:44.2433480Z at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:206)
2025-05-06T19:50:44.2434260Z at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:212)
2025-05-06T19:50:44.2434980Z at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:208)
2025-05-06T19:50:44.2435720Z at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:178)
2025-05-06T19:50:44.2436470Z at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:227)
2025-05-06T19:50:44.2437170Z at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:206)
2025-05-06T19:50:44.2437940Z at org.sonar.scanner.bootstrap.SpringScannerContainer.doAfterStart(SpringScannerContainer.java:339)
2025-05-06T19:50:44.2438670Z at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:227)
2025-05-06T19:50:44.2439380Z at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:206)
2025-05-06T19:50:44.2440060Z at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:142)
2025-05-06T19:50:44.2440870Z at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:227)
2025-05-06T19:50:44.2441580Z at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:206)
2025-05-06T19:50:44.2442210Z at org.sonar.scanner.bootstrap.ScannerMain.runScannerEngine(ScannerMain.java:151)
2025-05-06T19:50:44.2442740Z at org.sonar.scanner.bootstrap.ScannerMain.run(ScannerMain.java:66)
2025-05-06T19:50:44.2443200Z at org.sonar.scanner.bootstrap.ScannerMain.main(ScannerMain.java:52)
2025-05-06T19:50:44.2443730Z
2025-05-06T19:50:44.2444250Z 15:50:44.237 DEBUG Cleanup org.eclipse.jgit.util.FS$FileStoreAttributes$$Lambda$387/0x00000008004277d8@20f6f88c during JVM shutdown
2025-05-06T19:50:44.3778430Z 15:50:44.377 DEBUG Java command exited with code 1
2025-05-06T19:50:44.3779000Z 15:50:44.377 INFO EXECUTION FAILURE
2025-05-06T19:50:44.3782880Z 15:50:44.378 INFO Total time: 16.375s
2025-05-06T19:50:44.3966620Z ##[error][ERROR] SonarQube Server: Error while executing task Analyze: The process '/Users/administrator/agent/_work/_tasks/SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055/7.3.0/sonar-scanner/bin/sonar-scanner' failed with exit code 3
2025-05-06T19:50:44.3972630Z ##[error]The process '/Users/administrator/agent/_work/_tasks/SonarQubeAnalyze_6d01813a-9589-4b15-8491-8164aeb38055/7.3.0/sonar-scanner/bin/sonar-scanner' failed with exit code 3
2025-05-06T19:50:44.4023290Z ##[section]Finishing: Run Code Analysis
To follow up on this public post, the issue ended up being that SonarQube was failing to parse the code coverage file our project was generating using Slather. The coverage file included coverage for Swift package dependencies located in Derived Data. The scanner had issues with this for some reason.
I was able to resolve it by excluding coverage data from the generated coverage file for Swift package files by adding this to my .slather.yml file: