Amount of new issues is 0, but should be at least +10 or more


We integrated new plugin Sonar for Stash, but i was not able to see new issues and issues inside diff, but indeed we have new issues.

info in pull request

sonar results

In Stash in diff view I'm getting following meesage 

"No Sonar issues found in this pull request."

Version of Sonar4Stash plugin is 1.4.0.

Stash version is 3.6.1.

Do you have any ideas what is wrong?

1 answer

This widget could not be displayed.

Hi,

Could you please have a look at your browser console when you open a pull request in Stash? Do you see any lines in the console starting with"SONAR”? Otherwise, do you see something in the Stash Server log? All log entires of the plug-in have the prefix “SONAR”. If you could send me both the browser console and Stash server log entries that would be very helpful in diagnosing this issue. 

What kind of build system are you using in your projects to trigger SonarQube?

Best regards,

Michael (author of the plug-in)

we use Teamcity. Response of http://stash/rest/sonar4stash/1.0/statistics?pullRequestId=8&repoId=562 {"sonarServer":"http://sonar.corp","newIssues":0,"from";:{"name":"feature/new-bugs","projectKey":"TestProject:feature_new-bugs","statistics":{"componentId":"TestProject:feature_new-bugs","duplicatedLines":56,"coverage":6.8,"violations":47,"technicalDebt":667}},"to":{"name":"develop","projectKey":"TestProject:develop","statistics":{"componentId":"TestProject:develop","duplicatedLines":0,"coverage":0.0,"violations":16,"technicalDebt":144}}} I didn't find anything in console, nor logs. Thanks

