Builds no longer waiting on publish with the 4.7.0 version of the vNext tasks

Hi,

Not sure if this is a bug but after the update to 4.7.0 the task “Publish Quality Gate Result” is no longer waiting until the request to our local sonarqube is finished.

Why this breaks our builds?
We query some information from the api of our on-site SonarQube instance after the task has finished. The rest call we are calling is SONARQUBEINSTANCE/api/ce/task?id=ID. We do this to get the analysis ID. This is a field that is not available if the task is still “IN PROGRESS”. Which is why we require the buils to wait until the publish is finished.

We get the following logging of the publish task: Publish Task Logging.txt (37.4 KB) I had to include it as a txt file because of the char limit.

You can see we get an html page at the end This might be why the task is not waiting. Any idea what could be causing this? We have an on-site version of Team foundation server but our build machines should all be able to access this.

In any case, thanks in advance for your help, I look forward to see this resolved.

Hi,

Could you please provide us the Run Code Analysis task log as well please ? No need for the full log, just, let’s say, the 50 last lines.

Thanks.

Hi,

2019-08-14T08:32:15.6252697Z 10:32:15.609 DEBUG: Not enough content in 'Program.cs' to have CPD blocks, it will not be part of the duplication detection
2019-08-14T08:32:15.6252697Z 10:32:15.625 INFO: Importing results from 6 proto files in 'c:\_builds\Agent1-WS45474\_work\15\.sonarqube\out\7\output-cs'
2019-08-14T08:32:15.6252697Z 10:32:15.625 INFO: Importing results from 6 proto files in 'c:\_builds\Agent1-WS45474\_work\15\.sonarqube\out\0\output-cs'
2019-08-14T08:32:15.6252697Z 10:32:15.625 DEBUG: Not enough content in 'Enum/AlertSeverity.cs' to have CPD blocks, it will not be part of the duplication detection
2019-08-14T08:32:15.6252697Z 10:32:15.625 DEBUG: Not enough content in 'MakeViewingArticleObsoleteDto.cs' to have CPD blocks, it will not be part of the duplication detection
2019-08-14T08:32:15.6252697Z 10:32:15.625 DEBUG: Not enough content in 'SendParallelModeArticleCreatedDto.cs' to have CPD blocks, it will not be part of the duplication detection
2019-08-14T08:32:15.6252697Z 10:32:15.625 INFO: Importing results from 6 proto files in 'c:\_builds\Agent1-WS45474\_work\15\.sonarqube\out\33\output-cs'
2019-08-14T08:32:15.8127913Z 10:32:15.812 INFO: Importing results from 6 proto files in 'c:\_builds\Agent1-WS45474\_work\15\.sonarqube\out\8\output-cs'
2019-08-14T08:32:15.8127913Z 10:32:15.812 DEBUG: Not enough content in 'ArticleDbConfiguration.cs' to have CPD blocks, it will not be part of the duplication detection
2019-08-14T08:32:15.8127913Z 10:32:15.812 INFO: Importing results from 6 proto files in 'c:\_builds\Agent1-WS45474\_work\15\.sonarqube\out\2\output-cs'
2019-08-14T08:32:15.8284164Z 10:32:15.828 INFO: Importing results from 6 proto files in 'c:\_builds\Agent1-WS45474\_work\15\.sonarqube\out\52\output-cs'
2019-08-14T08:32:21.2352487Z 10:32:21.235 INFO: Importing 53 Roslyn reports
2019-08-14T08:32:22.6416489Z 10:32:22.641 INFO: Sensor C# [csharp] (done) | time=8626ms
2019-08-14T08:32:22.6416489Z 10:32:22.641 INFO: Sensor Zero Coverage Sensor
2019-08-14T08:32:22.7979142Z 10:32:22.797 INFO: Sensor Zero Coverage Sensor (done) | time=156ms
2019-08-14T08:32:22.7979142Z 10:32:22.797 INFO: Sensor CPD Block Indexer
2019-08-14T08:32:22.7979142Z 10:32:22.797 DEBUG: org.sonar.scanner.cpd.deprecated.DefaultCpdBlockIndexer is used for cs
2019-08-14T08:32:22.7979142Z 10:32:22.797 DEBUG: No CpdMapping for language cs
2019-08-14T08:32:22.7979142Z 10:32:22.797 INFO: Sensor CPD Block Indexer (done) | time=0ms
2019-08-14T08:32:22.7979142Z 10:32:22.797 INFO: No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
2019-08-14T08:32:22.8135407Z 10:32:22.813 INFO: 202 files had no CPD blocks
2019-08-14T08:32:22.8135407Z 10:32:22.813 INFO: Calculating CPD for 550 files

... Lots of debug statements

