Publish Quality Gate Results Task Hanging up

Running SQ in Azure pipeline and the publish quality gate results task is hanging up. It ran for 60 mins and timed out. The results were still published however this is causing the pipeline to fail.

##[debug]Response: 200 Body: "{"task":{"id":"AYCSPwCFN5Vetfnp3vpD","type":"REPORT","componentId":"AYCSPu85N5Vetfnp3vo4","componentKey":"iScribeAPITestProject","componentName":"iScribeAPITestProject","componentQualifier":"TRK","status":"CANCELED","submittedAt":"2022-05-05T03:24:07+0000","submitterLogin":"admin","startedAt":"2022-05-05T03:24:08+0000","executedAt":"2022-05-05T03:25:25+0000","executionTimeMs":76902,"hasScannerContext":true,"warningCount":2,"warnings":[]}}"

##[debug][SQ] Task status:CANCELED

##[debug][SQ] Waiting for task 'AYCSPwCFN5Vetfnp3vpD' to complete.

##[debug][SQ] API GET: '/api/ce/task' with query "{"id":"AYCSPwCFN5Vetfnp3vpD"}"

##[debug]Response: 200 Body: "{"task":{"id":"AYCSPwCFN5Vetfnp3vpD","type":"REPORT","componentId":"AYCSPu85N5Vetfnp3vo4","componentKey":"iScribeAPITestProject","componentName":"iScribeAPITestProject","componentQualifier":"TRK","status":"CANCELED","submittedAt":"2022-05-05T03:24:07+0000","submitterLogin":"admin","startedAt":"2022-05-05T03:24:08+0000","executedAt":"2022-05-05T03:25:25+0000","executionTimeMs":76902,"hasScannerContext":true,"warningCount":2,"warnings":[]}}"

##[debug][SQ] Task status:CANCELED

##[debug][SQ] Waiting for task 'AYCSPwCFN5Vetfnp3vpD' to complete.

##[debug][SQ] API GET: '/api/ce/task' with query "{"id":"AYCSPwCFN5Vetfnp3vpD"}"

##[debug]Response: 200 Body: "{"task":{"id":"AYCSPwCFN5Vetfnp3vpD","type":"REPORT","componentId":"AYCSPu85N5Vetfnp3vo4","componentKey":"iScribeAPITestProject","componentName":"iScribeAPITestProject","componentQualifier":"TRK","status":"CANCELED","submittedAt":"2022-05-05T03:24:07+0000","submitterLogin":"admin","startedAt":"2022-05-05T03:24:08+0000","executedAt":"2022-05-05T03:25:25+0000","executionTimeMs":76902,"hasScannerContext":true,"warningCount":2,"warnings":[]}}"

##[debug][SQ] Task status:CANCELED

##[debug][SQ] Waiting for task 'AYCSPwCFN5Vetfnp3vpD' to complete.

##[debug][SQ] API GET: '/api/ce/task' with query "{"id":"AYCSPwCFN5Vetfnp3vpD"}"

##[debug]Response: 200 Body: "{"task":{"id":"AYCSPwCFN5Vetfnp3vpD","type":"REPORT","componentId":"AYCSPu85N5Vetfnp3vo4","componentKey":"iScribeAPITestProject","componentName":"iScribeAPITestProject","componentQualifier":"TRK","status":"CANCELED","submittedAt":"2022-05-05T03:24:07+0000","submitterLogin":"admin","startedAt":"2022-05-05T03:24:08+0000","executedAt":"2022-05-05T03:25:25+0000","executionTimeMs":76902,"hasScannerContext":true,"warningCount":2,"warnings":[]}}"

##[debug][SQ] Task status:CANCELED

##[debug][SQ] Waiting for task 'AYCSPwCFN5Vetfnp3vpD' to complete.

##[debug][SQ] API GET: '/api/ce/task' with query "{"id":"AYCSPwCFN5Vetfnp3vpD"}"

##[debug]Response: 200 Body: "{"task":{"id":"AYCSPwCFN5Vetfnp3vpD","type":"REPORT","componentId":"AYCSPu85N5Vetfnp3vo4","componentKey":"iScribeAPITestProject","componentName":"iScribeAPITestProject","componentQualifier":"TRK","status":"CANCELED","submittedAt":"2022-05-05T03:24:07+0000","submitterLogin":"admin","startedAt":"2022-05-05T03:24:08+0000","executedAt":"2022-05-05T03:25:25+0000","executionTimeMs":76902,"hasScannerContext":true,"warningCount":2,"warnings":[]}}"

##[debug][SQ] Task status:CANCELED

##[debug]Re-evaluate condition on job cancellation for step: 'Publish Quality Gate Result'.

##[error]The operation was canceled.

##[debug]System.OperationCanceledException: The operation was canceled.

at System.Threading.CancellationToken.ThrowOperationCanceledException()

at Microsoft.VisualStudio.Services.Agent.Util.ProcessInvoker.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, InputQueue`1 redirectStandardIn, Boolean inheritConsoleHandler, Boolean keepStandardInOpen, Boolean highPriorityProcess, CancellationToken cancellationToken)

at Microsoft.VisualStudio.Services.Agent.ProcessInvokerWrapper.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, InputQueue`1 redirectStandardIn, Boolean inheritConsoleHandler, Boolean keepStandardInOpen, Boolean highPriorityProcess, CancellationToken cancellationToken)

at Microsoft.VisualStudio.Services.Agent.Worker.Handlers.DefaultStepHost.ExecuteAsync(String workingDirectory, String fileName, String arguments, IDictionary`2 environment, Boolean requireExitCodeZero, Encoding outputEncoding, Boolean killProcessOnCancel, Boolean inheritConsoleHandler, CancellationToken cancellationToken)

at Microsoft.VisualStudio.Services.Agent.Worker.Handlers.NodeHandler.RunAsync()

at Microsoft.VisualStudio.Services.Agent.Worker.TaskRunner.RunAsync()

at Microsoft.VisualStudio.Services.Agent.Worker.StepsRunner.RunStepAsync(IStep step, CancellationToken jobCancellationToken)

Finishing: Publish Quality Gate Result

Hi,

Could you share your pipeline?

 
Ann

Hi,

Just want to add to this because we have been getting the same behaviour. From my investigations, there are 2 parts to the problem.

  1. The background task is mysteriously being canceled. There is another thread that looks at this here: Why was a background task cancelled
    But this is not what this problem is about

  2. The ADO task constantly polls the /api/ce/task endpoint to check the status of the task
    When the task is canceled, this endpoint returns status: CANCELED
    However, the SonarQubePublish task checks for CANCEL so ends up in a loop because the fall through condition just checks the endpoint again
    sonar-scanner-vsts/Task.ts at e1f8ae84a2d274ce9b67a0e6f245bf13665eca91 · SonarSource/sonar-scanner-vsts · GitHub

Hi, just following up on this - should i just create a pull request to get this fixed?

Hey there.

We’ve flagged this for attention by the relevant team – you’re welcome to submit a pull request, but keep in mind the guidelines for contributing.

1 Like

Hi @benn

This has been fixed with a new release of the extension. Thanks for the heads up on this.

Mickaël

2 Likes

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