Please provide
- Operating system: MacOS Sonoma 14.2.1
- SonarLint plugin version: v4.4.1
- Programming language you’re coding in: typescript
- Is connected mode used: Connected to SonarQube: v10.4.1
And a thorough description of the problem / question:
I’m posting this topic after a lot of research over the last week or so. The problem comes from the connected mode. The connection is successful and I connect correctly to my project.
The connected doesn’t recognize any file for any language. Even when activating the sonar.language=ts property, the same error occurs: Cannot invoke "org.sonarsource.sonarlint.core.commons.api.SonarLanguage.name()" because "language" is null
.
This error could be due to the fact that no specific language is detected after parsing all the files, but no file is detected.
I haven’t found an answer on the forum… I’ll leave the complete error below this post, thanks in advance!
[Debug - 13:54:23.867] * kubernetes: 15 active rules
[Debug - 13:54:23.870] * css: 24 active rules
[Debug - 13:54:23.870] * go: 25 active rules
[Debug - 13:54:23.871] * js: 303 active rules
[Debug - 13:54:23.880] * py: 226 active rules
[Debug - 13:54:23.887] * secrets: 60 active rules
[Debug - 13:54:23.887] * docker: 32 active rules
[Debug - 13:54:23.888] * cs: 293 active rules
[Debug - 13:54:23.891] * java: 498 active rules
[Debug - 13:54:23.898] * web: 29 active rules
[Debug - 13:54:23.898] * xml: 24 active rules
[Debug - 13:54:23.898] * json: 0 active rules
[Debug - 13:54:23.898] * php: 179 active rules
[Debug - 13:54:23.928] * terraform: 49 active rules
[Debug - 13:54:23.930] * azureresourcemanager: 18 active rules
[Debug - 13:54:23.930] * cloudformation: 26 active rules
[Debug - 13:54:23.933] * ts: 304 active rules
[Debug - 13:54:23.935] * yaml: 0 active rules
[Debug - 13:54:24.003] Start analysis
[Info - 13:54:24.037] Index files
[Info - 13:54:24.039] 1 file indexed
[Debug - 13:54:24.142] Added 304 checks for language='ts', repository='typescript'
[Debug - 13:54:24.144] Added 303 checks for language='js', repository='javascript'
[Debug - 13:54:24.152] 'JavaSensor' skipped because there is no related files in the current project
[Debug - 13:54:24.153] 'Python Sensor' skipped because there is no related files in the current project
[Debug - 13:54:24.153] 'IPython Notebooks Sensor' skipped because there is no related files in the current project
[Debug - 13:54:24.153] 'OmniSharp' skipped because there is no related files in the current project
[Debug - 13:54:24.153] Execute Sensor: HTML
[Debug - 13:54:24.153] 'XML Sensor' skipped because there is no related files in the current project
[Debug - 13:54:24.153] 'Code Quality and Security for Go' skipped because there is no related files in the current project
[Debug - 13:54:24.153] 'PHP sensor' skipped because there is no related files in the current project
[Debug - 13:54:24.153] 'Analyzer for "php.ini" files' skipped because there is no related files in the current project
[Debug - 13:54:24.153] 'IaC Terraform Sensor' skipped because there is no related files in the current project
[Debug - 13:54:24.153] 'IaC CloudFormation Sensor' skipped because there is no related files in the current project
[Debug - 13:54:24.153] 'IaC Kubernetes Sensor' skipped because there is no related files in the current project
[Debug - 13:54:24.153] 'IaC AzureResourceManager Sensor' skipped because there is no related files in the current project
[Debug - 13:54:24.153] Execute Sensor: TextAndSecretsSensor
[Info - 13:54:24.190] 1 source file to be analyzed
[Debug - 13:54:24.207] Initializing metadata of file file:///Users/corentin.blairy/Workspace/beweb/immoIA/frontend-immoia/sonar-project.properties
[Info - 13:54:24.213] 1/1 source file has been analyzed
[Debug - 13:54:24.214] 'JavaScript/TypeScript analysis' skipped because there is no related files in the current project
[Debug - 13:54:24.214] 'JavaScript inside YAML analysis' skipped because there is no related files in the current project
[Debug - 13:54:24.214] 'JavaScript inside HTML analysis' skipped because there is no related files in the current project
[Debug - 13:54:24.214] Execute Sensor: CSS Rules
[Info - 13:54:24.214] No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
[Debug - 13:54:24.214] Execute Sensor: IaC Docker Sensor
[Info - 13:54:24.214] 0 source files to be analyzed
[Info - 13:54:24.222] 0/0 source files have been analyzed
[Debug - 13:54:24.223] 'CFamily' skipped because there is no related files in the current project
[Error - 13:54:24.227] Analysis failed
java.lang.NullPointerException: Cannot invoke "org.sonarsource.sonarlint.core.commons.api.SonarLanguage.name()" because "language" is null
at org.sonarsource.sonarlint.ls.telemetry.SonarLintTelemetry.analysisDoneOnSingleLanguage(SonarLintTelemetry.java:76)
at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.analyzeSingleModuleNonExcluded(AnalysisTaskExecutor.java:366)
at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.analyzeSingleModule(AnalysisTaskExecutor.java:314)
at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.analyze(AnalysisTaskExecutor.java:232)
at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.analyze(AnalysisTaskExecutor.java:197)
at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.lambda$analyze$2(AnalysisTaskExecutor.java:165)
at java.base/java.util.HashMap.forEach(Unknown Source)
at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.analyze(AnalysisTaskExecutor.java:165)
at org.sonarsource.sonarlint.ls.AnalysisTaskExecutor.run(AnalysisTaskExecutor.java:137)
at org.sonarsource.sonarlint.ls.AnalysisScheduler.lambda$analyzeAsync$1(AnalysisScheduler.java:261)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)