0

I am running maven build after that calling sonar task 1.Prepare analysis on sonarcube 2.Maven task 3.Publish Analysis result. But here at publish analysis task I am getting the below error.I have got some info to fix this issue, with that info I have tried to solve the issue but not able to fix the issue .It persisting .Please help me out.I have got the issue fix details from here but no luck. Sonarqube v.4 TFS task "Publish Analysis Result" throw error "Could not fetch metrics"

Error:

2018-02-19T10:30:19.6692905Z ##[error][SQ] Could not fetch metrics

2018-02-19T10:30:47.1582905Z ##[error][SQ] Could not fetch task for ID 'AWGtmps1YSAeQqxG0WHP'

G. Ann - SonarSource Team
  • 22,346
  • 4
  • 40
  • 76
PRAVEEN PDBR
  • 423
  • 1
  • 9
  • 25
  • What's the SonarQube version do you use? Based on the ticket (https://jira.sonarsource.com/browse/VSTS-134), the bug was fixed at SonarQube 4.0.1. – Marina Liu Feb 20 '18 at 05:19
  • @Marina Liu - MSFT,I am using sonarcube 5.6.7.Please do let me know how to solve this issue ? And also please do let me know how to check which sonar version is running in my system. – PRAVEEN PDBR Feb 20 '18 at 07:56
  • @Marina Liu - MSFT,Can you please help me to fix this issue? – PRAVEEN PDBR Feb 20 '18 at 11:27
  • You can double check the sonarqube version in the installed directory. Assume the unzip folder for sonarqube located in `C:\sonarqube`, then you can check the version in `C:\sonarqube\lib\server` directory, most of the files `sonarqube-*.jar` contains the version number. Such as you can check the sonarqube version from the file name as `sonar-core-*.jar`. – Marina Liu Feb 20 '18 at 12:41
  • @Marina Liu-MSFT,I have 2 sonar versions extracted in the c drive but I have started the sonar server. Sh from bin folder for sonar 5.6.7. So sonar versions should run as 5.6.7 . Also please let me know through command line can we find the sonar version?So please let me know how to fix this issue. – PRAVEEN PDBR Feb 21 '18 at 05:32
  • Please let me know how to fix my issue. – PRAVEEN PDBR Feb 21 '18 at 05:33
  • @Marina Liu - MSFT ,Please help me here. – PRAVEEN PDBR Feb 21 '18 at 07:10
  • What if you config the sonarqube with latest version and add the new endpoint to your VSTS and build again? – Marina Liu Feb 22 '18 at 04:06
  • @Marina Liu - MSFT,Still its failing with the same error as above mentioned.Please help me here. – PRAVEEN PDBR Feb 27 '18 at 07:14
  • Can you show the whole build logs by setting system.debug as true? – Marina Liu Feb 27 '18 at 08:26
  • @Marina Liu - MSFT, Please find the log @ https://1drv.ms/u/s!AvMxvVJdKJlVhx7cdMdAHiiYebVd and help me here. – PRAVEEN PDBR Feb 27 '18 at 10:35
  • @Marina Liu - MSFT,Please find the log and help me here.. – PRAVEEN PDBR Feb 28 '18 at 07:26
  • Please use the Maven task 2.0, and select Run SonerQube or SonarCloud Analysis option. – Marina Liu Feb 28 '18 at 09:46
  • @Marina Liu - MSFT,I ran using maven 2.0 version but its failing with different error.Please check the complete log @ https://1drv.ms/u/s!AvMxvVJdKJlVhx9KJ60OKpvwzQ7t – PRAVEEN PDBR Feb 28 '18 at 12:07
  • It seems project related. Can you show the project you use? – Marina Liu Mar 01 '18 at 07:23
  • @Marina Liu - MSFT, What if I don't run the publish analysis task in VSTS? – PRAVEEN PDBR Mar 01 '18 at 07:38
  • Your build failed at maven step, failed to code analysis by sonarQube, before the step publish analysis result task. – Marina Liu Mar 01 '18 at 07:42
  • @Marina Liu - MSFT,When I run maven 1.0 task its only failing at publish analysis task where as maven task is getting succeeded.So please let me know if I don't use publish analysis task and what is the main use of it ? – PRAVEEN PDBR Mar 01 '18 at 09:05
  • @Marina Liu - MSFT,Can you help me here and tell me whether I can skip publish analysis task by setting maven 1.0 task in VSTS ? – PRAVEEN PDBR Mar 01 '18 at 11:32
  • @Marina Liu - MSFT,As I told ,can I disable the publish analysis task by setting maven1.0 task so that maven task is not failing but publish analysis task is failing.So please let me know your thoughts on this.I don't know what is the use of publish analysis task.Please let me know whether I can skip that task or let me know how to fix that issue. – PRAVEEN PDBR Mar 02 '18 at 06:45
  • @Marina Liu - MSFT,I have installed latest version of sonar .Now its working fine.Thanks a lot Marina for your valuable inputs. – PRAVEEN PDBR Mar 02 '18 at 13:28

0 Answers0