SonarQube 5.3 Background Task Fails with No Log in Dashboard

后端 未结 1 502
渐次进展
渐次进展 2021-01-05 14:32

I know this is similar to sonarqube 5.2 background tasks sometimes fail with no log - however I cannot comment (due to lack of reputation points) to add some more informatio

1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-05 15:14

    You are facing a very odd issue.

    To sum it up:

    • from time to times
    • a background task is processed without any log in sonar.log nor a task log in the data/ce/logs directory
    • the task failed (as visible in the UI of SQ)
    • it ran for a very short time
    • the report zip file is still present in the data directory

    The only time we faced such a scenario, it turned out two SonarQube instances were running on the same database and here is what was going on:

    • SQ A (the one you are aware of and monitoring) receives the report, save the zip file to its data directory and adds an entry (a background task) in the DB
    • SQ A and SQ B both poll the DB regularly for PENDING items to process. Sometimes, SQ B will be the first one to pick the entry from the DB and starts processing it. Since the report is not in its data directory, the processing very quickly fails and the entry is flagged as failed in the DB
    • SQ A never tries to process the entry, because from its point of view, it is either PROCESSING (when SQ B is working on it) or FAILED (when SQ B is done with it). Only items PENDING can be processed. So, no log ever shows up in SQ A's sonar.log and no task log is created either. Still, in the UI the background task is displayed as failed because the UI shows information from the DB.

    A good hint that the processing (ie. change of state of the entry in DB) wasn't done by the SQ A is that the report zip file is still present in the data directory. The change of state of the entry to FAIL or SUCCESS is tightly coupled with the deletion of the zip file.

    It's only a hint since the deletion could also have failed, but in such case, you would have a ERROR in the logs.

    0 讨论(0)
提交回复
热议问题