1

I am using sonarcube 3.7.3 I am using STS with below details:

Version: 3.6.3.SR1 Build Id: 201501121239 Platform: Eclipse Luna SR1 (4.4.1)

I have installed sonarcude eclipse plugin(SonarCubeJava Analyser 3.4.0.20140404-0949-RELEASE) and when I try to associate my project with sonar using "Associate with SonarCude" option in STS then I am getting below error:

One of your SonarQube server cannot be reached. Please check your connection settings.

I am ot able to attach image as I am new user on this forum.

Can you suggest what could be the issue and possible solution. Let me know if there are any queries.

The workspace log shows below: !ENTRY org.sonar.ide.eclipse.ui 4 0 2015-06-26 15:37:38.821 !MESSAGE !STACK 0 java.lang.reflect.InvocationTargetException at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:423) org.sonar.ide.eclipse.ui.internal.command.ConfigureProjectsCommand$1.run(Configu at org.eclipse.equinox.launcher.Main.run(Main.java:1465) Caused by: org.sonar.ide.eclipse.wsclient.ConnectionException: Query: at Root exception: org.sonar.ide.eclipse.wsclient.ConnectionException: Query: http://sonarserver/api/resources?scopes=PRJ&qualifiers=TRK,BRC&verbose=false& g.sonar.ide.eclipse.wsclient.internal.SonarWSClientFacade.findAll(SonarWSClientFacade.java:109) org.sonar.ide.eclipse.wsclient.internal.SonarWSClientFacade.listAllRemoteModules(SonarWSClientFacade.java:89)

The url in above log is working fine when I check it in browser.

satishkk
  • 53
  • 1
  • 14
  • Are you able to reach the sonar server from your browser? – Techtwaddle Jun 29 '15 at 08:04
  • Yes, I am able to reach our sonar server. If I paste the url "http://sonarserver/api/resources?scopes=PRJ&qualifiers=TRK,BRC&verbose=false&" listed in logs then it gives me results in browser. Also in STS IDE, I set-up my sonar server and test connection give "successful" – satishkk Jun 30 '15 at 07:11
  • I relooked at the eclipse workspace logs and looking more closely, i can see a final error as "read timed out". Could this be the issue. Am i reading the log correctly. If yes, then what could be possible solution. I am sharing the logs as below:java.lang.reflect.InvocationTargetException Caused by: org.sonar.ide.eclipse.wsclient.ConnectionException: Query: http://sonarserverurl Caused by: java.net.SocketTimeoutException: Read timed out Root exception: org.sonar.ide.eclipse.wsclient.ConnectionException: Query: http://sonarserverurl Caused by: java.net.SocketTimeoutException: Read timed out – satishkk Jul 21 '15 at 08:08

1 Answers1

0

If you are accessing sonar from an enterprise network, you may be behind a proxy server. If so, please try proxy settings in eclipse under General > Network Connections

Checkout the below links:

How do I have to configure the proxy settings so Eclipse can download new plugins?

http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Freference%2Fref-net-preferences.htm

Community
  • 1
  • 1
Gautam Jose
  • 686
  • 8
  • 20
  • Thanks. I missed mentioning it in my original post. I have already setup proxy connection and I could download sonar eclipse plugin only after setting up the proxy connection. I have setup the connection as "Manual" and specified details for HTTP and HTTPS. Intially I set-up SOCKS also but it was giving error so I ommited it. – satishkk Jun 30 '15 at 07:15
  • Pankaj, Did you try using older versions of sonar eclipse plugin, can you try v3.2? – Gautam Jose Jul 01 '15 at 13:45
  • I have tried to use older version of eclipse also but they are not working (I have checked 3.3.0, 3.2.0). I am facing this issue since the system have been upgraded to windows 7. Same sonar eclipse plugin was working fine on windowsXP(my previous configuration. Please suggest how I can resolve it as it has become a big issue. – satishkk Jul 20 '15 at 10:12
  • Few questions: Are you able to access sonar link in eclipse web browser? Did you try installing older version of Eclipse or sonar plugin for eclipse? Also, if proxy is configured with a pac file for the system please try using native rather than manually configuring it in eclipse. – Gautam Jose Jul 20 '15 at 10:37
  • Answers as below: 1) Yes I am able to access the sonar url when I paste same in the browser 2) yes I have tried Kepler also.Also additional information: I installed older version of sonar eclipse plugin also but same error in log 3) I have configured proxy using manual and it works fine. As I am able to install sonar eclipse plugin after setting the proxy manually. Additional information: The sonar eclipse plugin (3.2.0) was working fine with Eclipse kepler on a Windows XP system.The issue is present since my system has changed to windows7. Please help. – satishkk Jul 21 '15 at 05:58
  • I relooked at the eclipse workspace logs and looking more closely, i can see a final error as "read timed out". Could this be the issue. Am i reading the log correctly. If yes, then what could be possible solution. I am sharing the logs as below:java.lang.reflect.InvocationTargetException Caused by: org.sonar.ide.eclipse.wsclient.ConnectionException: Query: sonarserverurl Caused by: java.net.SocketTimeoutException: Read timed out Root exception: org.sonar.ide.eclipse.wsclient.ConnectionException: Query: sonarserverurl Caused by: java.net.SocketTimeoutException: Read timed out – satishkk Jul 21 '15 at 08:30
  • You can try adding preview analysis property `sonar.preview.readTimeout` under Preferences>SonarQube>Preview Analysis Properties. Set the value to a high value, say 600 may be 3000 :) – Gautam Jose Jul 21 '15 at 09:32
  • I noticed one more thing. When I try to associate a project in eclipse with sonar then I see a memory issue in server logs. I also noticed that my sonar server has numerous projects(400+) configured. Can this be the cause the issue and can removing some projects may resolve it. let me know if somebody has experienced this on their projects. The sonar serverlogs show:2015.07.21 10:53:59 ERROR rails Java::JavaLang::OutOfMemoryError (Java heap space): org.jruby.util.ByteList.(ByteList.java:91) org.jruby.RubyArray.join(RubyArray.java:1745) – satishkk Jul 23 '15 at 05:50
  • Oh.I thought issue was during analysis. Out of Memory issue could be due to a project analysis happening somewhere else. I don't see any reason for out of memory on server when associating a project. Btw can you try setting up the same version of sonar on local, run an analysis and try associating it to the local server? – Gautam Jose Jul 23 '15 at 13:25