kogitant / sonar-slack-notifier-plugin

SonarQube plugin for sending notifications to Slack
Other
73 stars 66 forks source link

Connection timeout when sending Slack Message #9

Open choerl opened 7 years ago

choerl commented 7 years ago

Hi guys,

looks like I have an issue when using your plugin. I am running SonarQube 6.1 and when it tries to send the message to slack the following error can be found in the logs:

2017.02.15 16:15:03 ERROR ce[AVpCjQRqe7xaJt4MVynB][c.k.s.s.e.t.SlackPostProjectAnalysisTask] Failed to send slack message
java.net.SocketTimeoutException: connect timed out
        at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_111]
        at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) ~[na:1.8.0_111]
        at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) ~[na:1.8.0_111]
        at java.net.AbstractPlainSocketImpl.connect(Unknown Source) ~[na:1.8.0_111]
        at java.net.SocksSocketImpl.connect(Unknown Source) ~[na:1.8.0_111]
        at java.net.Socket.connect(Unknown Source) ~[na:1.8.0_111]
        at okhttp3.internal.platform.Platform.connectSocket(Platform.java:124) ~[na:na]
        at okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:187) ~[na:na]
        at okhttp3.internal.connection.RealConnection.buildConnection(RealConnection.java:173) ~[na:na]
        at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:114) ~[na:na]
        at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:193) ~[na:na]
        at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:129) ~[na:na]
        at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:98) ~[na:na]
        at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42) ~[na:na]
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) ~[na:na]
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) ~[na:na]
        at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:109) ~[na:na]
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) ~[na:na]
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) ~[na:na]
        at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93) ~[na:na]
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) ~[na:na]
        at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:124) ~[na:na]
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92) ~[na:na]
        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67) ~[na:na]
        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:170) ~[okhttp-3.3.1.jar:na]
        at okhttp3.RealCall.execute(RealCall.java:60) ~[okhttp-3.3.1.jar:na]
        at com.github.seratch.jslack.common.http.SlackHttpClient.postJsonPostRequest(SlackHttpClient.java:38) ~[na:na]
        at com.github.seratch.jslack.Slack.send(Slack.java:50) ~[na:na]
        at com.koant.sonar.slacknotifier.extension.task.SlackPostProjectAnalysisTask.finished(SlackPostProjectAnalysisTask.java:69) ~[na:na]
        at org.sonar.server.computation.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.executeTask(PostProjectAnalysisTasksExecutor.java:106) [sonar-server-6.1.jar:na]
        at org.sonar.server.computation.task.projectanalysis.api.posttask.PostProjectAnalysisTasksExecutor.finished(PostProjectAnalysisTasksExecutor.java:100) [sonar-server-6.1.jar:na]
        at org.sonar.server.computation.task.step.ComputationStepExecutor.executeListener(ComputationStepExecutor.java:71) [sonar-server-6.1.jar:na]
        at org.sonar.server.computation.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:56) [sonar-server-6.1.jar:na]
        at org.sonar.server.computation.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:75) [sonar-server-6.1.jar:na]
        at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.executeTask(CeWorkerCallableImpl.java:84) [sonar-server-6.1.jar:na]
        at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:57) [sonar-server-6.1.jar:na]
        at org.sonar.server.computation.taskprocessor.CeWorkerCallableImpl.call(CeWorkerCallableImpl.java:35) [sonar-server-6.1.jar:na]
        at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_111]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [na:1.8.0_111]
        at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_111]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source) [na:1.8.0_111]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) [na:1.8.0_111]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_111]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_111]
        at java.lang.Thread.run(Unknown Source) [na:1.8.0_111]

Does your plugin support proxies?

Thanks in advance for your support!

kogitant commented 7 years ago

Hi, the plugin does not have proxy support at the moment.

choerl commented 7 years ago

Thanks for the quick reply. Is something like this planned for the near future?

gmilosavljevic-zz commented 6 years ago

Hi, If you are still interested for this feature, you can checkout forked code at gmilosavljevic/sonar-slack-notifier-plugin I have switched to apache http client instead of jslack and added proxy support that is configured through plugin parameters.

@kogitant you can check my fork and if you find it useful we can push to the main as a branch...

Cheers