SonarQubeBuildSummary.md file empty with the "Publish Quality Gate Result" step in Azure Devops

The “Publish Quality gate Result” task in Azure Devops is creating an empty file as of version 4.7.0.

  • SonarQube version: 7.5(build 20543)
  • Azure Devops Server version: 17.143.28511.3

Log:

2019-08-20T06:37:25.7681685Z ##[debug][SQ] API GET: ‘/api/metrics/search’ with query “{“f”:“name”,“ps”:500}”

2019-08-20T06:37:25.8515807Z ##[debug]Response: 200 Body: “{“metrics”:[{“id”:“115”,“key”:“new_technical_debt”,“type”:“WORK_DUR”,“name”:“Added Technical Debt”},{“id”:“92”,“key”:“blocker_violations”,“type”:“INT”,“name”:“Blocker Issues”},{“id”:“62”,“key”:“new_it_conditions_to_cover”,“type”:“INT”,“name”:“Branches to Cover by IT on New Code”},{“id”:“110”,“key”:“bugs”,“type”:“INT”,“name”:“Bugs”},{“id”:“134”,“key”:“burned_budget”,“type”:“FLOAT”,“name”:“Burned budget”},{“id”:“135”,“key”:“business_value”,“type”:“FLOAT”,“name”:“Business value”},{“id”:“25”,“key”:“class_complexity_distribution”,“type”:“DISTRIB”,“name”:“Class Distribution / Complexity”},{“id”:“6”,“key”:“classes”,“type”:“INT”,“name”:“Classes”},{“id”:“108”,“key”:“code_smells”,“type”:“INT”,“name”:“Code Smells”},{“id”:“138”,“key”:“cognitive_complexity”,“type”:“INT”,“name”:“Cognitive Complexity”},{“id”:“14”,“key”:“comment_lines”,“type”:“INT”,“name”:“Comment Lines”},{“id”:“128”,“key”:“comment_lines_data”,“type”:“DATA”,“name”:“comment_lines_data”},{“id”:“18”,“key”:“commented_out_code_lines”,“type”:“INT”,“name”:“Commented-Out LOC”},{“id”:“15”,“key”:“comment_lines_density”,“type”:“PERCENT”,“name”:“Comments (%)”},{“id”:“22”,“key”:“class_complexity”,“type”:“FLOAT”,“name”:“Complexity / Class”},{“id”:“20”,“key”:“file_complexity”,“type”:“FLOAT”,“name”:“Complexity / File”},{“id”:“24”,“key”:“function_complexity”,“type”:“FLOAT”,“name”:“Complexity / Function”},{“id”:“21”,“key”:“complexity_in_classes”,“type”:“INT”,“name”:“Complexity in Classes”},{“id”:“23”,“key”:“complexity_in_functions”,“type”:“INT”,“name”:“Complexity in Functions”},{“id”:“48”,“key”:“branch_coverage”,“type”:“PERCENT”,“name”:“Condition Coverage”},{“id”:“66”,“key”:“new_it_branch_coverage”,“type”:“PERCENT”,“name”:“Condition Coverage by IT on New Code”},{“id”:“49”,“key”:“new_branch_coverage”,“type”:“PERCENT”,“name”:“Condition Coverage on New Code”},{“id”:“50”,“key”:“conditions_by_line”,“type”:“DATA”,“name”:“Conditions by Line”},{“id”:“44”,“key”:“conditions_to_cover”,“type”:“INT”,“name”:“Conditions to Cover”},{“id”:“45”,“key”:“new_conditions_to_cover”,“type”:“INT”,“name”:“Conditions to Cover on New Code”},{“id”:“107”,“key”:“confirmed_issues”,“type”:“INT”,“name”:“Confirmed Issues”},{“id”:“35”,“key”:“coverage”,“type”:“PERCENT”,“name”:“Coverage”},{“id”:“53”,“key”:“new_it_coverage”,“type”:“PERCENT”,“name”:“Coverage by IT on New Code”},{“id”:“43”,“key”:“coverage_line_hits_data”,“type”:“DATA”,“name”:“Coverage Hits by Line”},{“id”:“36”,“key”:“new_coverage”,“type”:“PERCENT”,“name”:“Coverage on New Code”},{“id”:“51”,“key”:“covered_conditions_by_line”,“type”:“DATA”,“name”:“Covered Conditions by Line”},{“id”:“93”,“key”:“critical_violations”,“type”:“INT”,“name”:“Critical Issues”},{“id”:“19”,“key”:“complexity”,“type”:“INT”,“name”:“Cyclomatic Complexity”},{“id”:“133”,“key”:“last_commit_date”,“type”:“MILLISEC”,“name”:“Date of Last Commit”},{“id”:“117”,“key”:“development_cost”,“type”:“STRING”,“name”:“Development Cost”},{“id”:“145”,“key”:“new_development_cost”,“type”:“STRING”,“name”:“Development Cost on New Code”},{“id”:“8”,“key”:“directories”,“type”:“INT”,“name”:“Directories”},{“id”:“87”,“key”:“duplicated_blocks”,“type”:“INT”,“name”:“Duplicated Blocks”},{“id”:“140”,“key”:“new_duplicated_blocks”,“type”:“INT”,“name”:“Duplicated Blocks on New Code”},{“id”:“88”,“key”:“duplicated_files”,“type”:“INT”,“name”:“Duplicated Files”},{“id”:“86”,“key”:“duplicated_lines”,“type”:“INT”,“name”:“Duplicated Lines”},{“id”:“89”,“key”:“duplicated_lines_density”,“type”:“PERCENT”,“name”:“Duplicated Lines (%)”},{“id”:“139”,“key”:“new_duplicated_lines”,“type”:“INT”,“name”:“Duplicated Lines on New Code”},{“id”:“141”,“key”:“new_duplicated_lines_density”,“type”:“PERCENT”,“name”:“Duplicated Lines on New Code (%)”},{“id”:“90”,“key”:“duplications_data”,“type”:“DATA”,“name”:“Duplication Details”},{“id”:“120”,“key”:“effort_to_reach_maintainability_rating_a”,“type”:“WORK_DUR”,“name”:“Effort to Reach Maintainability Rating A”},{“id”:“129”,“key”:“executable_lines_data”,“type”:“DATA”,“name”:“executable_lines_data”},{“id”:“103”,“key”:“false_positive_issues”,“type”:“INT”,“name”:“False Positive Issues”},{“id”:“27”,“key”:“file_complexity_distribution”,“type”:“DISTRIB”,“name”:“File Distribution / Complexity”},{“id”:“7”,“key”:“files”,“type”:“INT”,“name”:“Files”},{“id”:“26”,“key”:“function_complexity_distribution”,“type”:“DISTRIB”,“name”:“Function Distribution / Complexity”},{“id”:“9”,“key”:“functions”,“type”:“INT”,“name”:“Functions”},{“id”:“2”,“key”:“generated_lines”,“type”:“INT”,“name”:“Generated Lines”},{“id”:“5”,“key”:“generated_ncloc”,“type”:“INT”,“name”:“Generated Lines of Code”},{“id”:“96”,“key”:“info_violations”,“type”:“INT”,“name”:“Info Issues”},{“id”:“91”,“key”:“violations”,“type”:“INT”,“name”:“Issues”},{“id”:“61”,“key”:“it_conditions_to_cover”,“type”:“INT”,“name”:“IT Branches to Cover”},{“id”:“65”,“key”:“it_branch_coverage”,“type”:“PERCENT”,“name”:“IT Condition Coverage”},{“id”:“67”,“key”:“it_conditions_by_line”,“type”:“DATA”,“name”:“IT Conditions by Line”},{“id”:“52”,“key”:“it_coverage”,“type”:“PERCENT”,“name”:“IT Coverage”},{“id”:“60”,“key”:“it_coverage_line_hits_data”,“type”:“DATA”,“name”:“IT Coverage Hits by Line”},{“id”:“68”,“key”:“it_covered_conditions_by_line”,“type”:“DATA”,“name”:“IT Covered Conditions by Line”},{“id”:“58”,“key”:“it_line_coverage”,“type”:“PERCENT”,“name”:“IT Line Coverage”},{“id”:“54”,“key”:“it_lines_to_cover”,“type”:“INT”,“name”:“IT Lines to Cover”},{“id”:“63”,“key”:“it_uncovered_conditions”,“type”:“INT”,“name”:“IT Uncovered Conditions”},{“id”:“56”,“key”:“it_uncovered_lines”,“type”:“INT”,“name”:“IT Uncovered Lines”},{“id”:“41”,“key”:“line_coverage”,“type”:“PERCENT”,“name”:“Line Coverage”},{“id”:“59”,“key”:“new_it_line_coverage”,“type”:“PERCENT”,“name”:“Line Coverage by IT on New Code”},{“id”:“42”,“key”:“new_line_coverage”,“type”:“PERCENT”,“name”:“Line Coverage on New Code”},{“id”:“1”,“key”:“lines”,“type”:“INT”,“name”:“Lines”},{“id”:“3”,“key”:“ncloc”,“type”:“INT”,“name”:“Lines of Code”},{“id”:“4”,“key”:“ncloc_language_distribution”,“type”:“DATA”,“name”:“Lines of Code Per Language”},{“id”:“37”,“key”:“lines_to_cover”,“type”:“INT”,“name”:“Lines to Cover”},{“id”:“55”,“key”:“new_it_lines_to_cover”,“type”:“INT”,“name”:“Lines to Cover by IT on New Code”},{“id”:“38”,“key”:“new_lines_to_cover”,“type”:“INT”,“name”:“Lines to Cover on New Code”},{“id”:“116”,“key”:“sqale_rating”,“type”:“RATING”,“name”:“Maintainability Rating”},{“id”:“142”,“key”:“new_maintainability_rating”,“type”:“RATING”,“name”:“Maintainability Rating on New Code”},{“id”:“94”,“key”:“major_violations”,“type”:“INT”,“name”:“Major Issues”},{“id”:“95”,“key”:“minor_violations”,“type”:“INT”,“name”:“Minor Issues”},{“id”:“127”,“key”:“ncloc_data”,“type”:“DATA”,“name”:“ncloc_data”},{“id”:“98”,“key”:“new_blocker_violations”,“type”:“INT”,“name”:“New Blocker Issues”},{“id”:“111”,“key”:“new_bugs”,“type”:“INT”,“name”:“New Bugs”},{“id”:“109”,“key”:“new_code_smells”,“type”:“INT”,“name”:“New Code Smells”},{“id”:“99”,“key”:“new_critical_violations”,“type”:“INT”,“name”:“New Critical Issues”},{“id”:“102”,“key”:“new_info_violations”,“type”:“INT”,“name”:“New Info Issues”},{“id”:“97”,“key”:“new_violations”,“type”:“INT”,“name”:“New Issues”},{“id”:“137”,“key”:“new_lines”,“type”:“INT”,“name”:“New Lines”},{“id”:“100”,“key”:“new_major_violations”,“type”:“INT”,“name”:“New Major Issues”},{“id”:“101”,“key”:“new_minor_violations”,“type”:“INT”,“name”:“New Minor Issues”},{“id”:“113”,“key”:“new_vulnerabilities”,“type”:“INT”,“name”:“New Vulnerabilities”},{“id”:“105”,“key”:“open_issues”,“type”:“INT”,“name”:“Open Issues”},{“id”:“78”,“key”:“overall_conditions_to_cover”,“type”:“INT”,“name”:“Overall Branches to Cover”},{“id”:“79”,“key”:“new_overall_conditions_to_cover”,“type”:“INT”,“name”:“Overall Branches to Cover on New Code”},{“id”:“82”,“key”:“overall_branch_coverage”,“type”:“PERCENT”,“name”:“Overall Condition Coverage”},{“id”:“83”,“key”:“new_overall_branch_coverage”,“type”:“PERCENT”,“name”:“Overall Condition Coverage on New Code”},{“id”:“84”,“key”:“overall_conditions_by_line”,“type”:“DATA”,“name”:“Overall Conditions by Line”},{“id”:“69”,“key”:“overall_coverage”,“type”:“PERCENT”,“name”:“Overall Coverage”},{“id”:“77”,“key”:“overall_coverage_line_hits_data”,“type”:“DATA”,“name”:“Overall Coverage Hits by Line”},{“id”:“70”,“key”:“new_overall_coverage”,“type”:“PERCENT”,“name”:“Overall Coverage on New Code”},{“id”:“85”,“key”:“overall_covered_conditions_by_line”,“type”:“DATA”,“name”:“Overall Covered Conditions by Line”},{“id”:“75”,“key”:“overall_line_coverage”,“type”:“PERCENT”,“name”:“Overall Line Coverage”},{“id”:“76”,“key”:“new_overall_line_coverage”,“type”:“PERCENT”,“name”:“Overall Line Coverage on New Code”},{“id”:“71”,“key”:“overall_lines_to_cover”,“type”:“INT”,“name”:“Overall Lines to Cover”},{“id”:“72”,“key”:“new_overall_lines_to_cover”,“type”:“INT”,“name”:“Overall Lines to Cover on New Code”},{“id”:“80”,“key”:“overall_uncovered_conditions”,“type”:“INT”,“name”:“Overall Uncovered Conditions”},{“id”:“81”,“key”:“new_overall_uncovered_conditions”,“type”:“INT”,“name”:“Overall Uncovered Conditions on New Code”},{“id”:“73”,“key”:“overall_uncovered_lines”,“type”:“INT”,“name”:“Overall Uncovered Lines”},{“id”:“74”,“key”:“new_overall_uncovered_lines”,“type”:“INT”,“name”:“Overall Uncovered Lines on New Code”},{“id”:“132”,“key”:“quality_profiles”,“type”:“DATA”,“name”:“Profiles”},{“id”:“13”,“key”:“projects”,“type”:“INT”,“name”:“Projects”},{“id”:“12”,“key”:“public_api”,“type”:“INT”,“name”:“Public API”},{“id”:“16”,“key”:“public_documented_api_density”,“type”:“PERCENT”,“name”:“Public Documented API (%)”},{“id”:“17”,“key”:“public_undocumented_api”,“type”:“INT”,“name”:“Public Undocumented API”},{“id”:“131”,“key”:“quality_gate_details”,“type”:“DATA”,“name”:“Quality Gate Details”},{“id”:“130”,“key”:“alert_status”,“type”:“LEVEL”,“name”:“Quality Gate Status”},{“id”:“123”,“key”:“reliability_rating”,“type”:“RATING”,“name”:“Reliability Rating”},{“id”:“143”,“key”:“new_reliability_rating”,“type”:“RATING”,“name”:“Reliability Rating on New Code”},{“id”:“121”,“key”:“reliability_remediation_effort”,“type”:“WORK_DUR”,“name”:“Reliability Remediation Effort”},{“id”:“122”,“key”:“new_reliability_remediation_effort”,“type”:“WORK_DUR”,“name”:“Reliability Remediation Effort on New Code”},{“id”:“106”,“key”:“reopened_issues”,“type”:“INT”,“name”:“Reopened Issues”},{“id”:“126”,“key”:“security_rating”,“type”:“RATING”,“name”:“Security Rating”},{“id”:“144”,“key”:“new_security_rating”,“type”:“RATING”,“name”:“Security Rating on New Code”},{“id”:“124”,“key”:“security_remediation_effort”,“type”:“WORK_DUR”,“name”:“Security Remediation Effort”},{“id”:“125”,“key”:“new_security_remediation_effort”,“type”:“WORK_DUR”,“name”:“Security Remediation Effort on New Code”},{“id”:“31”,“key”:“skipped_tests”,“type”:“INT”,“name”:“Skipped Unit Tests”},{“id”:“146”,“key”:“sonarjava_feedback”,“type”:“DATA”,“name”:“SonarJava feedback”},{“id”:“11”,“key”:“statements”,“type”:“INT”,“name”:“Statements”},{“id”:“136”,“key”:“team_size”,“type”:“INT”,“name”:“Team size”},{“id”:“114”,“key”:“sqale_index”,“type”:“WORK_DUR”,“name”:“Technical Debt”},{“id”:“118”,“key”:“sqale_debt_ratio”,“type”:“PERCENT”,“name”:“Technical Debt Ratio”},{“id”:“119”,“key”:“new_sqale_debt_ratio”,“type”:“PERCENT”,“name”:“Technical Debt Ratio on New Code”},{“id”:“46”,“key”:“uncovered_conditions”,“type”:“INT”,“name”:“Uncovered Conditions”},{“id”:“64”,“key”:“new_it_uncovered_conditions”,“type”:“INT”,“name”:“Uncovered Conditions by IT on New Code”},{“id”:“47”,“key”:“new_uncovered_conditions”,“type”:“INT”,“name”:“Uncovered Conditions on New Code”},{“id”:“39”,“key”:“uncovered_lines”,“type”:“INT”,“name”:“Uncovered Lines”},{“id”:“57”,“key”:“new_it_uncovered_lines”,“type”:“INT”,“name”:“Uncovered Lines by IT on New Code”},{“id”:“40”,“key”:“new_uncovered_lines”,“type”:“INT”,“name”:“Uncovered Lines on New Code”},{“id”:“34”,“key”:“test_data”,“type”:“DATA”,“name”:“Unit Test Details”},{“id”:“29”,“key”:“test_execution_time”,“type”:“MILLISEC”,“name”:“Unit Test Duration”},{“id”:“30”,“key”:“test_errors”,“type”:“INT”,“name”:“Unit Test Errors”},{“id”:“32”,“key”:“test_failures”,“type”:“INT”,“name”:“Unit Test Failures”},{“id”:“33”,“key”:“test_success_density”,“type”:“PERCENT”,“name”:“Unit Test Success (%)”},{“id”:“28”,“key”:“tests”,“type”:“INT”,“name”:“Unit Tests”},{“id”:“112”,“key”:“vulnerabilities”,“type”:“INT”,“name”:“Vulnerabilities”},{“id”:“104”,“key”:“wont_fix_issues”,“type”:“INT”,“name”:“Won’t Fix Issues”}],“total”:145,“p”:1,“ps”:500}”

