I am trying to run the sonar analysis simultaneously with the same project and I see my pipeline gets the timeout error at the QualityGate. Whenever I run the two sonar analysis one after the other on the same project there is no issue. But issue is when I am running two sonar analysis on the same project in parallel.
11:23:30 Task has not declared any outputs.
11:23:30 User cache: /srv/jenkins/.sonar/cache
11:23:32 Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
11:23:32 Load global settings
11:23:32 Load global settings (done) | time=212ms
11:23:32 Server id: B1569A4A-AWmi4uq-naChzLef8Wdp
11:23:32 User cache: /srv/jenkins/.sonar/cache
11:23:32 Load/download plugins
11:23:32 Load plugins index
11:23:32 Load plugins index (done) | time=52ms
11:23:42 Load/download plugins (done) | time=8747ms
11:23:42 Loaded core extensions: branch-scanner
11:23:42 Process project properties
11:23:42 Execute project builders
11:23:42 Execute project builders (done) | time=3ms
11:23:42 Project key: xfinityhome:App
11:23:42 Base dir: /home/ubuntu/workspace/xhome_XFHome_Android_PR-3752@2/App
11:23:42 Working dir: /home/ubuntu/workspace/xhome_XFHome_Android_PR-3752@2/App/build/sonar
11:23:42 Load project settings
11:23:42 Load project settings (done) | time=20ms
11:23:42 Load project branches
11:23:42 Load project branches (done) | time=17ms
11:23:42 Load project pull requests
11:23:42 Load project pull requests (done) | time=21ms
11:23:42 Load branch configuration
11:23:42 Load branch configuration (done) | time=4ms
11:23:42 Load project repositories
11:23:43 Load project repositories (done) | time=90ms
11:23:43 Load quality profiles
11:23:43 Load quality profiles (done) | time=37ms
11:23:43 Load active rules
11:23:43 Load active rules (done) | time=616ms
11:23:43 Load metrics repository
11:23:43 Load metrics repository (done) | time=13ms
11:23:43 Pull request 3752 for merge into dev from PR-3752
11:23:43 SCM collecting changed files in the branch
11:23:43 SCM collecting changed files in the branch (done) | time=316ms
11:23:43 Property 'sonar.abap.file.suffixes' is not declared as multi-values/property set but was read using 'getStringArray' method. The SonarQube plugin declaring this property should be updated.
11:23:43 Indexing files...
11:23:43 Project configuration:
11:23:43 Excluded sources: **/*Generated.java
11:23:44 1005 files indexed
11:23:44 0 files ignored because of inclusion/exclusion patterns
11:23:44 Quality profile for java: Sonar way
11:23:44 Quality profile for kotlin: Sonar way
11:23:44 ------------- Run sensors on module XFinity Home Android
11:23:47 Sensor JavaSquidSensor [java]
11:23:47 Configured Java source version (sonar.java.source): 8
11:23:47 JavaClasspath initialization
11:23:47 JavaClasspath initialization (done) | time=23ms
11:23:47 JavaTestClasspath initialization
11:23:47 JavaTestClasspath initialization (done) | time=40ms
11:23:47 Java Main Files AST scan
11:23:47 539 source files to be analyzed
11:23:58 172/539 files analyzed, current file: src/main/java/com/comcast/xfinityhome/localytics/LocalyticsAttribute.java
11:24:08 320/539 files analyzed, current file: src/main/java/com/comcast/xfinityhome/view/activity/SavedMediaActionActivity.java
11:24:17 398/539 files analyzed, current file: src/main/java/com/comcast/xfinityhome/view/fragment/PinEntryPresenter.java
11:24:28 512/539 files analyzed, current file: src/main/java/com/comcast/xfinityhome/view/widget/OverviewListAnimationLayout.java
11:24:28 539/539 source files have been analyzed
11:24:28 Classes not found during the analysis : [com.comcast.xfinityhome.data.CvrEventRepository$cvrObserver, com.comcast.xfinityhome.view.fragment.CameraSettingsVideoQualityFragment$presenterEventListener]
11:24:28 Java Main Files AST scan (done) | time=41355ms
11:24:28 Java Test Files AST scan
11:24:28 211 source files to be analyzed
11:24:33 Classes not found during the analysis : [android.view.IWindowFocusObserver, android.view.IWindowId, android.view.IWindowId$Stub, com.comcast.xfinityhome.data.CvrEventRepository$cvrObserver]
11:24:33 211/211 source files have been analyzed
11:24:33 Java Test Files AST scan (done) | time=4312ms
11:24:33 Sensor JavaSquidSensor [java] (done) | time=46304ms
11:24:33 Sensor PmdSensor [pmd]
11:24:33 Sensor PmdSensor [pmd] (done) | time=1ms
11:24:33 Sensor SurefireSensor [java]
11:24:33 parsing [/home/ubuntu/workspace/xhome_XFHome_Android_PR-3752@2/App/target/surefire-reports]
11:24:33 Sensor SurefireSensor [java] (done) | time=1ms
11:24:33 Sensor JaCoCoSensor [java]
11:24:33 Sensor JaCoCoSensor [java] (done) | time=1ms
11:24:33 Sensor JavaXmlSensor [java]
11:24:33 Sensor JavaXmlSensor [java] (done) | time=10ms
11:24:33 Sensor HTML [web]
11:24:33 Sensor HTML [web] (done) | time=17ms
11:24:33 Sensor JaCoCo XML Report Importer [jacoco]
11:24:33 Sensor JaCoCo XML Report Importer [jacoco] (done) | time=348ms
11:24:33 Sensor Kotlin Sensor [kotlin]
11:24:33 162 source files to be analyzed
11:24:35 Sensor Kotlin Sensor [kotlin] (done) | time=2053ms
11:24:35 Sensor Zero Coverage Sensor
11:24:35 162/162 source files have been analyzed
11:24:35 Sensor Zero Coverage Sensor (done) | time=129ms
11:24:35 Sensor JavaSecuritySensor [security]
11:24:35 Reading UCFGs from: /home/ubuntu/workspace/xhome_XFHome_Android_PR-3752@2/App/build/sonar/ucfg2/java
11:24:37 15:24:35.774 Building Type propagation graph
11:24:37 15:24:36.023 Running Tarjan on 48063 nodes
11:24:37 15:24:36.139 Tarjan found 47968 components
11:24:37 15:24:36.256 Variable type analysis: done
11:24:37 UCFGs: 6115, excluded: 6115, source entrypoints: 0
11:24:37 No UCFGs have been included for analysis.
11:24:37 Sensor JavaSecuritySensor [security] (done) | time=1833ms
11:24:37 Sensor CSharpSecuritySensor [security]
11:24:37 Reading UCFGs from: /home/ubuntu/workspace/xhome_XFHome_Android_PR-3752@2/App/build/ucfg_cs2
11:24:37 15:24:36.543 Building Type propagation graph
11:24:37 15:24:36.543 Running Tarjan on 0 nodes
11:24:37 15:24:36.543 Tarjan found 0 components
11:24:37 15:24:36.543 Variable type analysis: done
11:24:37 UCFGs: 0, excluded: 0, source entrypoints: 0
11:24:37 No UCFGs have been included for analysis.
11:24:37 Sensor CSharpSecuritySensor [security] (done) | time=1ms
11:24:37 ------------- Run sensors on project
11:24:37 Sensor Java CPD Block Indexer
11:24:38 Sensor Java CPD Block Indexer (done) | time=716ms
11:24:38 159 files had no CPD blocks
11:24:38 Calculating CPD for 542 files
11:24:38 CPD calculation finished
11:24:39 SCM writing changed lines
11:24:39 SCM writing changed lines (done) | time=2ms
11:24:39 Analysis report generated in 451ms, dir size=1 MB
11:24:39 Analysis report compressed in 595ms, zip size=1 MB
11:24:39 Analysis report uploaded in 135ms
11:24:39 ANALYSIS SUCCESSFUL, you can browse https://sonarqube.comcast.net/project/issues?id=xfinityhome%3AApp&pullRequest=3752&resolved=false
11:24:39 Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
11:24:39 More about the report processing at https://sonarqube.comcast.net/api/ce/task?id=AWwklZlZd4_b-Hr8u4yr
11:24:40 Analysis total time: 57.843 s
11:24:40 :App:sonarqube (Thread[Daemon worker,5,main]) completed. Took 1 mins 9.381 secs.
11:24:40
11:24:40 BUILD SUCCESSFUL in 17m 2s
11:24:40 53 actionable tasks: 53 executed
11:24:40
11:24:40 Publishing build scan...
11:24:40 https://egradle-wc-1p.sys.comcast.net/s/hnisnhccmq4qs
11:24:40
11:24:40 [Pipeline] }
11:24:41 [Pipeline] // withSonarQubeEnv
11:24:41 [Pipeline] waitForQualityGate
11:24:41 Checking status of SonarQube task 'AWwklZlZd4_b-Hr8u4yr' on server 'Developer Edition Sonarqube'
11:24:42 SonarQube task 'AWwklZlZd4_b-Hr8u4yr' status is 'IN_PROGRESS'
12:04:31 Cancelling nested steps due to timeout
12:04:31 [Pipeline] junit
12:04:31 Recording test results
12:04:31 Cancelling nested steps due to timeout
12:04:31 null```
We don’t have a solution yet because we were never able to fully diagnose the problem. In that other thread, Julien asked for some logs. The OP in that thread never responded. Perhaps you could provide the needed logs?
You can also configure log level of the org.sonarsource.scanner.jenkins.pipeline.SonarQubeWebHook logger to FINE to see the content of the payload (this could help to see if the taskId is correct).
(Click through on the link to get instructions to turn on verbose logging in Jenkins.)
Once you have those, we’re looking for log lines that start with “Full details of the POST was…”
Hi,
Could it be that when analysis of X and Y happen concurrently, Y finished before X and gets processed by SonarQube before X is processed. Y takes a long time and Y’s pipeline waiting for the results about the QG?
Could you check the Compute Engine logs (ce.log) in SonarQube and compare the timestamps when the processing of each report started/finish with the pipeline timing out in jenkins?