java.lang.IllegalArgumentException: Overlapping symbol declaration and reference for symbol at Range

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube: 9.6 developer edition
    Scanner: sonar-scanner-4.7.0.2747 / 4.5.0.2216
    JavaScript/TypeScript/CSS Code Quality and Security 9.6.0.18814 (javascript)
    Node version: v14.19.0

  • what are you trying to achieve
    Running sonar-scanner on a ruby/javascript project. We’re getting the following error during analysing the project in the javascript sensor:

09:39:48.541 ERROR: Failure during analysis, Node.js command to start eslint-bridge was: node /test-sq/.scannerwork/.sonartmp/eslint-bridge-bundle/package/bin/server 2500 127.0.0.1 /test-sq/.scannerwork true false /test-sq/.scannerwork/.sonartmp/eslint-bridge-bundle/package/custom-rules15729812068032404288/package
java.lang.IllegalArgumentException: Overlapping symbol declaration and reference for symbol at Range[from [line=50, lineOffset=13] to [line=50, lineOffset=52]]
        at org.sonar.api.utils.Preconditions.checkArgument(Preconditions.java:43)
        at org.sonar.api.batch.sensor.symbol.internal.DefaultSymbolTable$DefaultSymbol.newReference(DefaultSymbolTable.java:110)
        at org.sonar.api.batch.sensor.symbol.internal.DefaultSymbolTable$DefaultSymbol.newReference(DefaultSymbolTable.java:104)
        at org.sonar.plugins.javascript.eslint.AnalysisProcessor.saveHighlightedSymbols(AnalysisProcessor.java:163)
        at org.sonar.plugins.javascript.eslint.AnalysisProcessor.processResponse(AnalysisProcessor.java:96)
        at org.sonar.plugins.javascript.eslint.JavaScriptEslintBasedSensor.analyze(JavaScriptEslintBasedSensor.java:109)
        at org.sonar.plugins.javascript.eslint.JavaScriptEslintBasedSensor.runEslintAnalysis(JavaScriptEslintBasedSensor.java:88)
        at org.sonar.plugins.javascript.eslint.JavaScriptEslintBasedSensor.analyzeFiles(JavaScriptEslintBasedSensor.java:62)
        at org.sonar.plugins.javascript.eslint.AbstractEslintSensor.execute(AbstractEslintSensor.java:67)
        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:81)
        at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
        at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
        at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:396)
        at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:392)
        at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:361)
        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:135)
        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.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
        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.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
        at com.sun.proxy.$Proxy0.execute(Unknown Source)
        at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
        at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
        at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
        at org.sonarsource.scanner.cli.Main.main(Main.java:61)

The error message is unfortunately not very helpful since it’s not really telling us what/where we should be looking for problems. Can anybody help/steer us in the right direction?

Thanks

Hey there!

Can you please run the scanner in DEBUG mode (sonar-scanner -X) and check while file was being analyzed when this error was thrown (and, ideally, provide us the file)?

Hi Colin,

I cannot really tell which file is being analyzed by running in DEBUG mode.

See:

