SonarQube quality gate checks fails with "Date of analysis cannot be older than the date of the last known analysis on this project." validation error

Hello,

We are using SonarQube analysis on CI as part of MergeRequests workflow and pretty happy.
But sometimes we are facing with weird failings on our quality gates check, for example I getting such ceTask responses more often:

{
"task": {
"id": "AXARojU_enwM7_-vnvR3",
"type": "REPORT",
"componentId": "AW_3rY-nzDf7PgTMCtPE",
"componentKey": "nda",
"componentName": "nda",
"componentQualifier": "TRK",
"status": "FAILED",
"submittedAt": "2020-02-04T20:16:48+0100",
"startedAt": "2020-02-04T20:16:50+0100",
"executedAt": "2020-02-04T20:16:50+0100",
"executionTimeMs": 89,
"logs": false,
"errorMessage": "Validation of project failed:\n  o Date of analysis cannot be older than the date of the last known analysis on this project. Value: \"2020-02-04T20:11:25+0100\". Latest analysis: \"2020-02-04T20:11:57+0100\". It's only possible to rebuild the past in a chronological order.",
"hasScannerContext": true,
"organization": "default-organization"
}
}
  • SonarQube version: 6.7.5
  • sonar-maven-plugin version: 3.4.0.905

Can you help me avoid this somehow?
Does it seems like CI server node is setting wrong scan time or something?
Or can it be related to our merge requests workflow when we are removing work in progress branches after merge?

Thanks in advice.


Maksim

Hi,

Apart from the very deep meaning of below: :slight_smile:

It’s only possible to rebuild the past in a chronological order

Probably you need re-adjust the times on various boxes, since the:

Latest analysis: \"2020-02-04T20:11:57+0100\"

and the analysis you perform is dated to below

Value: \"2020-02-04T20:11:25+0100\"

Which is 22 seconds earlier than the latest analysis date/time.

Hope that help.
Kris

1 Like

Hello @Krzysztof_Jazgara

Thanks for feedback and yes, I saw that error message and seems like I cannot control it. All these dates not passing by us directly, as far as I can assume these dates where passed by maven plugin or was defined somehow on Sonar side as fact