Unable to connect to server

697 views
Skip to first unread message

david...@gmail.com

unread,
Jun 1, 2017, 9:41:39 AM6/1/17
to SonarLint
I'm having trouble while connecting SonarLint to SonarServer which is running in the official docker image.
I can connect to the server via browser via http://localhost:9000/ but fails from inside the IDE.

The plugin version is 2.10.0.1922 and neither user/password nor token works.

IntelliJ IDEA 2017.1.3
Build #IU-171.4424.56, built on May 12, 2017
Subscription is active until January 13, 2018
JRE: 1.8.0_112-release-736-b21 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.11.6














Here's the relevant log entry from the idea.log

2017-06-01 15:29:04,991 [ 662265]   INFO - ellij.tasks.ConnectionTestTask - Connection test failed 
java.lang.IllegalStateException: Fail to request http://localhost:9000/api/system/status
at org.sonarsource.sonarlint.core.util.ws.HttpConnector.doCall(HttpConnector.java:179)
at org.sonarsource.sonarlint.core.util.ws.HttpConnector.get(HttpConnector.java:111)
at org.sonarsource.sonarlint.core.util.ws.HttpConnector.call(HttpConnector.java:100)
at org.sonarsource.sonarlint.core.container.connected.SonarLintWsClient.rawGet(SonarLintWsClient.java:112)
at org.sonarsource.sonarlint.core.container.connected.validate.ServerVersionAndStatusChecker.fetchServerInfos(ServerVersionAndStatusChecker.java:97)
at org.sonarsource.sonarlint.core.container.connected.validate.ServerVersionAndStatusChecker.checkVersionAndStatus(ServerVersionAndStatusChecker.java:61)
at org.sonarsource.sonarlint.core.container.connected.validate.ServerVersionAndStatusChecker.checkVersionAndStatus(ServerVersionAndStatusChecker.java:51)
at org.sonarsource.sonarlint.core.WsHelperImpl.validateConnection(WsHelperImpl.java:63)
at org.sonarsource.sonarlint.core.WsHelperImpl.validateConnection(WsHelperImpl.java:56)
at org.sonarlint.intellij.tasks.ConnectionTestTask.run(ConnectionTestTask.java:52)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:726)
at com.intellij.openapi.progress.impl.CoreProgressManager$6.run(CoreProgressManager.java:410)
at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:176)
at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:556)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:163)
at com.intellij.openapi.application.impl.ApplicationImpl.a(ApplicationImpl.java:594)
at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:334)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: unexpected end of stream on Connection{localhost:9000, proxy=DIRECT hostAddress=localhost/127.0.0.1:9000 cipherSuite=none protocol=http/1.1}
at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:205)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:75)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at org.sonarsource.sonarlint.core.util.ws.OkHttpClientBuilder.setUserAgent(OkHttpClientBuilder.java:186)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)
at okhttp3.RealCall.execute(RealCall.java:69)
at org.sonarsource.sonarlint.core.util.ws.HttpConnector.doCall(HttpConnector.java:176)
... 23 more
Caused by: java.io.EOFException: \n not found: limit=0 content=…
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:226)
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:210)
at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)
... 42 more

please let me know how to fix this or if i can provide more informations.
thanks in advance

kind regards
~david

Julien HENRY

unread,
Jun 6, 2017, 10:04:19 AM6/6/17
to david linse, SonarLint
Hi David,

Any chance you can watch network traffic using a tool like wireshark? We are not aware of any similar issue, so the problem may be in docker/network setup.

++

Julien Henry | SonarSource

Developer

http://sonarsource.com


--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/014f64c3-1d32-4880-bf22-2a0d464bcec0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

duarte.meneses

unread,
Jun 7, 2017, 11:18:25 AM6/7/17
to SonarLint, david...@gmail.com
I can reproduce the same stack trace when pointing SonarLint to a host/port that returns a simple string (an invalid HTTP response, with no headers).
As suggested by Julien, it would be useful to see what exactly is being returned by the WS. You can also check the network details in the debug window of the browser or use curl/wget to see response code and headers.
There could be problems, for example, if there is a redirect with authentication.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.

david linse

unread,
Jun 12, 2017, 3:58:56 AM6/12/17
to SonarLint, david...@gmail.com
Hi there,
sorry for the delay.. 

i was able to kind of fix this by pointing the server-url to my local ip address instead of just localhost.

regards
~david
Reply all
Reply to author
Forward
0 new messages