# Can not add the same measure twice on blue-deployment.yml

**URL:** <https://community.sonarsource.com/t/can-not-add-the-same-measure-twice-on-blue-deployment-yml/89403>\
**Category:** SonarQube Server / Community Build\
**Created:** [April 18, 2023, 10:30am UTC](https://community.sonarsource.com/t/can-not-add-the-same-measure-twice-on-blue-deployment-yml/89403 "2023-04-18T10:30:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![eliassal](https://avatars.discourse-cdn.com/v4/letter/e/43a26b/32.png) [@eliassal](https://community.sonarsource.com/u/eliassal)\
**Post date:** [April 18, 2023, 10:30am UTC](https://community.sonarsource.com/t/can-not-add-the-same-measure-twice-on-blue-deployment-yml/89403/1 "2023-04-18T10:30:53Z")

</div>

I have a CI/CD for a java project where I call sonarqube and analysis goes through successfuly until this morning. I added a yaml file in the project, very simple yaml, for the creation of pod in K8S, as soon as I ran the cicd pipeline I got

```auto
ERROR: Error during SonarScanner execution
java.lang.UnsupportedOperationException: Can not add the same measure twice on blue-deployment.yml: DefaultMeasure[component=blue-deployment.yml,metric=Metric[uuid=<null>,key=ncloc_data,description=<null>,type=DATA,direction=0,domain=<null>,name=ncloc_data,qualitative=false,userManaged=false,enabled=true,worstValue=<null>,bestValue=<null>,optimizedBestValue=false,hidden=false,deleteHistoricalData=false,decimalScale=<null>],value=1=1;2=1;3=1;4=1;5=1;6=1;7=1;8=1;9=1;10=1;11=1;12=1;13=1;14=1;15=1;16=1;17=1;18=1;19=1;20=1;21=1;22=1,fromCore=false,storage=org.sonar.scanner.sensor.DefaultSensorStorage@300b839c,saved=false]
	at org.sonar.scanner.sensor.DefaultSensorStorage.saveMeasure(DefaultSensorStorage.java:175)
	at org.sonar.scanner.sensor.DefaultSensorStorage.store(DefaultSensorStorage.java:135)
	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)

```

Must-share information (formatted with [Markdown](https://commonmark.org/help/)):

- versions SonarQube : 9.8
- how is SonarQube deployed: on a fedora 37 VM

The call to sonarQube happens inside a jenkins pipeline as follows

```auto
stage('SonarQube Analysis') {
            steps {
                sh 'sonar-scanner \
                -Dsonar.host.url=http://192.168.100.11:9000 \
                -Dsonar.login=sqa_8f0.................6f88888ba \
                -Dsonar.projectKey=game-of-lifeonGitHub \
                -Dsonar.sources=. \
                -Dsonar.java.binaries=.'
            }
        }

```

---

<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:** [April 20, 2023, 12:58pm UTC](https://community.sonarsource.com/t/can-not-add-the-same-measure-twice-on-blue-deployment-yml/89403/2 "2023-04-20T12:58:33Z")

</div>

Hi,

This error typically comes from an overlap in the definition of `sonar.sources` and `sonar.tests`. Can you check Project Settings → Background Tasks → [row cog menu] → Show Scanner Context and see if `sonar.tests` is defined (perhaps in a `sonar-project.properties` file)? A definition of `sonar.sources=.` is pretty broad and would automatically overlap anything defined for `sonar.tests`.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![eliassal](https://avatars.discourse-cdn.com/v4/letter/e/43a26b/32.png) [@eliassal](https://community.sonarsource.com/u/eliassal)\
**Post date:** [April 20, 2023, 1:26pm UTC](https://community.sonarsource.com/t/can-not-add-the-same-measure-twice-on-blue-deployment-yml/89403/3 "2023-04-20T13:26:27Z")

</div>

Hi Ann, I did visit the project settings, no sonar.tests item (I have disabled K8S plugin in the system to be able to run the analysis)

```auto
Scanner Context: game-of-lifeonGitHub [Project Analysis]
Plugins:
  - Dependency-Check 3.0.1 (dependencycheck)
  - jDepend 1.1.1 (jdepend)
  - detekt 2.5.0 (detekt)
  - Sonar WebDriver Plugin 1.0.5 (webdriver)
  - YAML Analyzer 1.7.0 (yaml)
Bundled analyzers:
  - Python Code Quality and Security 3.21.0.10628 (python)
  - Go Code Quality and Security 1.11.0.3905 (go)
  - JaCoCo 1.1.1.1157 (jacoco)
  - Kotlin Code Quality and Security 2.12.0.1956 (kotlin)
  - IaC Code Quality and Security 1.9.2.2279 (iac)
  - JavaScript/TypeScript/CSS Code Quality and Security 9.12.0.20319 (javascript)
  - Ruby Code Quality and Security 1.11.0.3905 (ruby)
  - Scala Code Quality and Security 1.11.0.3905 (sonarscala)
  - C# Code Quality and Security 8.50.0.58025 (csharp)
  - Java Code Quality and Security 7.15.0.30507 (java)
  - HTML Code Quality and Security 3.7.1.3306 (web)
  - Flex Code Quality and Security 2.8.0.3166 (flex)
  - XML Code Quality and Security 2.6.1.3686 (xml)
  - PHP Code Quality and Security 3.25.0.9077 (php)
  - Text file Code Quality and Security 1.2.0.510 (text)
  - VB.NET Code Quality and Security 8.50.0.58025 (vbnet)
  - Configuration detection fot Code Quality and Security 1.2.0.267 (config)
Global server settings:
  - email.from=blahblah@blahblah.net
  - email.fromName=blahblah@blahblah.net
  - sonar.core.id=9D6E76F7-AYVj4CA9Pg8SM2k-76FS
  - sonar.core.startTime=2023-04-20T09:14:06+0200
  - sonar.forceAuthentication=false
  - sonar.kubernetes.activate=false
  - sonar.lf.enableGravatar=true
  - sonar.plugins.risk.consent=ACCEPTED
  - sonar.projectCreation.mainBranchName=master
Project server settings:
Project scanner properties:
  - sonar.host.url=http://192.168.100.100:9000
  - sonar.java.binaries=.
  - sonar.login= ******
  - sonar.projectBaseDir=/home/jenkins/workspace/blue-green-deployment
  - sonar.projectKey=game-of-lifeonGitHub
  - sonar.scanner.app=ScannerCLI
  - sonar.scanner.appVersion=4.8.0.2856
  - sonar.sourceEncoding=UTF-8
  - sonar.sources=.
  - sonar.working.directory=/home/jenkins/workspace/blue-green-deployment/.scannerwork

```

---

<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:** [April 20, 2023, 2:30pm UTC](https://community.sonarsource.com/t/can-not-add-the-same-measure-twice-on-blue-deployment-yml/89403/4 "2023-04-20T14:30:16Z")

</div>

Hi,

Thanks for including the full context!

Can you uninstall the YAML plugin & try again? I’m guessing that’s where the conflict is coming from.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![eliassal](https://avatars.discourse-cdn.com/v4/letter/e/43a26b/32.png) [@eliassal](https://community.sonarsource.com/u/eliassal)\
**Post date:** [April 20, 2023, 3:05pm UTC](https://community.sonarsource.com/t/can-not-add-the-same-measure-twice-on-blue-deployment-yml/89403/5 "2023-04-20T15:05:22Z")

</div>

Thanks Ann, I uninstalled the yaml, renabled K8S and analysis went through but in spite of the fact that I have 3 yaml K8S files I dont see any activity of analysis on those files? Where can we see what happened during analysis, what I mean what SQ analyzed?  
Thanks again for your help

---

<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:** [April 20, 2023, 3:18pm UTC](https://community.sonarsource.com/t/can-not-add-the-same-measure-twice-on-blue-deployment-yml/89403/6 "2023-04-20T15:18:54Z")

</div>

Hi,

Ah! Right. You’re on SonarQube 9.8. Upgrade to 9.9 (since you have to hit each intervening LTS version between your start point and your target version) and then to 10.0 and try again, please.

&nbsp;  
Ann

---

<div class="post-metadata">

**Author:** ![Chris](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/chris/32/71589_2.png) [@Chris](https://community.sonarsource.com/u/Chris)\
**Post date:** [February 14, 2025, 8:43am UTC](https://community.sonarsource.com/t/can-not-add-the-same-measure-twice-on-blue-deployment-yml/89403/7 "2025-02-14T08:43:00Z")

</div>

Hi @eliassal,

To follow up on your question during the webinar, if you are still running an old version of SonarQube, I invite you to upgrade to the most recent version and try again.

Chris

---

<div class="post-metadata">

**Author:** ![eliassal](https://avatars.discourse-cdn.com/v4/letter/e/43a26b/32.png) [@eliassal](https://community.sonarsource.com/u/eliassal)\
**Post date:** [February 14, 2025, 9:07am UTC](https://community.sonarsource.com/t/can-not-add-the-same-measure-twice-on-blue-deployment-yml/89403/8 "2025-02-14T09:07:27Z")

</div>

Thanks Christophe for the follow-up. I have already upgraded to 2025 1 week ago but did not have time to test. My question was is there still an overlap between yaml plugin and k8s?