2019-08-20T06:37:25.8524192Z ##[debug]pollingTimeoutSec=300

2019-08-20T06:37:25.8524528Z ##[debug]Build.BuildNumber=20190820.1

2019-08-20T06:37:25.8524835Z ##[debug]Agent.TempDirectory=E:\AzureDevOpsAgent\A1_work_temp

2019-08-20T06:37:25.8530790Z ##[debug]defaultRoot: ‘E:\AzureDevOpsAgent\A1_work_temp’

2019-08-20T06:37:25.8532241Z ##[debug]findOptions.allowBrokenSymbolicLinks: ‘false’

2019-08-20T06:37:25.8532660Z ##[debug]findOptions.followSpecifiedSymbolicLink: ‘true’

2019-08-20T06:37:25.8532967Z ##[debug]findOptions.followSymbolicLinks: ‘true’

2019-08-20T06:37:25.8534465Z ##[debug]matchOptions.debug: ‘false’

2019-08-20T06:37:25.8534861Z ##[debug]matchOptions.nobrace: ‘true’

2019-08-20T06:37:25.8535152Z ##[debug]matchOptions.noglobstar: ‘false’

2019-08-20T06:37:25.8535650Z ##[debug]matchOptions.dot: ‘true’

2019-08-20T06:37:25.8535937Z ##[debug]matchOptions.noext: ‘false’