09:39:48.005 DEBUG: Saving issue for rule semi on line 1
09:39:48.026 DEBUG: Not enough content in 'frontend/app/components/molecules/DraggableList/index.js' to have CPD blocks, it will not be part of the duplication detection
09:39:48.087 DEBUG: Saving issue for rule semi on line 1
09:39:48.093 DEBUG: Saving issue for rule semi on line 2
09:39:48.099 DEBUG: Saving issue for rule semi on line 3
09:39:48.105 DEBUG: Saving issue for rule semi on line 6
09:39:48.112 DEBUG: Saving issue for rule semi on line 9
09:39:48.119 DEBUG: Saving issue for rule semi on line 11
09:39:48.127 DEBUG: Saving issue for rule semi on line 15
09:39:48.133 DEBUG: Saving issue for rule semi on line 16
09:39:48.233 DEBUG: Saving issue for rule semi on line 1
09:39:48.236 DEBUG: Saving issue for rule semi on line 2
09:39:48.241 DEBUG: Saving issue for rule semi on line 3
09:39:48.247 DEBUG: Saving issue for rule semi on line 4
09:39:48.253 DEBUG: Saving issue for rule semi on line 5
09:39:48.259 DEBUG: Saving issue for rule semi on line 6
09:39:48.268 DEBUG: Saving issue for rule semi on line 7
09:39:48.275 DEBUG: Saving issue for rule semi on line 11
09:39:48.282 DEBUG: Saving issue for rule semi on line 12
09:39:48.288 DEBUG: Saving issue for rule semi on line 13
09:39:48.295 DEBUG: Saving issue for rule comma-dangle on line 17
09:39:48.300 DEBUG: Saving issue for rule semi on line 19
09:39:48.307 DEBUG: Saving issue for rule semi on line 20
09:39:48.315 DEBUG: Saving issue for rule semi on line 21
09:39:48.320 DEBUG: Saving issue for rule semi on line 22
09:39:48.327 DEBUG: Saving issue for rule semi on line 23
09:39:48.333 DEBUG: Saving issue for rule semi on line 24
09:39:48.340 DEBUG: Saving issue for rule semi on line 28
09:39:48.347 DEBUG: Saving issue for rule semi on line 30
09:39:48.353 DEBUG: Saving issue for rule semi on line 31
09:39:48.359 DEBUG: Saving issue for rule semi on line 34
09:39:48.365 DEBUG: Saving issue for rule semi on line 36
09:39:48.372 DEBUG: Saving issue for rule semi on line 39
09:39:48.378 DEBUG: Saving issue for rule semi on line 40
09:39:48.384 DEBUG: Saving issue for rule semi on line 41
09:39:48.392 DEBUG: Saving issue for rule semi on line 45
09:39:48.398 DEBUG: Saving issue for rule semi on line 46
09:39:48.405 DEBUG: Saving issue for rule semi on line 47
09:39:48.412 DEBUG: Saving issue for rule semi on line 48
09:39:48.419 DEBUG: Saving issue for rule semi on line 49
09:39:48.425 DEBUG: Saving issue for rule semi on line 51
09:39:48.432 DEBUG: Saving issue for rule semi on line 53
09:39:48.439 DEBUG: Saving issue for rule semi on line 55
09:39:48.445 DEBUG: Saving issue for rule semi on line 56
09:39:48.452 DEBUG: Saving issue for rule semi on line 59
09:39:48.458 DEBUG: Saving issue for rule semi on line 62
09:39:48.465 DEBUG: Saving issue for rule semi on line 65
09:39:48.473 DEBUG: Saving issue for rule semi on line 67
09:39:48.479 DEBUG: Saving issue for rule semi on line 68
09:39:48.487 DEBUG: Saving issue for rule semi on line 69
09:39:48.494 DEBUG: Saving issue for rule semi on line 70
09:39:48.501 DEBUG: Saving issue for rule semi on line 86
09:39:48.507 DEBUG: Saving issue for rule semi on line 87
09:39:48.513 DEBUG: Saving issue for rule comma-dangle on line 91
09:39:48.520 DEBUG: Saving issue for rule semi on line 92
09:39:48.541 ERROR: Failure during analysis, Node.js command to start eslint-bridge was: node /test-sq/.scannerwork/.sonartmp/eslint-bridge-bundle/package/bin/server 2500 127.0.0.1 /test-sq/.scannerwork true false /test-sq/.scannerwork/.sonartmp/eslint-bridge-bundle/package/custom-rules15729812068032404288/package
java.lang.IllegalArgumentException: Overlapping symbol declaration and reference for symbol at Range[from [line=50, lineOffset=13] to [line=50, lineOffset=52]]
        at org.sonar.api.utils.Preconditions.checkArgument(Preconditions.java:43)

The last mentioned file only has 1 LOC …

@StevenStorm its enough for me to hand it over to the experts for a closer look. thanks for your patience. :slight_smile:

Hi @StevenStorm,

can you please provide the code that is making the scanner raise the exception?

Thanks!

@victor.diez how would I find out which file this is? The error message doesn’t really point me towards a source file :frowning:

Hi @StevenStorm ,

can you provide the full logs, please? To solve the lack of information about this issue, we have opened a ticket to log further details during analysis.

Cheers,
Victor