2019-08-14T08:32:26.3764231Z 10:32:26.376 DEBUG: 'Code/Server/AMAL.RestServices/Config/ResourceManager.xml' generated metadata  with charset 'UTF-8'
2019-08-14T08:32:26.3764231Z 10:32:26.376 DEBUG: 'Code/Server/AMAL.RestServices/Config/GlobalParameterTable.xml' generated metadata  with charset 'UTF-8'
2019-08-14T08:32:26.3920503Z 10:32:26.392 DEBUG: 'Code/Server/AMAL.RestServices/Config/WindsorObjectBuilder.xml' generated metadata  with charset 'UTF-8'
2019-08-14T08:32:26.6108255Z 10:32:26.610 DEBUG: 'Code/Server/Article.AMAL.BusHandlers/Config/ActionBlocks.xml' generated metadata  with charset 'UTF-8'
2019-08-14T08:32:26.6264503Z 10:32:26.626 DEBUG: 'Code/Server/Article.AMAL.BusHandlers/Config/GlobalParameterTable.xml' generated metadata  with charset 'UTF-8'
2019-08-14T08:32:26.6264503Z 10:32:26.626 DEBUG: 'Code/Server/Article.AMAL.BusHandlers/Config/ResourceManager.xml' generated metadata  with charset 'UTF-8'
2019-08-14T08:32:26.6264503Z 10:32:26.626 DEBUG: 'Code/Server/Article.AMAL.BusHandlers/Config/WindsorObjectBuilder.xml' generated metadata  with charset 'UTF-8'
2019-08-14T08:32:26.8139704Z 10:32:26.813 DEBUG: 'Code/Server/Article.RestServices/Config/ActionBlocks.xml' generated metadata  with charset 'UTF-8'
2019-08-14T08:32:26.8139704Z 10:32:26.813 DEBUG: 'Code/Server/Article.RestServices/Config/GlobalParameterTable.xml' generated metadata  with charset 'UTF-8'
2019-08-14T08:32:26.8139704Z 10:32:26.813 DEBUG: 'Code/Server/Article.RestServices/Config/ResourceManager.xml' generated metadata  with charset 'UTF-8'
2019-08-14T08:32:26.8139704Z 10:32:26.813 DEBUG: 'Code/Server/Article.RestServices/Config/WindsorObjectBuilder.xml' generated metadata  with charset 'UTF-8'
2019-08-14T08:32:36.7369101Z 10:32:36.736 INFO: Analysis report generated in 12064ms, dir size=6 MB
2019-08-14T08:32:44.2377200Z 10:32:44.237 INFO: Analysis reports compressed in 7501ms, zip size=3 MB
2019-08-14T08:32:44.2377200Z 10:32:44.237 INFO: Analysis report generated in c:\_builds\Agent1-WS45474\_work\15\.sonarqube\out\.sonar\scanner-report
2019-08-14T08:32:44.2377200Z 10:32:44.237 DEBUG: Upload report
2019-08-14T08:32:44.7065146Z 10:32:44.706 DEBUG: POST 200 http://wfsonarprod.sidmar.be:9000/api/ce/submit?projectKey=SCORD-ARTICLE-1512&projectName=Concerto.Order%20-%20SCORD-ARTICLE | time=469ms
2019-08-14T08:32:44.7065146Z 10:32:44.706 INFO: Analysis report uploaded in 469ms
2019-08-14T08:32:44.7065146Z 10:32:44.706 INFO: ANALYSIS SUCCESSFUL, you can browse http://wfsonarprod.sidmar.be:9000/dashboard/index/SCORD-ARTICLE-1512
2019-08-14T08:32:44.7065146Z 10:32:44.706 INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
2019-08-14T08:32:44.7065146Z 10:32:44.706 INFO: More about the report processing at http://wfsonarprod.sidmar.be:9000/api/ce/task?id=AWyPQgZBZTH6Vt1JNmqH
2019-08-14T08:32:44.7065146Z 10:32:44.706 DEBUG: Report metadata written to c:\_builds\Agent1-WS45474\_work\15\.sonarqube\out\.sonar\report-task.txt
2019-08-14T08:32:44.7065146Z 10:32:44.706 DEBUG: Post-jobs : 
2019-08-14T08:32:44.7221420Z 10:32:44.722 INFO: Task total time: 37.301 s
2019-08-14T08:32:44.7846496Z 10:32:44.784 INFO: ------------------------------------------------------------------------
2019-08-14T08:32:44.7846496Z 10:32:44.784 INFO: EXECUTION SUCCESS
2019-08-14T08:32:44.7846496Z 10:32:44.784 INFO: ------------------------------------------------------------------------
2019-08-14T08:32:44.7846496Z 10:32:44.784 INFO: Total time: 38.410s
2019-08-14T08:32:44.8471539Z 10:32:44.847 INFO: Final Memory: 17M/513M
2019-08-14T08:32:44.8471539Z 10:32:44.847 INFO: ------------------------------------------------------------------------
2019-08-14T08:32:44.8471539Z ##[error]Picked up _JAVA_OPTIONS: -Xmx1g
2019-08-14T08:32:44.8471539Z ##[debug]Processed: ##vso[task.logissue type=error;]Picked up _JAVA_OPTIONS: -Xmx1g
2019-08-14T08:32:44.8471539Z Picked up _JAVA_OPTIONS: -Xmx1g
2019-08-14T08:32:44.9252896Z Process returned exit code 0
2019-08-14T08:32:44.9252896Z The SonarQube Scanner has finished
2019-08-14T08:32:44.9252896Z 10:32:44.925  Post-processing succeeded.
2019-08-14T08:32:44.9409143Z ##[debug]rc:0
2019-08-14T08:32:44.9409143Z ##[debug]success:true
2019-08-14T08:32:44.9409143Z ##[section]Finishing: Run Code Analysis

Thanks for the reply!

Thanks.

So the report keeps being generated in its old location.

Could you make sure that the Prepare analysis Configuration task is in version 4.7.0 as well ?

Prepare Analysis Configuration: 4.7.1
Run Code Analysis: 4.6.3
Publish Quality Gate Result: 4.7.0

Which seems weird to me that these are different

Hi,

Yes the Run Code Analysis task implementation hasn’t change, so same for the version.

But that’s kind of weird.

Do you maybe have the possibility to delete all three SonarQube… folder under <your agent folder_tasks (warning it has all the previous versions of the tasks)

So that the next build will correctly re download newest versions.

Thanks

Hi, I have removed the tasks from our build agent. I have confirmed that the latest versions are now on the agent.

At this time:

Prepare Analysis Configuration: 4.7.2
Run Code Analysis: 4.6.3
Publish Quality Gate Result: 4.7.0

I still get the same behavior though.

Same behaviour here. Nothing gets published to the Azure Devops Build results blade, were previously appeared SQ analysis report s