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

Hello, im using sonarsource/sonarcloud-scan:2.0.0 and having an error.
This is my bitbutcket-pipeline

image: atlassian/default-image:3

definitions:
  caches:
    sonar: ~/.sonar/cache  # Caching SonarCloud artifacts will speed up your build
  services:
    docker:
      memory: 4096 
      type: docker
  steps:
    - step: &codeAnalysis
        name: Code Analysis
        services:
          - docker
        size: 2x
        image: node:latest
        clone:
          depth: full    # SonarCloud scanner needs the full history to assign issues properly
        caches: # Caching artifacts to speed up the buil
          - node
          - sonar
        script:
          - yarn install
          - pipe: sonarsource/sonarcloud-scan:2.0.0
            variables:
              SONAR_SCANNER_OPTS: -Xmx4096m
              EXTRA_ARGS: -Dsonar.javascript.node.maxspace=8192 -Dsonar.sourceEncoding=UTF-8
          - pipe: sonarsource/sonarcloud-quality-gate:0.1.6

pipelines:
  branches:
    develop:
      - step:
          <<: *codeAnalysis

Im getting the following error when try to do a code analysis

ERROR: Failure during analysis

java.lang.IllegalArgumentException: Overlapping symbol declaration and reference for symbol at Range[from [line=73, lineOffset=13] to [line=73, lineOffset=30]]

at org.sonar.api.utils.Preconditions.checkArgument(Preconditions.java:43)

at org.sonar.api.batch.sensor.symbol.internal.DefaultSymbolTable$DefaultSymbol.newReference(DefaultSymbolTable.java:96)

at org.sonar.api.batch.sensor.symbol.internal.DefaultSymbolTable$DefaultSymbol.newReference(DefaultSymbolTable.java:90)

at org.sonar.plugins.javascript.bridge.AnalysisProcessor.saveHighlightedSymbols(AnalysisProcessor.java:218)

at org.sonar.plugins.javascript.bridge.AnalysisProcessor.processResponse(AnalysisProcessor.java:118)

at org.sonar.plugins.javascript.bridge.AnalysisWithProgram.analyze(AnalysisWithProgram.java:179)

at org.sonar.plugins.javascript.bridge.AnalysisWithProgram.analyzeProgram(AnalysisWithProgram.java:147)

at org.sonar.plugins.javascript.bridge.AnalysisWithProgram.analyzeFiles(AnalysisWithProgram.java:100)

at org.sonar.plugins.javascript.bridge.JsTsSensor.analyzeFiles(JsTsSensor.java:132)

at org.sonar.plugins.javascript.bridge.AbstractBridgeSensor.execute(AbstractBridgeSensor.java:79)

at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:62)

at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:75)

at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:48)

at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:66)

at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:48)

at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:64)

at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)

at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)

at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:192)

at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:188)

at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:159)

at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)

at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)

at org.sonar.scanner.bootstrap.ScannerContainer.doAfterStart(ScannerContainer.java:397)

at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)

at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)

at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:125)

at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:123)

at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:109)

at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:57)

at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:51)

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(NativeMethodAccessorImpl.java:77)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:568)

at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)

at jdk.proxy1/jdk.proxy1.$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:126)

at org.sonarsource.scanner.cli.Main.execute(Main.java:81)

at org.sonarsource.scanner.cli.Main.main(Main.java:62)

Here’s an attachment of the error
pipelineLog-{2760a9ae-3939-47a7-964a-cf3b8d80c631}.txt (23.9 KB)

Hey there.

Can you add -X to the EXTRA_ARGS to get DEBUG logging? At this point it should be clear in the logs while file is failing analysis, and it would be great to get a copy of that file.

1 Like

Hello there,
Thank you, here’s the log file of the analysis, done with the -X debug argument, now I’m getting a different error.
I tried running it multiple time.
pipelineLog-{baa0175c-043a-4736-8c9b-ab1daecdede6}.txt (1.8 MB)

Hi @Chernomirdin,

Thanks for your report, and thanks for the log files.

About your last error (The bridge server is unresponsive), can you tell us more about your project, and specifically its size? Very big monorepositories may require to be split into smaller chunks for the analysis to succeed.

Eric.

Hello @Eric,

On the its using TypeScript we are only scanning the TypeScript files, with 142443 lines in total.
Used the command find . -name '*.ts' | xargs wc -l without the node_modules.
I hope this is enought.

Hello,
Is there any solution for this issue?