JetBrains / TeamCity.SonarQubePlugin

A plugin for TeamCity server allowing you to configure and run SonarQube analysis from the CI
Apache License 2.0
53 stars 31 forks source link

Trying to run SonarQube analysis in Teamcity results in error #41

Closed akuryan closed 6 years ago

akuryan commented 6 years ago

It seems that plugin is not able to swallow status ID. I shall note that this error happens on PR analysis on only one of our projects - so, maybe it is some boundary issue

[Step 7/7] ERROR: Error during Sonar runner execution

[10:52:38][Step 7/7] ERROR: Unable to execute Sonar

[10:52:38][Step 7/7] ERROR: Caused by: Unable to load component class org.sonar.batch.scan.ImmutableProjectReactor

[10:52:38][Step 7/7] ERROR: Caused by: Unable to update commit status

[10:52:38][Step 7/7] ERROR: Caused by: Server returned HTTP response code: 201, message: 'Created' for URL: https://api.github.com/repos/organizationName/repoName/statuses/2648c30d6e3c74045240d84bfd30b8cb7096e173

[10:52:38][Step 7/7] ERROR: Caused by: Failed to deserialize {"url":"https://api.github.com/repos/organizationName/repoName/statuses/2648c30d6e3c74045240d84bfd30b8cb7096e173","id":4314163357,"state":"pending","description":"SonarQube analysis in progress","target_url":null,"context":"sonarqube","created_at":"2017-11-14T09:52:37Z","updated_at":"2017-11-14T09:52:37Z","creator":{"login":"sonarqube-repoName","id":31036991,"avatar_url":"https://avatars1.githubusercontent.com/u/31036991?v=4","gravatar_id":"","url":"https://api.github.com/users/someUserName","html_url":"https://github.com/sonarqube-repoName","followers_url":"https://api.github.com/users/someUserName/followers","following_url":"https://api.github.com/users/someUserName/following{/other_user}","gists_url":"https://api.github.com/users/someUserName/gists{/gist_id}","starred_url":"https://api.github.com/users/someUserName/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/someUserName/subscriptions","organizations_url":"https://api.github.com/users/someUserName/orgs","repos_url":"https://api.github.com/users/someUserName/repos","events_url":"https://api.github.com/users/someUserName/events{/privacy}","received_events_url":"https://api.github.com/users/someUserName/received_events","type":"User","site_admin":false}}

[10:52:38][Step 7/7] ERROR: Caused by: Numeric value (4314163357) out of range of int

[10:52:38][Step 7/7]  at [Source: java.io.StringReader@1e8823d2; line: 1, column: 119] (through reference chain: org.kohsuke.github.GHCommitStatus["id"])

[10:52:38][Step 7/7] ERROR: Caused by: Numeric value (4314163357) out of range of int

[10:52:38][Step 7/7]  at [Source: java.io.StringReader@1e8823d2; line: 1, column: 119]

[10:52:38][Step 7/7] ERROR: 

[10:52:38][Step 7/7] ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.

[10:52:38][Step 7/7] ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Linfar commented 6 years ago

ERROR: Caused by: Numeric value (4314163357) out of range of int. wow!

Does this error occur in TeamCity build only or when you run the analysis manually as well?

As I understand the error is raised in some github with SonarQube integration. I suppose this is some plugin - please check whether you can upgrade it.

akuryan commented 6 years ago

It is this SonarQube plugin, running on Teamcity side to analyze PR. Or is there something invoked on SQ side as well at this point?

Linfar commented 6 years ago

I mean when you are running analysis manually from command line - does this error occur?

akuryan commented 6 years ago

I am not sure how to launch PR analysis manually :(

akuryan commented 6 years ago

I found string for execution from log output - and started it manually I received same result

akuryan commented 6 years ago

It seems that the problem is on https://github.com/kohsuke/github-api: at org.kohsuke.github.Requester.parse(Requester.java:522) ... 65 more Caused by: com.fasterxml.jackson.databind.JsonMappingException: Numeric value (4314789267) out of range of int at [Source: java.io.StringReader@75201592; line: 1, column: 120] (through reference chain: org.kohsuke.github.GHCommitStatus["id"])

After googling - I found https://github.com/kohsuke/github-api But I am not sure - where error pops up: on Teamcity level or on SQ level :(

Linfar commented 6 years ago

Yeah, and it seems they've fixed this issue 2 weeks ago: https://github.com/kohsuke/github-api/issues/393.

Here is fix in SonarQube integration for github: https://github.com/SonarSource/sonar-github/commit/0aacae358108a10a0a085917110c7dd1871ae5e2#diff-600376dffeb79835ede4a0b285078036

So you'll need to update SonarQube GitHub Plugin on your SonarQube Server. I don't know whether they've released it already

akuryan commented 6 years ago

Updating sonar-github plugin fixed issue. Thank you for your help