Sonar publish analysis error when running in multiple pipelines

We are facing the issue in Sonar publish analysis, when trying to run multiple pipelines on. The error is as follows:

##[error][SQ] Task failed with status FAILED, Error message: Validation of project failed:
o Date of analysis cannot be older than the date of the last known analysis on this project. Value: “2023-08-29T09:12:53+0000”. Latest analysis: “2023-08-29T09:18:38+0000”. It’s only possible to rebuild the past in a chronological order.

Can you please help me giving the proper solution to resolve this issue.

Thanks

Hi,

Welcome to the community!

It sounds like you have multiple analyses of the same branch of the same project running simultaneously. I.E. you’ve created a race condition.

The first analysis to finish (maybe it got a faster build agent) wins, and analyses that started before it, but submit afterwards get this error. It’s normal and expected.

Your best bet is to throttle your CI/CD to not run multiple analyses of the same project-branch at the same time.

 
HTH,
Ann