2019-08-20T06:37:25.8536548Z ##[debug]matchOptions.nocase: ‘true’

2019-08-20T06:37:25.8536816Z ##[debug]matchOptions.nonull: ‘false’

2019-08-20T06:37:25.8537198Z ##[debug]matchOptions.matchBase: ‘false’

2019-08-20T06:37:25.8537616Z ##[debug]matchOptions.nocomment: ‘false’

2019-08-20T06:37:25.8537997Z ##[debug]matchOptions.nonegate: ‘false’

2019-08-20T06:37:25.8538266Z ##[debug]matchOptions.flipNegate: ‘false’

2019-08-20T06:37:25.8539053Z ##[debug]pattern: ‘sonar\20190820.1**\report-task.txt’

2019-08-20T06:37:25.8579222Z ##[debug]findPath: ‘E:\AzureDevOpsAgent\A1_work_temp\sonar\20190820.1’

2019-08-20T06:37:25.8582889Z ##[debug]statOnly: ‘false’

2019-08-20T06:37:25.8585081Z ##[debug]findPath: ‘E:\AzureDevOpsAgent\A1_work_temp\sonar\20190820.1’

2019-08-20T06:37:25.8585470Z ##[debug]findOptions.allowBrokenSymbolicLinks: ‘false’

2019-08-20T06:37:25.8585774Z ##[debug]findOptions.followSpecifiedSymbolicLink: ‘true’

2019-08-20T06:37:25.8586177Z ##[debug]findOptions.followSymbolicLinks: ‘true’

2019-08-20T06:37:25.8586776Z ##[debug]0 results

2019-08-20T06:37:25.8587253Z ##[debug]found 0 paths

2019-08-20T06:37:25.8587569Z ##[debug]applying include pattern

2019-08-20T06:37:25.8587891Z ##[debug]adjustedPattern: ‘E:\AzureDevOpsAgent\A1_work_temp\sonar\20190820.1**\report-task.txt’

2019-08-20T06:37:25.8600056Z ##[debug]0 matches

2019-08-20T06:37:25.8600557Z ##[debug]0 final results

2019-08-20T06:37:25.8600876Z ##[debug][SQ] Searching for sonar\20190820.1**\report-task.txt - found 0 file(s)

2019-08-20T06:37:25.8601180Z ##[debug]Number of analyses in this build: 0

2019-08-20T06:37:25.8601464Z ##[debug]Overall Quality Gate status: ok

2019-08-20T06:37:25.8602218Z ##[debug]System.TeamFoundationCollectionUri=https://tfs-acc.alm.engie-electrabel.be/tfs/MS_Belux/

2019-08-20T06:37:25.8602841Z ##[debug]System.TeamProjectId=1575200c-b794-499d-b1e8-e2c8fd2ccde1

