# java.lang.UnsupportedOperationException: Can not add the same measure twice Issue

**URL:** <https://community.sonarsource.com/t/java-lang-unsupportedoperationexception-can-not-add-the-same-measure-twice-issue/44072>\
**Category:** SonarQube Server / Community Build\
**Created:** [June 1, 2021, 2:26am UTC](https://community.sonarsource.com/t/java-lang-unsupportedoperationexception-can-not-add-the-same-measure-twice-issue/44072 "2021-06-01T02:26:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![manojthe1](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/manojthe1/32/22700_2.png) [@manojthe1](https://community.sonarsource.com/u/manojthe1)\
**Post date:** [June 1, 2021, 2:26am UTC](https://community.sonarsource.com/t/java-lang-unsupportedoperationexception-can-not-add-the-same-measure-twice-issue/44072/1 "2021-06-01T02:26:22Z")

</div>

Hi all,

I’m using gitactions to perform code scan. my yaml as below

sonarqube:  
runs-on: ubuntu-latest  
steps:

- uses: actions/checkout@v2  
with:

# Disabling shallow clone is recommended for improving relevancy of reporting

fetch-depth: 0

- name: SonarQube Scan  
uses: sonarsource/sonarqube-scan-action@v1.0.0

# with:

# projectBaseDir: app/src

env:  
SONAR\_TOKEN: ${{ secrets.SONAR\_TOKEN }}  
SONAR\_HOST\_URL: ${{ secrets.SONAR\_HOST\_URL }}

sonar.apiVersion= 7.7  
sonar-packaging-maven-plugin version= 1.17  
sonar-maven-plugin version=3.9.0.2155

**I’m getting below error . can anyone help?**

java.lang.UnsupportedOperationException: Can not add the same measure twice on src/main/mule/helloworld.xml: DefaultMeasure[component=src/main/mule/helloworld.xml,metric=Metric[uuid=,key=ncloc,description=Non commenting lines of code,type=INT,direction=-1,domain=Size,name=Lines of Code,qualitative=false,userManaged=false,enabled=true,worstValue=,bestValue=,optimizedBestValue=false,hidden=false,deleteHistoricalData=false,decimalScale=],value=17,fromCore=false,storage=org.sonar.scanner.sensor.DefaultSensorStorage@798ac54d,saved=false]  
at org.sonar.scanner.sensor.DefaultSensorStorage.saveMeasure(DefaultSensorStorage.java:177)  
at org.sonar.scanner.sensor.DefaultSensorStorage.store(DefaultSensorStorage.java:137)  
at org.sonar.api.batch.sensor.measure.internal.DefaultMeasure.doSave(DefaultMeasure.java:96)  
at org.sonar.api.batch.sensor.internal.DefaultStorable.save(DefaultStorable.java:45)  
at com.mulesoft.services.tools.sonarqube.metrics.ConfigurationFilesSensor.saveMetric(ConfigurationFilesSensor.java:73)  
at com.mulesoft.services.tools.sonarqube.metrics.ConfigurationFilesSensor.process(ConfigurationFilesSensor.java:51)  
at com.mulesoft.services.tools.sonarqube.metrics.AbstractMuleSensor.execute(AbstractMuleSensor.java:23)  
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)  
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:85)  
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:59)  
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:77)  
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:59)  
at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:82)  
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)  
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)  
at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:388)  
at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:384)  
at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:353)  
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)  
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)  
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:144)  
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:137)  
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:123)  
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)

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [June 3, 2021, 1:37pm UTC](https://community.sonarsource.com/t/java-lang-unsupportedoperationexception-can-not-add-the-same-measure-twice-issue/44072/2 "2021-06-03T13:37:03Z")

</div>

Closing this post because it appears to be identical to

> [@java.lang.UnsupportedOperationException: Can not add the same measure twice](https://community.sonarsource.com/t/java-lang-unsupportedoperationexception-can-not-add-the-same-measure-twice/44070):
>
> Hi all, I’m using gitactions to perform code scan. my yaml as below sonarqube: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: # Disabling shallow clone is recommended for improving relevancy of reporting fetch-depth: 0 - name: SonarQube Scan uses: sonarsource/sonarqube-scan-action@v1.0.0 # with: # projectBaseDir: app/src env: SONAR\_TOKEN: ${{ secrets.SONAR\_TOKEN }} SONAR\_HOST\_URL: ${{ secrets.SONAR\_HOST\_URL }} I tried sonarsource/sonarqube-scan-action@v1.0.0 and…

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [June 3, 2021, 1:37pm UTC](https://community.sonarsource.com/t/java-lang-unsupportedoperationexception-can-not-add-the-same-measure-twice-issue/44072/3 "2021-06-03T13:37:05Z")

</div>

Closed on June 3, 2021, 1:37pm UTC


