Synchronization issues Using SonarCube Eclipse plugin 3.3.0 with Sonar 3.7.3

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Synchronization issues Using SonarCube Eclipse plugin 3.3.0 with Sonar 3.7.3

satishKaRohini
This post was updated on .
I am facing the sysnchronization issue when using Sonar Eclipse plugin.
Eclipe: 4.3.0 (Kepler)
Sonar Eclipse Plugin: 3.3.0
I have set the proxy to be manual and then installed the plugin

When I try to analyze results, I get below error:

Synchronization issues
Error during issue query org.sonar.wsclient.issue.IssueQuery@188fa1e

The eclipse log shows below:
!ENTRY org.sonar.ide.eclipse.core 4 4 2013-11-28 06:49:43.378
!MESSAGE Error during issue query org.sonar.wsclient.issue.IssueQuery@1a3fd33
!STACK 0
org.sonar.ide.eclipse.wsclient.SonarWSClientException: Error during issue query org.sonar.wsclient.issue.IssueQuery@1a3fd33
        at org.sonar.ide.eclipse.wsclient.internal.SonarWSClientFacade.findIssues(SonarWSClientFacade.java:194)
        at org.sonar.ide.eclipse.wsclient.internal.SonarWSClientFacade.getRemoteIssuesRecursively(SonarWSClientFacade.java:170)
        at org.sonar.ide.eclipse.core.internal.remote.RemoteSourceCode.getRemoteIssuesRecursively(RemoteSourceCode.java:122)
        at org.sonar.ide.eclipse.core.internal.jobs.SynchronizeAllIssuesJob.doRefreshIssues(SynchronizeAllIssuesJob.java:136)
        at org.sonar.ide.eclipse.core.internal.jobs.SynchronizeAllIssuesJob.fetchRemoteIssues(SynchronizeAllIssuesJob.java:125)
        at org.sonar.ide.eclipse.core.internal.jobs.SynchronizeAllIssuesJob.run(SynchronizeAllIssuesJob.java:79)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.IllegalStateException: Fail to request <Sonar URL>        at org.sonar.wsclient.internal.HttpRequestFactory.execute(HttpRequestFactory.java:138)
        at org.sonar.wsclient.internal.HttpRequestFactory.get(HttpRequestFactory.java:121)
        at org.sonar.wsclient.issue.internal.DefaultIssueClient.find(DefaultIssueClient.java:48)
        at org.sonar.ide.eclipse.wsclient.internal.SonarWSClientFacade.findIssues(SonarWSClientFacade.java:190)
        ... 6 more
Caused by: java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(Unknown Source)
        at java.net.SocketInputStream.read(Unknown Source)
        at java.io.BufferedInputStream.fill(Unknown Source)
        at java.io.BufferedInputStream.read1(Unknown Source)
        at java.io.BufferedInputStream.read(Unknown Source)
        at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
        at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
        at java.net.HttpURLConnection.getResponseCode(Unknown Source)
        at org.sonar.wsclient.kevinsawicki.HttpRequest.code(HttpRequest.java:1430)
        at org.sonar.wsclient.kevinsawicki.HttpRequest.ok(HttpRequest.java:1457)
        at org.sonar.wsclient.internal.HttpRequestFactory.execute(HttpRequestFactory.java:131)
        ... 9 more

This is a blocker for me and am not able to use the plugin. Please let me know if this is a known issue and any known workaround.
Thanks,
Satish
Reply | Threaded
Open this post in threaded view
|

Re: Synchronization issues Using SonarCube Eclipse plugin 3.3.0 with Sonar 3.7.3

Julien HENRY
This post was updated on .
Hi Satish,

Could you please try to open
http://<Sonar URL>/sonar/api/issues/search?pageSize=-1&componentRoots=<projectKey>&pageIndex=1in
a web browser and see how long it takes to respond.

++

Julien
Reply | Threaded
Open this post in threaded view
|

Re: Synchronization issues Using SonarCube Eclipse plugin 3.3.0 with Sonar 3.7.3