2019-08-20T06:37:25.8603394Z ##[debug]Build.BuildId=32619

2019-08-20T06:37:25.8612107Z ##[debug][{“op”:“add”,“path”:"/sonarglobalqualitygate",“value”:“ok”}]

2019-08-20T06:37:25.8631996Z SYSTEMVSSCONNECTION exists true

2019-08-20T06:37:25.8632374Z ##[debug]SYSTEMVSSCONNECTION exists true

2019-08-20T06:37:25.8652490Z ##[debug]build.artifactStagingDirectory=E:\AzureDevOpsAgent\A1_work\50\a

2019-08-20T06:37:25.8667799Z ##[debug][SQ] Summary saved at: E:\AzureDevOpsAgent\A1_work\50\a.sqAnalysis\SonarQubeBuildSummary.md

2019-08-20T06:37:25.8668358Z ##[debug][SQ] Uploading build summary from E:\AzureDevOpsAgent\A1_work\50\a.sqAnalysis\SonarQubeBuildSummary.md

2019-08-20T06:37:25.8689978Z ##[debug]Processed: ##vso[task.addattachment type=Distributedtask.Core.Summary;name=SonarQube Analysis Report;]E:\AzureDevOpsAgent\A1_work\50\a.sqAnalysis\SonarQubeBuildSummary.md

2019-08-20T06:37:25.9033842Z ##[debug]Response: 200 Body: “”{“count”:1,“value”:{“sonarglobalqualitygate”:{"$type":“System.String”,"$value":“ok”}}}""

2019-08-20T06:37:25.9100769Z ##[section]Finishing: Publish Quality Gate Result
‘’’

Hi!

We have the same problem here.

We had to rollback to the version 4.6.3 of the Azure DevOps plugin, in order to be able to use SonarQube on our pipeline.

If there is some workaround, we will be pleased to know it!

We think that the problem has to be in relation with this into the task Run Analysis :
The folder below isn’t created…
Analysis report generated in D:\BuildAgents…_work\6.sonarqube\out.sonar\batch-report

And into the task Publish Quality Gate Result :
We see that it doesn’t find anything to analyse and this lines of debug didn’t exist in previous version.
2019-08-19T15:37:52.1486183Z ##[debug][SQ] Searching for sonar<my_build>**\report-task.txt - found 0 file(s)
2019-08-19T15:37:52.1495048Z ##[debug]Number of analyses in this build: 0
2019-08-19T15:37:52.1495500Z ##[debug]Overall Quality Gate status: ok

Thanks,
Julien

We’re having the same issue. With the md-file being empty all other Summarys sent to Azure Devops will not be rendered either.

The new version (4.7.x) is looking here:
##[debug]adjustedPattern: 'C:\AzureDevops\Agent2-GCS-Docker\_work\_temp\sonar\199416\**\report-task.txt’

But the file is still located here:
##[debug]adjustedPattern: 'C:\AzureDevops\Agent2-GCS-Docker\_work\10\**\report-task.tx’

Br Jörgen

We have the same issue, with the following versions

  • SonarQube: 7.9.1 (Running on Java 11.0.3, SQL Server 2016 13.0.05101.9)
  • dotnet-sonarscanner: 4.6.2
  • TFS 2017 Update 3 (15.117.27024.0)
  • Sonar Plugin: 4.7.0

According to issue https://jira.sonarsource.com/browse/VSTS-213 this bug should have been resolved, but after installing the sonarqube extension (v4.8) on our Azure Devops environment, we still experiencing the same problem.

Could somebody confirm this issue has not been resolved?

Versions:

  • Sonarqube 7.5
  • Azure Devops server 2019
  • SonarQube plugin 4.8

Hi,

Could you make sure that, in debug mode of the build, you have the following log in the Prepare Analysis Task ?

“SonarCloud or SonarQube version >= 7.2.0 detected, setting report-task.txt file to its newest location.”

Thank you.

Just verified my log and the specific entry is abailable in the log:
2019-10-03T09:27:39.4591527Z ##[debug]SonarCloud or SonarQube version >= 7.2.0 detected, setting report-task.txt file to its newest location.
I found this entry in the log off the “prepare analysis on SonarQube” task (version 4.8.0)

Thank you.

Could you please post me the logs for the Run Code Analysis and Publish Quality Gate Result, still in debug as well ?

There is no Run code analysis log, as we use a custom ant script to run the analysis.