Thanks for your reply. Do you use Maven, Gradle or SonarRunner to trigger SonarQube in your build? - Could you please give me the SonarQube project key you have defined in the plug-in's repository settings page? - Please execute the following cURL command with the file name of one of the files you have in your pull request and send me the results: curl -u <YOUR_SONAR_USER_NAME> “<YOUR_SONAR_URL>/api/resources/search?s=<YOUR_FILE_NAME>&q=FIL,UTS&ps=9999” e.g. curl -u admin “http://localhost:9000/api/resources/search?s=Service.java&q=FIL,UTS&ps=9999” If you don't want to post your results here, I suggest that you either send us an e-mail to our support mail address (can be found on our Atlassian vendor profile https://marketplace.atlassian.com/vendors/1211511) or that you create a JIRA ticket in our JIRA here: https://mibexsoftware.atlassian.net/browse/SONAR Thanks in advance

h Michael, it is test project, so I can post here. result is following {"total":3,"page":1,"page_size":10,"data":[ {"id":48377,"key":"oratych_test:feature_new-bugs:src/main/java/SonarInvestigation.java","nm":"src/main/java/SonarInvestigation.java","q":"FIL"},{"id":48384,"key":"oratych_test:develop:src/main/java/SonarInvestigation.java","nm":"src/main/java/SonarInvestigation.java","q":"FIL"}, {"id":48390,"key":"oratych_test:feature_again-bugs:src/main/java/SonarInvestigation.java","nm":"src/main/java/SonarInvestigation.java","q":"FIL"}]} Please note that we use SonarQube version 5.1.2, Also i renamed project to oratych_test {"sonarServer":"http://sonar.corp","newIssues":0,"from";:{"name":"feature/new-bugs","projectKey":"oratych_test:feature_new-bugs","statistics":{"componentId":"oratych_test:feature_new-bugs","duplicatedLines":56,"coverage":6.5,"violations":49,"technicalDebt":692}},"to":{"name":"develop","projectKey":"oratych_test:develop","statistics":{"componentId":"oratych_test:develop","duplicatedLines":0,"coverage":0.0,"violations":16,"technicalDebt":144}}} thank you

Looking at the component IDs, it looks like you are replacing characters like "/" to "_" (e.g., feature_again-bugs). Are you using Sonar for Bamboo? Please note that if you replace these characters, you need to make sure that you also have this activated in Sonar for Stash (see the repository settings option "Replacement for illegal branch characters" and make sure that it contains an "_"). Please note that with SonarQube > 4.5 versions it is not necessary anymore to do this translation, so for new projects you could stop using this feature.

hi, I tried both variants but results is same. today i finally got access to logs from IT and see following logs 1. when open pull request 2015-10-21 14:57:30,027 ERROR [http-nio-7990-exec-37] ORatych @WK088Rx897x10755858x6 kbtqfs "GET /rest/sonar4stash/1.0/statistics HTTP/1.0" c.m.s.s.s.s.SonarStatisticsResource SONAR: 404 failed to retrieve statistics: Not Found 2015-10-21 14:57:42,588 ERROR [http-nio-7990-exec-52] ORatych @WK088Rx897x10756277x7 kbtqfs "GET /rest/sonar4stash/1.0/statistics HTTP/1.0" c.m.s.s.s.s.SonarStatisticsResource SONAR: 404 failed to retrieve statistics: Not Found 2. when i open Diff tab 2015-10-21 14:58:39,207 WARN [http-nio-7990-exec-2] ORatych @WK088Rx898x10757081x5 kbtqfs "GET /rest/sonar4stash/1.0/duplicatelines HTTP/1.0" c.m.s.s.s.d.SonarDuplicateResource SONAR: Found component ID for src/main/java/BadDto.java with using build information: playtika:oratych-test:feature/new-bugs:src/main/java/BadDto.java 2015-10-21 14:58:39,236 ERROR [http-nio-7990-exec-2] ORatych @WK088Rx898x10757081x5 kbtqfs "GET /rest/sonar4stash/1.0/duplicatelines HTTP/1.0" c.m.s.s.s.d.SonarDuplicateResource SONAR: 403 failed to retrieve duplicate line information: Forbidden 2015-10-21 14:58:39,236 WARN [http-nio-7990-exec-2] ORatych @WK088Rx898x10757081x5 kbtqfs "GET /rest/sonar4stash/1.0/duplicatelines HTTP/1.0" c.m.s.s.s.d.SonarDuplicateResource SONAR: No Sonar information found for file playtika:oratych-test:feature/new-bugs:src/main/java/BadDto.java%s: Forbidden 2015-10-21 14:58:39,405 WARN [http-nio-7990-exec-46] ORatych @WK088Rx898x10757079x3 kbtqfs "GET /rest/sonar4stash/1.0/sonarissues HTTP/1.0" c.m.s.s.s.issues.SonarIssuesResource SONAR: Found component ID for src/main/java/BadDto.java with using build information: playtika:oratych-test:feature/new-bugs:src/main/java/BadDto.java 2015-10-21 14:58:39,511 WARN [http-nio-7990-exec-44] ORatych @WK088Rx898x10757080x4 kbtqfs 1 "GET /rest/sonar4stash/1.0/coverage HTTP/1.0" c.m.s.s.s.c.SonarCoverageResource SONAR: Found component ID for src/main/java/BadDto.java with using build information: playtika:oratych-test:feature/new-bugs:src/main/java/BadDto.java 2015-10-21 14:58:39,538 ERROR [http-nio-7990-exec-44] ORatych @WK088Rx898x10757080x4 kbtqfs "GET /rest/sonar4stash/1.0/coverage HTTP/1.0" c.m.s.s.s.c.SonarCoverageResource SONAR: 403 failed to coverage information: Forbidden 2015-10-21 14:58:39,538 WARN [http-nio-7990-exec-44] ORatych @WK088Rx898x10757080x4 kbtqfs "GET /rest/sonar4stash/1.0/coverage HTTP/1.0" c.m.s.s.s.c.SonarCoverageResource SONAR: No Sonar information found for file playtika:oratych-test:feature/new-bugs:src/main/java/BadDto.java%s: Forbidden but it looks strange. response of http://stash/rest/sonar4stash/1.0/statistics?pullRequestId=17&repoId=562 {"sonarServer":"http://sonar.corp","newIssues":0,"from";:{"name":"feature/new-bugs","projectKey":"oratych_test:feature/new-bugs","statistics":{"componentId":"oratych_test:feature/new-bugs","duplicatedLines":56,"coverage":6.5,"violations":49,"technicalDebt":692}},"to":{"name":"master","projectKey":"oratych_test:master","statistics":{"componentId":"oratych_test:master","duplicatedLines":0,"coverage":50.0,"violations":2,"technicalDebt":40}}} can we discuss it via Skype? so we will resolve it faster. thanks, Olexii

Hi Olexii, Yes, discussing this via Skype is a good idea. Please send us an e-mail at our support address and then we can arrange a Skype call. Best regards, Michael

sure. sent email.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

477 views 3 17
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you