Error fetching project information while browsing Jenkins Job page

Hello Team,

I am on Enterprise EditionVersion 7.4 (build 18908)

I am using Jenkins v2.134 with sonarqube plugin v2.6.1

I am using Jenkins scripted pipeline and I am doing the analysis with gradle.

def gradleArgs = [

def gradleCommand = "gradle --info sonarqube ${gradleArgs.join(' ')}"
withSonarQubeEnv(‘my-sonar') {
    sh gradleCommand

And this is how I check my quality analysis results

timeout(time: 30, unit: ‘MINUTES’) {
// Just in case something goes wrong, pipeline will be killed after a timeout
def qg = waitForQualityGate() // Reuse taskId previously collected by withSonarQubeEnv
if (qg.status != ‘OK’) {
error “Pipeline aborted due to sonar quality gate failure: ${qg.status}”

Everything works as expected in terms of analysis.

However if I browse the Jenkins page for that job, I get the below exception in my Jenkins logs.

Apr 30, 2019 11:14:42 AM hudson.plugins.sonar.client.SQProjectResolver resolve
WARNING: Error fetching project information Error 400 on https://sonarqube_URL/api/qualitygates/project_status?projectKey=
at hudson.plugins.sonar.client.HttpClient.getHttp(
at hudson.plugins.sonar.client.WsClient.getQualityGate54(
at hudson.plugins.sonar.client.SQProjectResolver.getQualityGate(
at hudson.plugins.sonar.client.SQProjectResolver.resolve(
at hudson.plugins.sonar.action.SonarCacheAction.get(
at hudson.plugins.sonar.action.SonarCacheAction.get(
at hudson.plugins.sonar.action.SonarProjectActionFactory.createProjectPage(

I understand that, it make those queries to display the SonarQube widget on the job page. Since the analysis is asynchronous, you have to poll for the results until they are fetched. Queries should reuse the authentication you have configured in the Jenkins global settings.

But in my case the error is 400 as we can see it is missing the projectKey.

From where does this API picks up the “projectKey” as that seems to be going as empty.

Can someone please suggest what I am missing here?

1 Like


You are using a pretty old version of the plugin. Could you please update to 2.8.1?


sure, i will try and will let you know


We are facing the simillar issue with Jenkins v2.180 and sonarqube plugin v2.9