Publish Quality Gate Result:
2019-10-03T11:15:54.9398067Z ##[debug]Evaluating condition for step: ‘Publish Quality Gate Result’
2019-10-03T11:15:54.9398895Z ##[debug]Evaluating: succeeded()
2019-10-03T11:15:54.9399125Z ##[debug]Evaluating succeeded:
2019-10-03T11:15:54.9399414Z ##[debug]=> True
2019-10-03T11:15:54.9399698Z ##[debug]Result: True
2019-10-03T11:15:54.9400131Z ##[section]Starting: Publish Quality Gate Result
2019-10-03T11:15:54.9403845Z ==============================================================================
2019-10-03T11:15:54.9403997Z Task : Publish Quality Gate Result
2019-10-03T11:15:54.9404142Z Description : Publish SonarQube’s Quality Gate result on the Azure DevOps build result, to be used after the actual analysis.
2019-10-03T11:15:54.9404382Z Version : 4.8.0
2019-10-03T11:15:54.9404485Z Author : sonarsource
2019-10-03T11:15:54.9404622Z Help : More Information
2019-10-03T11:15:54.9404841Z ==============================================================================
2019-10-03T11:15:55.2301423Z ##[debug]agent.TempDirectory=E:\AzureDevOpsAgent\A1_work_temp
2019-10-03T11:15:55.2331191Z ##[debug]loading inputs and endpoints
2019-10-03T11:15:55.2338495Z ##[debug]loading ENDPOINT_AUTH_PARAMETER_SYSTEMVSSCONNECTION_ACCESSTOKEN
2019-10-03T11:15:55.2350914Z ##[debug]loading ENDPOINT_AUTH_SCHEME_SYSTEMVSSCONNECTION
2019-10-03T11:15:55.2354494Z ##[debug]loading ENDPOINT_AUTH_SYSTEMVSSCONNECTION
2019-10-03T11:15:55.2356582Z ##[debug]loading INPUT_POLLINGTIMEOUTSEC
2019-10-03T11:15:55.2361369Z ##[debug]loading SECRET_SONARQUBE_ENDPOINT
2019-10-03T11:15:55.2363768Z ##[debug]loading SECRET_SONAR_LOGIN
2019-10-03T11:15:55.2365558Z ##[debug]loading SECRET_SONAR_PASSWORD
2019-10-03T11:15:55.2371108Z ##[debug]loaded 7
2019-10-03T11:15:55.2385663Z ##[debug]Agent.ProxyUrl=undefined
2019-10-03T11:15:55.2387274Z ##[debug]Agent.CAInfo=undefined
2019-10-03T11:15:55.2387621Z ##[debug]Agent.ClientCert=undefined
2019-10-03T11:15:55.2387871Z ##[debug]Agent.SkipCertValidation=undefined
2019-10-03T11:15:55.7735572Z ##[debug]SONARQUBE_SCANNER_PARAMS={“sonar.host.url”:“https://sonar-acc.alm.engie-electrabel.be/","sonar.login”:,“sonar.projectKey”:“TheNewEcoSystem Test”,“sonar.projectName”:“ImpulseTest”,“sonar.projectVersion”:“1.0”,“sonar.sources”:“E:\AzureDevOpsAgent\A1\_work\9\s”,“sonar.branch.name”:“Merge”,“sonar.scanner.metadataFilePath”:“E:\AzureDevOpsAgent\A1\_work\_temp\sonar\20191003.8\4de10f99-3de9-b92a-69fd-3dfc66655d14\report-task.txt”}
2019-10-03T11:15:55.7744636Z ##[debug]SONARQUBE_ENDPOINT=***
2019-10-03T11:15:55.7748900Z ##[debug][SQ] API GET: ‘/api/metrics/search’ with query “{“f”:“name”,“ps”:500}”
2019-10-03T11:15:55.8455979Z ##[debug]Response: 200 Body: “{“metrics”:[{“id”:“115”,“key”:“new_technical_debt”,“type”:“WORK_DUR”,“name”:“Added Technical Debt”},{“id”:“92”,“key”:“blocker_violations”,“type”:“INT”,“name”:“Blocker Issues”},{“id”:“62”,“key”:“new_it_conditions_to_cover”,“type”:“INT”,“name”:“Branches to Cover by IT on New Code”},{“id”:“110”,“key”:“bugs”,“type”:“INT”,“name”:“Bugs”},{“id”:“134”,“key”:“burned_budget”,“type”:“FLOAT”,“name”:“Burned budget”},{“id”:“135”,“key”:“business_value”,“type”:“FLOAT”,“name”:“Business value”},{“id”:“25”,“key”:“class_complexity_distribution”,“type”:“DISTRIB”,“name”:“Class Distribution / Complexity”},{“id”:“6”,“key”:“classes”,“type”:“INT”,“name”:“Classes”},{“id”:“108”,“key”:“code_smells”,“type”:“INT”,“name”:“Code Smells”},{“id”:“138”,“key”:“cognitive_complexity”,“type”:“INT”,“name”:“Cognitive Complexity”},{“id”:“14”,“key”:“comment_lines”,“type”:“INT”,“name”:“Comment Lines”},{“id”:“128”,“key”:“comment_lines_data”,“type”:“DATA”,“name”:“comment_lines_data”},{“id”:“18”,“key”:“commented_out_code_lines”,“type”:“INT”,“name”:“Commented-Out LOC”},{“id”:“15”,“key”:“comment_lines_density”,“type”:“PERCENT”,“name”:“Comments (%)”},{“id”:“22”,“key”:“class_complexity”,“type”:“FLOAT”,“name”:“Complexity / Class”},{“id”:“20”,“key”:“file_complexity”,“type”:“FLOAT”,“name”:“Complexity / File”},{“id”:“24”,“key”:“function_complexity”,“type”:“FLOAT”,“name”:“Complexity / Function”},{“id”:“21”,“key”:“complexity_in_classes”,“type”:“INT”,“name”:“Complexity in Classes”},{“id”:“23”,“key”:“complexity_in_functions”,“type”:“INT”,“name”:“Complexity in Functions”},{“id”:“48”,“key”:“branch_coverage”,“type”:“PERCENT”,“name”:“Condition Coverage”},{“id”:“66”,“key”:“new_it_branch_coverage”,“type”:“PERCENT”,“name”:“Condition Coverage by IT on New Code”},{“id”:“49”,“key”:“new_branch_coverage”,“type”:“PERCENT”,“name”:“Condition Coverage on New Code”},{“id”:“50”,“key”:“conditions_by_line”,“type”:“DATA”,“name”:“Conditions by Line”},{“id”:“44”,“key”:“conditions_to_cover”,“type”:“INT”,“name”:“Conditions to Cover”},{“id”:“45”,“key”:“new_conditions_to_cover”,“type”:“INT”,“name”:“Conditions to Cover on New Code”},{“id”:“107”,“key”:“confirmed_issues”,“type”:“INT”,“name”:“Confirmed Issues”},{“id”:“35”,“key”:“coverage”,“type”:“PERCENT”,“name”:“Coverage”},{“id”:“53”,“key”:“new_it_coverage”,“type”:“PERCENT”,“name”:“Coverage by IT on New Code”},{“id”:“43”,“key”:“coverage_line_hits_data”,“type”:“DATA”,“name”:“Coverage Hits by Line”},{“id”:“36”,“key”:“new_coverage”,“type”:“PERCENT”,“name”:“Coverage on New Code”},{“id”:“51”,“key”:“covered_conditions_by_line”,“type”:“DATA”,“name”:“Covered Conditions by Line”},{“id”:“93”,“key”:“critical_violations”,“type”:“INT”,“name”:“Critical Issues”},{“id”:“19”,“key”:“complexity”,“type”:“INT”,“name”:“Cyclomatic Complexity”},{“id”:“133”,“key”:“last_commit_date”,“type”:“MILLISEC”,“name”:“Date of Last Commit”},{“id”:“117”,“key”:“development_cost”,“type”:“STRING”,“name”:“Development Cost”},{“id”:“145”,“key”:“new_development_cost”,“type”:“STRING”,“name”:“Development Cost on New Code”},{“id”:“8”,“key”:“directories”,“type”:“INT”,“name”:“Directories”},{“id”:“87”,“key”:“duplicated_blocks”,“type”:“INT”,“name”:“Duplicated Blocks”},{“id”:“140”,“key”:“new_duplicated_blocks”,“type”:“INT”,“name”:“Duplicated Blocks on New Code”},{“id”:“88”,“key”:“duplicated_files”,“type”:“INT”,“name”:“Duplicated Files”},{“id”:“86”,“key”:“duplicated_lines”,“type”:“INT”,“name”:“Duplicated Lines”},{“id”:“89”,“key”:“duplicated_lines_density”,“type”:“PERCENT”,“name”:“Duplicated Lines (%)”},{“id”:“139”,“key”:“new_duplicated_lines”,“type”:“INT”,“name”:“Duplicated Lines on New Code”},{“id”:“141”,“key”:“new_duplicated_lines_density”,“type”:“PERCENT”,“name”:“Duplicated Lines on New Code (%)”},{“id”:“90”,“key”:“duplications_data”,“type”:“DATA”,“name”:“Duplication Details”},{“id”:“120”,“key”:“effort_to_reach_maintainability_rating_a”,“type”:“WORK_DUR”,“name”:“Effort to Reach Maintainability Rating A”},{“id”:“129”,“key”:“executable_lines_data”,“type”:“DATA”,“name”:“executable_lines_data”},{“id”:“103”,“key”:“false_positive_issues”,“type”:“INT”,“name”:“False Positive Issues”},{“id”:“27”,“key”:“file_complexity_distribution”,“type”:“DISTRIB”,“name”:“File Distribution / Complexity”},{“id”:“7”,“key”:“files”,“type”:“INT”,“name”:“Files”},{“id”:“26”,“key”:“function_complexity_distribution”,“type”:“DISTRIB”,“name”:“Function Distribution / Complexity”},{“id”:“9”,“key”:“functions”,“type”:“INT”,“name”:“Functions”},{“id”:“2”,“key”:“generated_lines”,“type”:“INT”,“name”:“Generated Lines”},{“id”:“5”,“key”:“generated_ncloc”,“type”:“INT”,“name”:“Generated Lines of Code”},{“id”:“96”,“key”:“info_violations”,“type”:“INT”,“name”:“Info Issues”},{“id”:“91”,“key”:“violations”,“type”:“INT”,“name”:“Issues”},{“id”:“61”,“key”:“it_conditions_to_cover”,“type”:“INT”,“name”:“IT Branches to Cover”},{“id”:“65”,“key”:“it_branch_coverage”,“type”:“PERCENT”,“name”:“IT Condition Coverage”},{“id”:“67”,“key”:“it_conditions_by_line”,“type”:“DATA”,“name”:“IT Conditions by Line”},{“id”:“52”,“key”:“it_coverage”,“type”:“PERCENT”,“name”:“IT Coverage”},{“id”:“60”,“key”:“it_coverage_line_hits_data”,“type”:“DATA”,“name”:“IT Coverage Hits by Line”},{“id”:“68”,“key”:“it_covered_conditions_by_line”,“type”:“DATA”,“name”:“IT Covered Conditions by Line”},{“id”:“58”,“key”:“it_line_coverage”,“type”:“PERCENT”,“name”:“IT Line Coverage”},{“id”:“54”,“key”:“it_lines_to_cover”,“type”:“INT”,“name”:“IT Lines to Cover”},{“id”:“63”,“key”:“it_uncovered_conditions”,“type”:“INT”,“name”:“IT Uncovered Conditions”},{“id”:“56”,“key”:“it_uncovered_lines”,“type”:“INT”,“name”:“IT Uncovered Lines”},{“id”:“41”,“key”:“line_coverage”,“type”:“PERCENT”,“name”:“Line Coverage”},{“id”:“59”,“key”:“new_it_line_coverage”,“type”:“PERCENT”,“name”:“Line Coverage by IT on New Code”},{“id”:“42”,“key”:“new_line_coverage”,“type”:“PERCENT”,“name”:“Line Coverage on New Code”},{“id”:“1”,“key”:“lines”,“type”:“INT”,“name”:“Lines”},{“id”:“3”,“key”:“ncloc”,“type”:“INT”,“name”:“Lines of Code”},{“id”:“4”,“key”:“ncloc_language_distribution”,“type”:“DATA”,“name”:“Lines of Code Per Language”},{“id”:“37”,“key”:“lines_to_cover”,“type”:“INT”,“name”:“Lines to Cover”},{“id”:“55”,“key”:“new_it_lines_to_cover”,“type”:“INT”,“name”:“Lines to Cover by IT on New Code”},{“id”:“38”,“key”:“new_lines_to_cover”,“type”:“INT”,“name”:“Lines to Cover on New Code”},{“id”:“116”,“key”:“sqale_rating”,“type”:“RATING”,“name”:“Maintainability Rating”},{“id”:“142”,“key”:“new_maintainability_rating”,“type”:“RATING”,“name”:“Maintainability Rating on New Code”},{“id”:“94”,“key”:“major_violations”,“type”:“INT”,“name”:“Major Issues”},{“id”:“95”,“key”:“minor_violations”,“type”:“INT”,“name”:“Minor Issues”},{“id”:“127”,“key”:“ncloc_data”,“type”:“DATA”,“name”:“ncloc_data”},{“id”:“98”,“key”:“new_blocker_violations”,“type”:“INT”,“name”:“New Blocker Issues”},{“id”:“111”,“key”:“new_bugs”,“type”:“INT”,“name”:“New Bugs”},{“id”:“109”,“key”:“new_code_smells”,“type”:“INT”,“name”:“New Code Smells”},{“id”:“99”,“key”:“new_critical_violations”,“type”:“INT”,“name”:“New Critical Issues”},{“id”:“102”,“key”:“new_info_violations”,“type”:“INT”,“name”:“New Info Issues”},{“id”:“97”,“key”:“new_violations”,“type”:“INT”,“name”:“New Issues”},{“id”:“137”,“key”:“new_lines”,“type”:“INT”,“name”:“New Lines”},{“id”:“100”,“key”:“new_major_violations”,“type”:“INT”,“name”:“New Major Issues”},{“id”:“101”,“key”:“new_minor_violations”,“type”:“INT”,“name”:“New Minor Issues”},{“id”:“113”,“key”:“new_vulnerabilities”,“type”:“INT”,“name”:“New Vulnerabilities”},{“id”:“105”,“key”:“open_issues”,“type”:“INT”,“name”:“Open Issues”},{“id”:“78”,“key”:“overall_conditions_to_cover”,“type”:“INT”,“name”:“Overall Branches to Cover”},{“id”:“79”,“key”:“new_overall_conditions_to_cover”,“type”:“INT”,“name”:“Overall Branches to Cover on New Code”},{“id”:“82”,“key”:“overall_branch_coverage”,“type”:“PERCENT”,“name”:“Overall Condition Coverage”},{“id”:“83”,“key”:“new_overall_branch_coverage”,“type”:“PERCENT”,“name”:“Overall Condition Coverage on New Code”},{“id”:“84”,“key”:“overall_conditions_by_line”,“type”:“DATA”,“name”:“Overall Conditions by Line”},{“id”:“69”,“key”:“overall_coverage”,“type”:“PERCENT”,“name”:“Overall Coverage”},{“id”:“77”,“key”:“overall_coverage_line_hits_data”,“type”:“DATA”,“name”:“Overall Coverage Hits by Line”},{“id”:“70”,“key”:“new_overall_coverage”,“type”:“PERCENT”,“name”:“Overall Coverage on New Code”},{“id”:“85”,“key”:“overall_covered_conditions_by_line”,“type”:“DATA”,“name”:“Overall Covered Conditions by Line”},{“id”:“75”,“key”:“overall_line_coverage”,“type”:“PERCENT”,“name”:“Overall Line Coverage”},{“id”:“76”,“key”:“new_overall_line_coverage”,“type”:“PERCENT”,“name”:“Overall Line Coverage on New Code”},{“id”:“71”,“key”:“overall_lines_to_cover”,“type”:“INT”,“name”:“Overall Lines to Cover”},{“id”:“72”,“key”:“new_overall_lines_to_cover”,“type”:“INT”,“name”:“Overall Lines to Cover on New Code”},{“id”:“80”,“key”:“overall_uncovered_conditions”,“type”:“INT”,“name”:“Overall Uncovered Conditions”},{“id”:“81”,“key”:“new_overall_uncovered_conditions”,“type”:“INT”,“name”:“Overall Uncovered Conditions on New Code”},{“id”:“73”,“key”:“overall_uncovered_lines”,“type”:“INT”,“name”:“Overall Uncovered Lines”},{“id”:“74”,“key”:“new_overall_uncovered_lines”,“type”:“INT”,“name”:“Overall Uncovered Lines on New Code”},{“id”:“132”,“key”:“quality_profiles”,“type”:“DATA”,“name”:“Profiles”},{“id”:“13”,“key”:“projects”,“type”:“INT”,“name”:“Projects”},{“id”:“12”,“key”:“public_api”,“type”:“INT”,“name”:“Public API”},{“id”:“16”,“key”:“public_documented_api_density”,“type”:“PERCENT”,“name”:“Public Documented API (%)”},{“id”:“17”,“key”:“public_undocumented_api”,“type”:“INT”,“name”:“Public Undocumented API”},{“id”:“131”,“key”:“quality_gate_details”,“type”:“DATA”,“name”:“Quality Gate Details”},{“id”:“130”,“key”:“alert_status”,“type”:“LEVEL”,“name”:“Quality Gate Status”},{“id”:“123”,“key”:“reliability_rating”,“type”:“RATING”,“name”:“Reliability Rating”},{“id”:“143”,“key”:“new_reliability_rating”,“type”:“RATING”,“name”:“Reliability Rating on New Code”},{“id”:“121”,“key”:“reliability_remediation_effort”,“type”:“WORK_DUR”,“name”:“Reliability Remediation Effort”},{“id”:“122”,“key”:“new_reliability_remediation_effort”,“type”:“WORK_DUR”,“name”:“Reliability Remediation Effort on New Code”},{“id”:“106”,“key”:“reopened_issues”,“type”:“INT”,“name”:“Reopened Issues”},{“id”:“126”,“key”:“security_rating”,“type”:“RATING”,“name”:“Security Rating”},{“id”:“144”,“key”:“new_security_rating”,“type”:“RATING”,“name”:“Security Rating on New Code”},{“id”:“124”,“key”:“security_remediation_effort”,“type”:“WORK_DUR”,“name”:“Security Remediation Effort”},{“id”:“125”,“key”:“new_security_remediation_effort”,“type”:“WORK_DUR”,“name”:“Security Remediation Effort on New Code”},{“id”:“31”,“key”:“skipped_tests”,“type”:“INT”,“name”:“Skipped Unit Tests”},{“id”:“146”,“key”:“sonarjava_feedback”,“type”:“DATA”,“name”:“SonarJava feedback”},{“id”:“11”,“key”:“statements”,“type”:“INT”,“name”:“Statements”},{“id”:“136”,“key”:“team_size”,“type”:“INT”,“name”:“Team size”},{“id”:“114”,“key”:“sqale_index”,“type”:“WORK_DUR”,“name”:“Technical Debt”},{“id”:“118”,“key”:“sqale_debt_ratio”,“type”:“PERCENT”,“name”:“Technical Debt Ratio”},{“id”:“119”,“key”:“new_sqale_debt_ratio”,“type”:“PERCENT”,“name”:“Technical Debt Ratio on New Code”},{“id”:“46”,“key”:“uncovered_conditions”,“type”:“INT”,“name”:“Uncovered Conditions”},{“id”:“64”,“key”:“new_it_uncovered_conditions”,“type”:“INT”,“name”:“Uncovered Conditions by IT on New Code”},{“id”:“47”,“key”:“new_uncovered_conditions”,“type”:“INT”,“name”:“Uncovered Conditions on New Code”},{“id”:“39”,“key”:“uncovered_lines”,“type”:“INT”,“name”:“Uncovered Lines”},{“id”:“57”,“key”:“new_it_uncovered_lines”,“type”:“INT”,“name”:“Uncovered Lines by IT on New Code”},{“id”:“40”,“key”:“new_uncovered_lines”,“type”:“INT”,“name”:“Uncovered Lines on New Code”},{“id”:“34”,“key”:“test_data”,“type”:“DATA”,“name”:“Unit Test Details”},{“id”:“29”,“key”:“test_execution_time”,“type”:“MILLISEC”,“name”:“Unit Test Duration”},{“id”:“30”,“key”:“test_errors”,“type”:“INT”,“name”:“Unit Test Errors”},{“id”:“32”,“key”:“test_failures”,“type”:“INT”,“name”:“Unit Test Failures”},{“id”:“33”,“key”:“test_success_density”,“type”:“PERCENT”,“name”:“Unit Test Success (%)”},{“id”:“28”,“key”:“tests”,“type”:“INT”,“name”:“Unit Tests”},{“id”:“112”,“key”:“vulnerabilities”,“type”:“INT”,“name”:“Vulnerabilities”},{“id”:“104”,“key”:“wont_fix_issues”,“type”:“INT”,“name”:“Won’t Fix Issues”}],“total”:145,“p”:1,“ps”:500}”
2019-10-03T11:15:55.8463631Z ##[debug]pollingTimeoutSec=300
2019-10-03T11:15:55.8463975Z ##[debug][SQ] API GET: ‘/api/server/version’ with query “undefined”
2019-10-03T11:15:55.8569634Z ##[debug]Response: 200 Body: “7.5.0.20543”
2019-10-03T11:15:55.8577806Z ##[debug]Build.BuildNumber=20191003.8
2019-10-03T11:15:55.8578096Z ##[debug]Agent.TempDirectory=E:\AzureDevOpsAgent\A1_work_temp
2019-10-03T11:15:55.8584516Z ##[debug]defaultRoot: ‘E:\AzureDevOpsAgent\A1_work_temp’
2019-10-03T11:15:55.8586163Z ##[debug]findOptions.allowBrokenSymbolicLinks: ‘false’
2019-10-03T11:15:55.8586358Z ##[debug]findOptions.followSpecifiedSymbolicLink: ‘true’
2019-10-03T11:15:55.8586703Z ##[debug]findOptions.followSymbolicLinks: ‘true’
2019-10-03T11:15:55.8589033Z ##[debug]matchOptions.debug: ‘false’
2019-10-03T11:15:55.8589386Z ##[debug]matchOptions.nobrace: ‘true’
2019-10-03T11:15:55.8589618Z ##[debug]matchOptions.noglobstar: ‘false’
2019-10-03T11:15:55.8589992Z ##[debug]matchOptions.dot: ‘true’
2019-10-03T11:15:55.8590267Z ##[debug]matchOptions.noext: ‘false’
2019-10-03T11:15:55.8590534Z ##[debug]matchOptions.nocase: ‘true’
2019-10-03T11:15:55.8590797Z ##[debug]matchOptions.nonull: ‘false’
2019-10-03T11:15:55.8591790Z ##[debug]matchOptions.matchBase: ‘false’
2019-10-03T11:15:55.8592127Z ##[debug]matchOptions.nocomment: ‘false’
2019-10-03T11:15:55.8592402Z ##[debug]matchOptions.nonegate: ‘false’
2019-10-03T11:15:55.8592669Z ##[debug]matchOptions.flipNegate: ‘false’
2019-10-03T11:15:55.8593936Z ##[debug]pattern: 'sonar\20191003.8*
\report-task.txt’
2019-10-03T11:15:55.8634387Z ##[debug]findPath: ‘E:\AzureDevOpsAgent\A1_work_temp\sonar\20191003.8’
2019-10-03T11:15:55.8635142Z ##[debug]statOnly: ‘false’
2019-10-03T11:15:55.8635511Z ##[debug]findPath: ‘E:\AzureDevOpsAgent\A1_work_temp\sonar\20191003.8’
2019-10-03T11:15:55.8635867Z ##[debug]findOptions.allowBrokenSymbolicLinks: ‘false’
2019-10-03T11:15:55.8636142Z ##[debug]findOptions.followSpecifiedSymbolicLink: ‘true’
2019-10-03T11:15:55.8636406Z ##[debug]findOptions.followSymbolicLinks: ‘true’
2019-10-03T11:15:55.8638941Z ##[debug]0 results
2019-10-03T11:15:55.8639136Z ##[debug]found 0 paths
2019-10-03T11:15:55.8639310Z ##[debug]applying include pattern
2019-10-03T11:15:55.8639493Z ##[debug]adjustedPattern: 'E:\AzureDevOpsAgent\A1_work_temp\sonar\20191003.8*
\report-task.txt’
2019-10-03T11:15:55.8643377Z ##[debug]0 matches
2019-10-03T11:15:55.8643571Z ##[debug]0 final results
2019-10-03T11:15:55.8643805Z ##[debug][SQ] Searching for sonar\20191003.8*
\report-task.txt - found 0 file(s)
2019-10-03T11:15:55.8647613Z ##[debug]Number of analyses in this build: 0
2019-10-03T11:15:55.8647811Z ##[debug]Overall Quality Gate status: ok
2019-10-03T11:15:55.8668461Z ##[debug]System.TeamFoundationCollectionUri=**********
2019-10-03T11:15:55.8668729Z ##[debug]System.TeamProjectId=1575200c-b794-499d-b1e8-e2c8fd2ccde1
2019-10-03T11:15:55.8668982Z ##[debug]Build.BuildId=32832
2019-10-03T11:15:55.8670350Z ##[debug][{“op”:0,“path”:"/sonarglobalqualitygate",“value”:“ok”}]
2019-10-03T11:15:55.8690754Z SYSTEMVSSCONNECTION exists true
2019-10-03T11:15:55.8697807Z ##[debug]SYSTEMVSSCONNECTION exists true
2019-10-03T11:15:55.8697976Z SYSTEMVSSCONNECTION exists true
2019-10-03T11:15:55.8698150Z ##[debug]SYSTEMVSSCONNECTION exists true
2019-10-03T11:15:55.9431287Z ##[debug]build.artifactStagingDirectory=E:\AzureDevOpsAgent\A1_work\9\a
2019-10-03T11:15:55.9431865Z ##[debug][SQ] Summary saved at: E:\AzureDevOpsAgent\A1_work\9\a.sqAnalysis\SonarQubeBuildSummary.md
2019-10-03T11:15:55.9432216Z ##[debug][SQ] Uploading build summary from E:\AzureDevOpsAgent\A1_work\9\a.sqAnalysis\SonarQubeBuildSummary.md
2019-10-03T11:15:55.9459369Z ##[debug]Processed: ##vso[task.addattachment type=Distributedtask.Core.Summary;name=SonarQube Analysis Report;]E:\AzureDevOpsAgent\A1_work\9\a.sqAnalysis\SonarQubeBuildSummary.md
2019-10-03T11:15:55.9525250Z ##[section]Finishing: Publish Quality Gate Result

