UnsupportedOperationException: null (DefaultIssueLocation.newMessageFormatting)

Template for a good new topic, formatted with Markdown:

  • ALM used: GitHub

  • CI system used: GitHub Actions, Travis CI

  • Scanner command used when applicable:

     ./gradlew sonar -Dsonar.branch.name="sonarqube-gradle-plugin"
    
  • Languages of the repository: Java, Kotlin

  • SonarCloud project: SonarQube Cloud

  • Branch: GitHub - EventFahrplan/EventFahrplan at sonarqube-gradle-plugin

  • Error observed:

    Could not report issue with code highlighting, using plain text instead. Check whether the product is outdated.
    java.lang.UnsupportedOperationException: null
            at org.sonar.api.batch.sensor.issue.internal.DefaultIssueLocation.newMessageFormatting(DefaultIssueLocation.java:97)
            at org.sonarsource.kotlin.api.checks.InputFileContextImpl.message(InputFileContextImpl.kt:93)
            at org.sonarsource.kotlin.api.checks.InputFileContextImpl.reportIssue(InputFileContextImpl.kt:68)
            at org.sonarsource.kotlin.api.checks.AbstractCheck.reportIssue(AbstractCheck.kt:69)
            at org.sonarsource.kotlin.api.checks.AbstractCheck.reportIssue(AbstractCheck.kt:95)
            at org.sonarsource.kotlin.api.checks.AbstractCheck.reportIssue$default(AbstractCheck.kt:90)
            at org.sonarsource.kotlin.checks.MapValuesShouldBeAccessedSafelyCheck.visitClass(MapValuesShouldBeAccessedSafelyCheck.kt:68)
            at org.sonarsource.kotlin.checks.MapValuesShouldBeAccessedSafelyCheck.visitClass(MapValuesShouldBeAccessedSafelyCheck.kt:39)
            at org.jetbrains.kotlin.psi.KtClass.accept(KtClass.kt:22)
            ...
    
  • Steps to reproduce: run scanner command

  • Potential workaround: -

  • Console log: sonar.log (133.2 KB)

Related

Hi Tobias,

The error you’re seeing is expected with SonarCloud and should not affect the analysis or cause your CI to fail, though it can be noisy.

A ticket was created to address the noise issue, and the new implementation logs the error only once. This change was made three weeks ago but is not yet available on SonarQube. Do you have any other specific issues with this, aside from it polluting the logs?

Best,
Erwan

2 Likes