satishKaRohini
Hi Julien,
It is taking more than 6 minutes for the link to open in browser. On saving the file(open in browser), I see the file contains text starting with "{"maxResultsReached":false,"paging":{"pageIndex":1,"pageSize":500,"total":516,"pages":2},"
Let me know if any other information would be helpful.

Thanks,
Satish
Reply | Threaded
Open this post in threaded view
|

Re: Synchronization issues Using SonarCube Eclipse plugin 3.3.0 with Sonar 3.7.3

Julien HENRY
Hi Satish,

6 minutes to fetch 516 issues is far too much. What is the database you are using for your SonarQube server? Is the hardware of your SonarQube server decent? Can you monitor CPU of computers where SQ server and SQ database are hosted while doing the same previous request?

Thanks

Julien


2013/12/2 satishKaRohini <[hidden email]>
Hi Julien,
It is taking more than 6 minutes for the link to open in browser. On saving
the file(open in browser), I see the file contains text starting with
"{"maxResultsReached":false,"paging":{"pageIndex":1,"pageSize":500,"total":516,"pages":2},"
Let me know if any other information would be helpful.

Thanks,
Satish




--
View this message in context: http://sonarqube.15.x6.nabble.com/Synchronization-issues-Using-SonarCube-Eclipse-plugin-3-3-0-with-Sonar-3-7-3-tp5019612p5019701.html
Sent from the SonarQube Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Synchronization issues Using SonarCube Eclipse plugin 3.3.0 with Sonar 3.7.3

satishKaRohini
This post was updated on .
Hi Julien,
The hardware is sufficient to host the SonarCube server. Also there is no issue coming when the sonar analysis is done on the server. It is only when the analysis is done from SonarCube plugin then the issue comes.
Also recently I have noticed that the issue is intermittent. The plugin sometime works fine continuously for hours and then sometime this issue comes. The sonar cube server is maintained by another team and all I have access to is the sonar server URL which I can use in Eclipse.
The sonar server is hosted on a machine which is in different country than mine.
The team maintaining the sonar server increased the number of active connections to sufficient size but it still is giving the same issue.

There is one more observation. Just to check I installed plugin 3.2.0 and I get the same issue (ie Synchronization issue) when I configure the project using "configure>Associate Sonar .." option. However if I run local analysis afterwards (using "Sonar>Mode>Local" option) then the analysis works fine and returns with sonar analysis within 20-25 seconds. Since 3.3.0 doesn't have local analysis as an option therefore when I do analysis (using "Sonar>Analysis") using 3.3.0 plugin then I get the synchronization issue. Thus in summary I can do local analysis with 3.2.0 but not with 3.3.0.

Let me know if any other information would be helpful.

Thanks,
Satish
Reply | Threaded
Open this post in threaded view
|

Re: Synchronization issues Using SonarCube Eclipse plugin 3.3.0 with Sonar 3.7.3

satishKaRohini
Hi Julien,

There is one more observation. Just to check I installed plugin 3.2.0 and I get the same issue (ie Synchronization issue) when I configure the project using "configure>Associate Sonar .." option. However if I run local analysis afterwards (using "Sonar>Mode>Local" option) then the analysis works fine and returns with sonar analysis within 20-25 seconds. Since 3.3.0 doesn't have local analysis as an option therefore when I do analysis (using "Sonar>Analysis") using 3.3.0 plugin then I get the synchronization issue. Thus in summary I can do local analysis with 3.2.0 but not with 3.3.0.


Let me know if any other information would be helpful.
Thanks,
Satish
Reply | Threaded
Open this post in threaded view
|

Re: Synchronization issues Using SonarCube Eclipse plugin 3.3.0 with Sonar 3.7.3

Julien HENRY
This post was updated on .
Hi Satish,

With SQ Eclipse plugin version 3.3.0 we decided to merge remote and local
analysis into a single action to take advantage of both features. As a
result there is no more two different modes. Under the hood this is what
used to be the remote mode that is causing the delay for you.
I suggest to contact the admnistrators of your SQ server instance and send
to them the request that is taking too long to respond:
http://<Sonar URL>/sonar/api/issues/search?pageSize=-1&componentRoots=<projectKey>&pageIndex=1