Thanks, but as long as you run the analysis from a script, you should have output from that, could you check that, still in debug, you have this kind of message inside :

“Report metadata written to path\to\metadata.txt”

Pretty much at the end of the analysis ? And tell us the path.

Hi,

The specific line could not be found.
However, I noticed some very strange behaviour.
When running with version 4.6.3, the task in Azure Devops takes about the same time as the scan job in Sonarqube (which is logical to me)
When running with the 4.8.0 version, the task in Azure Devops takes less than 1 second. The task in Azure Devops is allready finished, even when the analysis on Sonarqube is still running.

This could maybe be a possible explanation why the file is empty.

Thanks for the investigation.
Koen

Indeed there have been a change between 4.6.3 and 4.8.0, especially on the location of the report-task.txt file.

On the Prepare analysis configuration, we have a check of the version of SonarQube : If the version detected is above 7.2.0, then the report-task.txt file will be normally generated in it’s “newest” location, ie somewhere in the _temp folder of the build agent (and will be searched in that place too in the Publish Quality Gate Result task).

That being said, how do you invoke the scanner ? You said by script, but are you correctly passing required parameters to it, such as the SONAQUBE_SCANNER_PARAMS env variable that is set during the Prepare analysis configuration ?

I suspect that if it’s not passed correctly, then the scanner cannot define the path of the report-task.txt, then it uses the default one, which is somewhere on source code folders.

