AmadeusITGroup / sonar-stash

Stash (BitBucket) plugin, a pull-request decorator which allows to integrate SonarQube violations directly into your pull-request
MIT License
165 stars 82 forks source link

Unable to get SonarQube reviewer from Stash: java.util.concurrent.ExecutionException: java.net.ConnectException: https://agit.***.be:6088 #44

Closed bdhoine closed 4 years ago

bdhoine commented 8 years ago

When trying to get info from my BitBucket instance I get the following stack trace when running maven in debug mode.

[INFO] ANALYSIS SUCCESSFUL
[DEBUG] Post-jobs : org.******.plugins.stash.StashIssueReportingPostJob@79235a62
[INFO] Executing post-job org.******.plugins.stash.StashIssueReportingPostJob
[DEBUG] Trying to recover from failing to connect channel [id: 0x41d34189, /10.64.130.29:36896 :> agit.***.be/10.64.130.14:6088] with a retry value of true 
[DEBUG] Trying to recover request DefaultHttpRequest(chunked: false)
GET /rest/api/1.0/users/*** HTTP/1.1
Content-Type: application/json
Connection: keep-alive
Host: agit.***.be:6088
Authorization: Basic ***wNjIwNTp5SGZPME42MEpocllTM0MxSHJKcw==
Accept: */*
User-Agent: AHC/1.0

[DEBUG] Channel Closed: [id: 0x41d34189, /10.64.130.29:36896 :> agit.***.be/10.64.130.14:6088] with attribute null
[DEBUG] Trying to recover from failing to connect channel [id: 0x3663691b, /10.64.130.29:36897 :> agit.***.be/10.64.130.14:6088] with a retry value of true 
[DEBUG] Trying to recover request DefaultHttpRequest(chunked: false)
GET /rest/api/1.0/users/*** HTTP/1.1
Content-Type: application/json
Connection: keep-alive
Host: agit.***.be:6088
Authorization: Basic ***wNjIwNTp5SGZPME42MEpocllTM0MxSHJKcw==
Accept: */*
User-Agent: AHC/1.0

[DEBUG] Channel Closed: [id: 0x3663691b, /10.64.130.29:36897 :> agit.***.be/10.64.130.14:6088] with attribute null
[DEBUG] Trying to recover from failing to connect channel [id: 0xea7b0e95, /10.64.130.29:36898 :> agit.***.be/10.64.130.14:6088] with a retry value of true 
[DEBUG] Unable to recover future NettyResponseFuture{currentRetry=6,
  isDone=false,
  isCancelled=false,
  asyncHandler=com.ning.http.client.AsyncCompletionHandlerBase@418eef65,
  nettyRequest=com.ning.http.client.providers.netty.request.NettyRequest@45b1738c,
  content=null,
  uri=https://agit.***.be:6088/rest/api/1.0/users/***,
  keepAlive=true,
  httpHeaders=null,
  exEx=null,
  redirectCount=0,
  timeoutsHolder=null,
  inAuth=false,
  statusReceived=false,
  touch=866670679}

[DEBUG] Failed to recover from connect exception: java.nio.channels.ClosedChannelException with channel [id: 0xea7b0e95, /10.64.130.29:36898 :> agit.***.be/10.64.130.14:6088]
[DEBUG] https://agit.***.be:6088
[DEBUG] Channel Closed: [id: 0xea7b0e95, /10.64.130.29:36898 :> agit.***.be/10.64.130.14:6088] with attribute null
[ERROR] Unable to get SonarQube reviewer from Stash: java.util.concurrent.ExecutionException: java.net.ConnectException: https://agit.***.be:6088
[DEBUG] Exception stack trace
[ERROR] Process stopped: no SonarQube reviewer identified to publish to Stash the SQ analysis
acopet commented 8 years ago

Hello Barry,

Cheers, Antoine

bdhoine commented 8 years ago

Hi,

I tried all options u described already. The user was defined and was a valid git user with read-write permissions. The BitBucket version was 4.4, which should be compatible and if a performed the call using curl the operation succeeded.

Seems there is a bug in the AsyncHttpClient.

Maybe it has something to do with the fact that the server used a SHA1 certificate which expired on 1 january 2017, I tried with a similar certificate that expires one day before and that one does get accepted.

bdhoine commented 8 years ago

If I use the async-http-client artifact from org.asynchttpclient, then it works! Is it possible for me to create a pull request or will you guys update the implementation?

bdhoine commented 8 years ago

@acopet can you or somebody else please provide some feedback on my previous comment? the error was clearly not a configuration error and with another library it did work without tweaking the code (except a few lines for API compatibility)

mathieusimon commented 8 years ago

Hello Barry,

Sorry for the delay, please go ahead with your contribution through a Pull Request.

Cheers, Mathieu

widgetpl commented 8 years ago

@mathieusimon is it possible to merge @bdhoine branch ? We have faced the same issue:

[ERROR] Unable to get SonarQube reviewer from Stash: java.util.concurrent.ExecutionException: java.net.ConnectException: https://domain.name:443
mtakaki commented 8 years ago

I'm facing the same issue here... It would be awesome to get this merged in.

StanKocken commented 7 years ago

Any update on this? I'm having the same issue.

Stupnikov-NA commented 7 years ago

We could handle similar issue by incrementing client's version up to 1.9.32:

<dependency>
  <groupId>com.ning</groupId>
  <artifactId>async-http-client</artifactId>
  <version>1.9.32</version>
</dependency>

No changes except pom.xml required.