Administrators should monitor server and DB CPU usage to find if there is a
bottleneck somewhere.

http://jira.codehaus.org/browse/SONARIDE-416 will also improve things a
little but in your situation I don't think the number of issues is
concerned (516 issues is a small value).

++

Julien


2013/12/3 satishKaRohini <satishdata@rediffmail.com>

> Hi Julien,
>
> There is one more observation. Just to check I installed plugin 3.2.0 and I
> get the same issue (ie Synchronization issue) when I configure the project
> using "configure>Associate Sonar .." option. However if I run local
> analysis
> afterwards (using "Sonar>Mode>Local" option) then the analysis works fine
> and returns with sonar analysis within 20-25 seconds. Since 3.3.0 doesn't
> have local analysis as an option therefore when I do analysis (using
> "Sonar>Analysis") using 3.3.0 plugin then I get the synchronization issue.
> Thus in summary I can do local analysis with 3.2.0 but not with 3.3.0.
>
>
> Let me know if any other information would be helpful.
> Thanks,
> Satish
>
>
>
>
> --
> View this message in context:
> http://sonarqube.15.x6.nabble.com/Synchronization-issues-Using-SonarCube-Eclipse-plugin-3-3-0-with-Sonar-3-7-3-tp5019612p5019735.html
> Sent from the SonarQube Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Synchronization issues Using SonarCube Eclipse plugin 3.3.0 with Sonar 3.7.3

satishKaRohini
Hi Julien,
As I mentioned that the issue comes with 3.2.0 also. What is Sonar plugin trying to do when it says "Synchonizing issues".
Also why doesn't this issue comes when we do a local analysis using 3.2.0 plugin.

Thanks,
Satish
Reply | Threaded
Open this post in threaded view
|

Re: Synchronization issues Using SonarCube Eclipse plugin 3.3.0 with Sonar 3.7.3

Julien HENRY
This post was updated on .
2013/12/3 satishKaRohini <satishdata@rediffmail.com>

> What is Sonar plugin trying to do when it says "Synchonizing issues".
>

It is waiting for
http://<Sonar URL>/sonar/api/issues/search?pageSize=-1&componentRoots=<projectKey>&pageIndex=1


> Also why doesn't this issue comes when we do a local analysis using 3.2.0
> plugin.
>

Because old local mode was not fetching issues from remote server but
instead performed a full local analysis (even for unmodified files and that
was a problem for big projects).

Please, trust me, the problem here is not on your side but on
network/server side. Fetching ~500 issues should be very fast.
Reply | Threaded
Open this post in threaded view
|

Re: Synchronization issues Using SonarCube Eclipse plugin 3.3.0 with Sonar 3.7.3

hgnoyke
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Hi,

I am facing an issue with the same query fired by the initial analysis of SonarQube Eclipse plugin 3.3.0 with a Sonar 4.0 server.

Response times of actions on the server directly via the Web interface is ok.
The query takes over 30 seconds (40s in avg), so that the Eclipse plugin always runs into a timeout and I can not use it at all.

Our dba suggested to rewrite the query so that it returns in < 1s this way (not sure if this query could be changed that way on your side...):

