Protocol message end-group tag did not match expected tag

Hello,

Having been unable to find a solution on the forum or on the internet, I’m opening this topic because of an error at the end of the SonarQube Analyze task (lines 290 and 315 in log.txt).

Error observed:

##[error]16:04:50.736 ERROR Error during SonarScanner Engine execution
java.lang.RuntimeException: com.google.protobuf.InvalidProtocolBufferException: Protocol message end-group tag did not match expected tag.
[...]
Here is the YAML SonarQube’s tasks defined in my pipeline.
      - task: SonarQubePrepare@7
        displayName: 'SonarQube: Prepare analysis'
        inputs:
          SonarQube: 'Code Quality Validation Service Connection'
          scannerMode: CLI
          extraProperties: |
            sonar.sources=src/
            sonar.projectKey=abcdg-project
            sonar.projectVersion=$(Build.BuildNumber)
            sonar.lang.patterns.abap=**/*.abap,**/*.ab4,**/*.asprog
            sonar.lang.patterns.xml=**/*.xml,**/*.xsd,**/*.xsl,**/*.config,**/*.flow
      - task: SonarQubeAnalyze@7
        displayName: 'SonarQube: Run code analysis'
        inputs:
          jdkversion: 'JAVA_HOME_17_X64'
      - task: SonarQubePublish@7
        displayName: 'SonarQube: Publish analysis results'
        inputs:
          pollingTimeoutSec: '300'
  • Enterprise Edition v10.7 (96327)
  • SonarQube(Prepare|Analyze|Publish)@7
  • CI Azure DevOps
  • APEX, CSS, JS, JSON, HTML, XML

Hey there.

You (or other users) can read more about what this error means here: java - Protocol message end-group tag did not match expected tag - Stack Overflow

The sue you face is most likely related to your network/infrastructure configuration. In the past, I’ve seen other customers encounter this issue because their firewall blocked requests from reaching their Nginx proxy.

It might be worth asking your SonarQube admins (if that isn’t you) to help you test pointing a scan at your SonarQube server which bypasses anything sitting in front of it (like a proxy) to see if you can isolate the issue.

There’s also one report way back in 2016 where sonar.core.serverBaseURL was not set correctly. I haven’t seen any other reports of this sense then, but it’s worth a try (global Admnistration > General > Server base URL)