Mickaël

Just to be sure that I understand it correctly. The SONAQUBE_SCANNER_PARAMS env variable is set in the Preparre analysis configuration or not?

Our current pipeline has following steps:

  • Checkout
  • Prepare analysis on SonarQube (SQ plugin 4.8)
  • Ant sonar (custom ant task to scan src on SQ)
  • Publish Quality Gate Result (SQ plugin v4.8)

So the environment variable should be set in the second step? In the step configuration I can’t immediatly find a a place where I can put it.

Another remark: I looked for the report-task.txt file on the build agent. It’s not stored in a _temp folder but in the agent folder in _work\9\s.sonar, but maybe it is irrelevant.

Thanks

Can you tell me how do you invoke the scanner in your custom ant task ? Which version of it are you using ?

Somehow this task + the scanner are either not getting the param to store the report task file in its proper location or you are using an old version which cannot be compatible with that.

Thank you.

Hi,

I’ve been analyzing our log file and this part seems to be generated from ant:

]exec tool: C:\Program Files\Ant\apache-ant-1.9.7\bin\ant.bat
2019-10-03T20:33:01.9409983Z ##[debug]arguments:
2019-10-03T20:33:01.9410382Z ##[debug] -buildfile
2019-10-03T20:33:01.9411323Z ##[debug] E:\AzureDevOpsAgent\A1_work\9\s\build\sonar\antbuild.xml
2019-10-03T20:33:01.9411760Z ##[debug] -Dsonar.projectKey=***
2019-10-03T20:33:01.9412073Z ##[debug] -Dsonar.projectName=***
2019-10-03T20:33:01.9412464Z ##[debug] -DworkingDir=***
2019-10-03T20:33:01.9412854Z ##[debug] -Dsonar.login=***
2019-10-03T20:33:01.9413164Z ##[debug] -Dsonar.password=***
2019-10-03T20:33:01.9413449Z ##[debug] -Dsonar.projectVersion=***
2019-10-03T20:33:01.9414318Z ##[debug] -Dsalesforce.username=***
2019-10-03T20:33:01.9415295Z ##[debug] -Dsalesforce.url=***
2019-10-03T20:33:01.9415593Z ##[debug] -Dsalesforce.password=***
2019-10-03T20:33:01.9416185Z ##[debug] sonar

