Failed to upload report - HTTP code 502

sonarcloud

(Timon Borter) #1

Hi there

I’m trying to analyze my project using Travis-Ci. Here’s the build: https://travis-ci.org/tbmelabs/tbmelabs-configuration-server
I followed the official Documentation from: https://docs.travis-ci.com/user/sonarcloud/

I’ve this in my .travis.yml:

addons:
  sonarcloud:
    organization: "tbmelabs-github"
    token:
      secure: [TOKEN]

An I run the Maven command:

mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar

Authentication seems to work fine but as the build tries to upload the report I receive an HTTP 502 response from the server. Has anonye seen or experienced this any time earlier?

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.1.1168:sonar (default-cli) on project configuration-server: Failed to upload report - HTTP code 502 -> [Help 1]

Regards and many thanks, Timon


(Fabrice Bellingard) #2

Hi Timon,

from what I see on your organization, this relates to the following project: https://sonarcloud.io/dashboard?id=tbmelabs-configuration-server

I assume that you have created the project from within the “Create Project” web interface - which is good. You can see on the right side of the page that the key for this project is: tbmelabs-configuration-server. However, I could not find this information in your POM nor in your Travis YML file - which means that SonarCloud will infer the key from the POM groupId and artifactId - which does not match.

All in all, here’s what you need to add in your POM properties to have the analysis working:

<sonar.projectKey>tbmelabs-configuration-server</sonar.projectKey>

(Timon Borter) #3

Hi Fabrice

That did not completly fix it but got me the right idea! I didn’t know it relates on the pom. All I adapted was the sonar.projectKey AND sonar.projectName and now it works like a charm.
Thank you very much.

Regards, Timon