Error : Quality Gate failed: Could not fetch compute engine task: b''

I have a bitbucket pipeline configured which executes unit test cases and the coverage report gets successfully fetched to sonarqube.

I have configured the quality gate to fail if coverage is less that 75%. Currently I am getting 73%.

I want the pipeline to fail if the quality gate in not passed
Here is my bitbucket-pipeline.yml for qaulity gate

  • pipe: sonarsource/sonarcloud-scan:1.2.1**
    variables:
    EXTRA_ARGS: '-Dsonar.login=$SONAR_LOGIN -Dsonar.password=SONAR_PASSWORD' - pipe: sonarsource/sonarcloud-quality-gate:0.1.4 variables: SONAR_TOKEN: {SONAR_TOKEN}


image

@Husain_M,

Welcome to the community!

Can you repost your configuration properly formatted so we can understand your configuration better? Is this your configuration?

pipe: sonarsource/sonarcloud-scan:1.2.1
   variables:
   EXTRA_ARGS: '-Dsonar.login=$SONAR_LOGIN -Dsonar.password=SONAR_PASSWORD' 
pipe: sonarsource/sonarcloud-quality-gate:0.1.4 
   variables: SONAR_TOKEN: {SONAR_TOKEN}

Can you confirm that previous step: sonarcloud-scan is completing successfully? It looks like there is a problem with configuration, sonarcloud-quality-gate is failing due to an error, not due to the coverage being being too low.

Best,
Marcin

Hello @Marcin_Majewski

The above configuration is correct
Here is the snapshot of the step: sonarcloud-scan completing successfully:
image

Thanks,
Husain M

Hi @Husain_M,

It looks good to me. I suspect there is a problem with authorization. Can you remove the ‘variables’ from the pipe definition of sonarcloud-quality-gate so you have:

pipe: sonarsource/sonarcloud-scan:1.2.1
  variables:
  EXTRA_ARGS: '-Dsonar.login=$SONAR_LOGIN -Dsonar.password=SONAR_PASSWORD' 
pipe: sonarsource/sonarcloud-quality-gate:0.1.4 

and add SONAR_TOKEN variable as the repository variable. You can do it in repository settings → repository variables. Please make sure you have the right token (generate the new one),

Best,
Marcin

@Marcin_Majewski
It gives the same error


image

@Husain_M

I will ask you try out one more thing. Can you remove the variables from the sonarcloud-scan pipe and check whether it works that way. This will confirm if token is correct. You should have sth like that:

pipe: sonarsource/sonarcloud-scan:1.2.1

pipe: sonarsource/sonarcloud-quality-gate:0.1.4 

Best,
Marcin

@Marcin_Majewski

Still failing!! :frowning:
Is there any way we can connect virtually and share screen and troubleshoot this?

Thanks,
Husain

@Husain_M,

Can you share your latest background task id that is connected with the failing pipe? You can find it in Administration → Backgroud tasks

Are you administrator of you organization? The token you provide for the quality-gate pipe must be generated by the user that has the permission “Execute analysis”.

Does it happen only for this repository? Do you have any other repos you could give a try?

Best,
Marcin

@Marcin_Majewski
Task ID: AXeu-9dLOZqu6GlhhTD7
Yes I have the administrator permission and the token in generated by the admin user

Hello @Marcin_Majewski

Any work through for this?

Thanks

Hello @Husain_M,

I sent you a private message asking for the project key. Can you see it?

Best,
Marcin

Responded

Thanks

Hey @Husain_M,

As you are using SonarQube I changed the tag of the topic from SonarCloud to SonarQube. Unfortunately the sonarcloud-quality-gate pipe that you are using is only available for SonarCloud, that is why it does not work for you.

Best,
Marcin

So any way that I can implement the functionality using Sonarqube?

Hey @Husain_M,

Sorry for the late response, but lately the Sonarqube released their own bitbucket pipes. You can see more here:
https://bitbucket.org/sonarsource/sonarqube-quality-gate
https://bitbucket.org/sonarsource/sonarqube-scan

This should be perfect for your use-case.

Best,
Marcin

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.