The sonar target:

<taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml">
    <classpath path="${ant.file.dir}/sonar-ant-task-2.2.jar" />
  </taskdef>
  <taskdef name='codescan' classname='com.villagechief.codescan.versions.ant.ScmCommitterTask'>
    <classpath path="${ant.file.dir}/force-versions-1.3.jar" />
  </taskdef>

  <taskdef uri="antlib:com.salesforce" resource="com/salesforce/antlib.xml" classpath="../ant-salesforce.jar"/>
  <taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask" classpath="../xmltask.jar"/>

  <target name="sonar">
    <property name="sonar.projectBaseDir" value="${workingDir}" />
    <property name="salesforce.url" value="***" />
    <property name="sonar.projectVersion" value="1.0-SNAPSHOT" />
    <property name="sonar.sources" value="${workingDir}/src" />
    <property name="sonar.sourceEncoding" value="utf8" />
    <property name="sonar.host.url" value="***" />   
   
    <sonar:sonar xmlns:sonar="antlib:org.sonar.ant" />
  </target>

Hi,

Thanks for the logs. You are using an old version of the Sonar ant task. There is at least version 2.6 published.

Could you please update it if possible and try again ?

Thanks !

Hi Mickaël,

thanks for the reply, apologies for the late answer. I was working on another project.
I upgraded to the new version (2.7, released on 1/10). When running the ant job, I got following error “To use the property “sonar.branch.name”, the branch plugin is required but not installed.”
Can you confirm that this error is caused by the fact we’re running analysis on a non master branch on a sonar community edition?

Thanks,
Koen

Hi Mickaël,

Never mind, seems like the upgrade to 2.7 has solved the issue.
Thanks a lot for the support.

Koen

HI Mickaël,

Seems like my hurray wwas to quick. As stated, running a build with a sonarscan is working fine. However, when executing a pull request, using the same pipeline job, the job still doesn’t find the file.

I’ve been going through the logs but can’t find an immediate reason, beside some parameters being different.