select *
 from (select  i.id  
         from SONAR_ADM.issues i
   inner join ( select s.project_id
                 from SONAR_ADM.snapshots s,
                    ( select project_components.id as id,
                             snapshot_components.id as sid,
                             root_snapshot_components.project_id as root_project_id,
                             root_snapshot_components.id as root_snapshot_id,
                             snapshot_components.path as path
                        from SONAR_ADM.projects project_components
                  inner join SONAR_ADM.snapshots snapshot_components on snapshot_components.project_id = project_components.id
                                                                    and snapshot_components.islast = 1
                   inner join (  SELECT p.kee as root_project_kee
                                   FROM SONAR_ADM.group_roles gr
                            INNER JOIN SONAR_ADM.projects p on p.id = gr.resource_id
                                                           AND p.scope = 'PRJ' AND p.qualifier = 'TRK'
                                 WHERE  gr.role='user'  
                                   and  gr.group_id is null ) authorized_projects on authorized_projects.root_project_kee = project_components.kee
                   inner join SONAR_ADM.snapshots root_snapshot_components on root_snapshot_components.project_id = snapshot_components.root_project_id
                                                                          and root_snapshot_components.islast = 1
                   inner join SONAR_ADM.projects root_project on root_project.id=root_snapshot_components.project_id
                        WHERE  ( project_components.kee='<key>' )
        and project_components.enabled = 1
    ) authorized_input_components
     WHERE  s.root_project_id = authorized_input_components.root_project_id
      and s.islast = 1
      and (
        (s.root_snapshot_id = authorized_input_components.root_snapshot_id
          and
         
              s.path LIKE authorized_input_components.path || authorized_input_components.sid || '.%'
           
        )
        or (s.id = authorized_input_components.sid)
      )
   ) authorizedComponents on authorizedComponents.project_id=i.component_id
     
    )
    where rownum <= 10000
Reply | Threaded
Open this post in threaded view
|

Re: Synchronization issues Using SonarCube Eclipse plugin 3.3.0 with Sonar 3.7.3

hgnoyke
This post has NOT been accepted by the mailing list yet.
As I had problems with subscribing to the mailing list I am not sure if my previous post is visible...
Therefore I am trying it again:

<snip>
Hi,

I am facing an issue with the same query fired by the initial analysis of SonarQube Eclipse plugin 3.3.0 with a Sonar 4.0 server.

Response times of actions on the server directly via the Web interface is ok.
The query takes over 30 seconds (40s in avg), so that the Eclipse plugin always runs into a timeout and I can not use it at all.

Our dba suggested to rewrite the query so that it returns in < 1s this way (not sure if this query could be changed that way on your side...):

select *
 from (select  i.id  
         from SONAR_ADM.issues i
   inner join ( select s.project_id
                 from SONAR_ADM.snapshots s,
                    ( select project_components.id as id,
                             snapshot_components.id as sid,
                             root_snapshot_components.project_id as root_project_id,
                             root_snapshot_components.id as root_snapshot_id,
                             snapshot_components.path as path
                        from SONAR_ADM.projects project_components
                  inner join SONAR_ADM.snapshots snapshot_components on snapshot_components.project_id = project_components.id
                                                                    and snapshot_components.islast = 1
                   inner join (  SELECT p.kee as root_project_kee
                                   FROM SONAR_ADM.group_roles gr
                            INNER JOIN SONAR_ADM.projects p on p.id = gr.resource_id
                                                           AND p.scope = 'PRJ' AND p.qualifier = 'TRK'
                                 WHERE  gr.role='user'  
                                   and  gr.group_id is null ) authorized_projects on authorized_projects.root_project_kee = project_components.kee
                   inner join SONAR_ADM.snapshots root_snapshot_components on root_snapshot_components.project_id = snapshot_components.root_project_id
                                                                          and root_snapshot_components.islast = 1
                   inner join SONAR_ADM.projects root_project on root_project.id=root_snapshot_components.project_id
                        WHERE  ( project_components.kee='<key>' )
        and project_components.enabled = 1
    ) authorized_input_components
     WHERE  s.root_project_id = authorized_input_components.root_project_id
      and s.islast = 1
      and (
        (s.root_snapshot_id = authorized_input_components.root_snapshot_id
          and
         
              s.path LIKE authorized_input_components.path || authorized_input_components.sid || '.%'
           
        )
        or (s.id = authorized_input_components.sid)
      )
   ) authorizedComponents on authorizedComponents.project_id=i.component_id
     
    )
    where rownum <= 10000
</snip>
Reply | Threaded
Open this post in threaded view
|

Re: Synchronization issues Using SonarCube Eclipse plugin 3.3.0 with Sonar 3.7.3

Kevinski
This post has NOT been accepted by the mailing list yet.
In reply to this post by satishKaRohini
It is almost May 2015 and I am having this exact issue with Eclipse SonarQube Plugin 3.4.0 connected to a SonarQube 4.5.4 instance.