Quantcast

Read timed out while trying to run an analysis

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Read timed out while trying to run an analysis

Balazuc, Denis

Hi list

 

I am trying to run a first analysis with Sonar 3.2 on an empty project (one main Java class only) for a proof of concept.

When I try to run the analysis, using Ant, Maven or sonar-runner, I get a “Read timed out” exception, no matter what I try.

(details further down).

 

I am behind a proxy, so I have set the proxy parameters in Sonar, as well as Ant and Maven, but this didn’t make any difference (without proxy settings, Sonar update page would not load, so I know those settings do work).

 

I have also tried to change the read timeout and connection timeout in Maven, but again, although the settings are taken into account by the Maven plugin (I can verify that a long timeout hangs for a long time), no cake for me.

 

I have been scourging the internet and tried to apply various recipes I’ve found (noticeably on this mailing list) but to no avail.

Any help or enlightenment would be very much appreciated.

 

Thanks a lot.

 

----- Details ----

 

I am running JDK 1.7 on a Windows 7-64 platform.

java version "1.7.0_07"

Java(TM) SE Runtime Environment (build 1.7.0_07-b10)

Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

 

The installation is the default Sonar 3.2 with the Derby database. I only added proxy settings to the properties and activated the “-server” JVM option on wrapper.conf.

Sonar 3.2, Ant 1.8, Maven3, and sonar-runner 1.4 are running from the same (local) machine.

 

-- Using Maven –

mvn clean install org.codehaus.sonar:sonar-maven-plugin:3.2:sonar -X –e

 

The Maven plugins tries to download “ http://localhost:9000/deploy/jdbc-driver.jar” but fails with  a “read timed out”.

I can fetch this file using any web browser or by using “wget” without problem.

 

[ERROR] Failed to execute goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar (

default-cli) on project poc: Execution default-cli of goal org.codehaus.sonar:so

nar-maven-plugin:3.2:sonar failed: Fail to download the file: http://localhost:9

000/deploy/jdbc-driver.jar (no proxy): Read timed out -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o

rg.codehaus.sonar:sonar-maven-plugin:3.2:sonar (default-cli) on project poc: Exe

cution default-cli of goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar faile

d: Fail to download the file: http://localhost:9000/deploy/jdbc-driver.jar (no p

roxy)

[SNIP non interesting part of the stacktrace]

Caused by: java.net.SocketTimeoutException: Read timed out

        at java.net.SocketInputStream.socketRead0(Native Method)

        at java.net.SocketInputStream.read(SocketInputStream.java:150)

        at java.net.SocketInputStream.read(SocketInputStream.java:121)

        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)

        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)

        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)

        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:633)

        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)

        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1322)

        at org.sonar.api.utils.HttpDownloader$HttpInputSupplier.getInput(HttpDow

nloader.java:200)

        at org.sonar.api.utils.HttpDownloader$HttpInputSupplier.getInput(HttpDow

nloader.java:184)

        at com.google.common.io.ByteStreams.copy(ByteStreams.java:116)

        at com.google.common.io.Files.copy(Files.java:231)

        at org.sonar.api.utils.HttpDownloader.download(HttpDownloader.java:173)

        ... 45 more

 

NOTE that using the “default” Sonar plugin with Maven (mvn sonar:sonar), I get a different error (Sonar server cannot be reached).

(of course the URL is the right one…)

 

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (d

efault-cli) on project poc: Sonar server can not be reached at http://localhost:

9000. Please check the parameter 'sonar.host.url'. -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o

rg.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project poc: Sona

r server can not be reached at http://localhost:9000. Please check the parameter

'sonar.host.url'.

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:217)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:153)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:145)

        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

ct(LifecycleModuleBuilder.java:84)

        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

ct(LifecycleModuleBuilder.java:59)

        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu

ild(LifecycleStarter.java:183)

        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl

eStarter.java:161)

        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)

        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)

        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)

        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)

        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun

cher.java:290)

        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav

a:230)

        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La

uncher.java:409)

        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:

352)

Caused by: org.apache.maven.plugin.MojoExecutionException: Sonar server can not

be reached at http://localhost:9000. Please check the parameter 'sonar.host.url'

.

        at org.codehaus.mojo.sonar.ServerMetadata.logSettings(ServerMetadata.jav

a:79)

        at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:86)

        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default

BuildPluginManager.java:101)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:209)

        ... 19 more

 

-- Using Ant  –

 

I get the same “read timed out” error but this time on a “Bootstrapper.getServerVersion()” request.

Note that the same result is produced if I use the sonar-runner application.

 

sonar:

[sonar:sonar] Apache Ant(TM) version 1.8.4 compiled on May 22 2012

[sonar:sonar] Sonar Ant Task version: 1.4

[sonar:sonar] Loaded from: file:/C:/dev/code-quality/sonar-3.2/ant/sonar-ant-tas

k-1.4.jar

[sonar:sonar] Sonar work directory: C:\dev\workspaces\code-quality\poc\.sonar

[sonar:sonar] Sonar server: http://localhost:9000

 

BUILD FAILED

C:\dev\workspaces\code-quality\poc\build.xml:17: org.sonar.batch.bootstrapper.Bo

otstrapException: Read timed out

        at org.sonar.batch.bootstrapper.Bootstrapper.getServerVersion(Bootstrapp

er.java:71)

        at org.sonar.ant.SonarTask.checkSonarVersion(SonarTask.java:264)

        at org.sonar.ant.SonarTask.execute(SonarTask.java:192)

        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav

a:106)

        at org.apache.tools.ant.Task.perform(Task.java:348)

        at org.apache.tools.ant.Target.execute(Target.java:392)

        at org.apache.tools.ant.Target.performTasks(Target.java:413)

        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)

        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)

        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe

cutor.java:41)

        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)

        at org.apache.tools.ant.Main.runBuild(Main.java:811)

        at org.apache.tools.ant.Main.startAnt(Main.java:217)

        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)

        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Caused by: java.net.SocketTimeoutException: Read timed out

        at java.net.SocketInputStream.socketRead0(Native Method)

        at java.net.SocketInputStream.read(SocketInputStream.java:150)

        at java.net.SocketInputStream.read(SocketInputStream.java:121)

        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)

        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)

        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)

        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:633)

        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)

        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1322)

        at java.net.URLConnection.getContent(URLConnection.java:748)

        at org.sonar.batch.bootstrapper.Bootstrapper.remoteContent(Bootstrapper.

java:123)

        at org.sonar.batch.bootstrapper.Bootstrapper.getServerVersion(Bootstrapp

er.java:69)

        ... 19 more

 

-- Using the Eclipse plugin –

Trying to attach an Eclipse project to Sonar gives me an “unknown error” which, according to the documentation, is likely to be an authentication error, but the user/passwords are set to the default ones (“admin”) either in the Eclipse plugin and in Sonar, so it is probably not that.

 

 

 



This electronic mail (including any attachments) may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents (including any attachments) by persons other than the intended recipient(s) is strictly prohibited. If you have received this message in error, please notify us immediately by reply e-mail so that we may correct our internal records. Please then delete the original message (including any attachments) in its entirety. Thank you.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Read timed out while trying to run an analysis

Freddy Mallet
Hi Denis,

If my understanding is correct the Sonar server is running on your local machine and you're launching the Sonar analysis on your local machine. So indeed if you've configured the Sonar analysis to use a proxy in order to access your local machine this can't work. On the other side perhaps Maven needs this proxy configuration to access to a public Maven repository ? 

In order to validate my feeling, could you give a try with the Sonar Runner without defining any proxy ?

Kind regards,
Freddy

-----
Sonar for Continuous Inspection



On Wed, Sep 12, 2012 at 7:26 PM, Balazuc, Denis <[hidden email]> wrote:

Hi list

 

I am trying to run a first analysis with Sonar 3.2 on an empty project (one main Java class only) for a proof of concept.

When I try to run the analysis, using Ant, Maven or sonar-runner, I get a “Read timed out” exception, no matter what I try.

(details further down).

 

I am behind a proxy, so I have set the proxy parameters in Sonar, as well as Ant and Maven, but this didn’t make any difference (without proxy settings, Sonar update page would not load, so I know those settings do work).

 

I have also tried to change the read timeout and connection timeout in Maven, but again, although the settings are taken into account by the Maven plugin (I can verify that a long timeout hangs for a long time), no cake for me.

 

I have been scourging the internet and tried to apply various recipes I’ve found (noticeably on this mailing list) but to no avail.

Any help or enlightenment would be very much appreciated.

 

Thanks a lot.

 

----- Details ----

 

I am running JDK 1.7 on a Windows 7-64 platform.

java version "1.7.0_07"

Java(TM) SE Runtime Environment (build 1.7.0_07-b10)

Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

 

The installation is the default Sonar 3.2 with the Derby database. I only added proxy settings to the properties and activated the “-server” JVM option on wrapper.conf.

Sonar 3.2, Ant 1.8, Maven3, and sonar-runner 1.4 are running from the same (local) machine.

 

-- Using Maven –

mvn clean install org.codehaus.sonar:sonar-maven-plugin:3.2:sonar -X –e

 

The Maven plugins tries to download “ http://localhost:9000/deploy/jdbc-driver.jar” but fails with  a “read timed out”.

I can fetch this file using any web browser or by using “wget” without problem.

 

[ERROR] Failed to execute goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar (

default-cli) on project poc: Execution default-cli of goal org.codehaus.sonar:so

nar-maven-plugin:3.2:sonar failed: Fail to download the file: http://localhost:9

000/deploy/jdbc-driver.jar (no proxy): Read timed out -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o

rg.codehaus.sonar:sonar-maven-plugin:3.2:sonar (default-cli) on project poc: Exe

cution default-cli of goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar faile

d: Fail to download the file: http://localhost:9000/deploy/jdbc-driver.jar (no p

roxy)

[SNIP non interesting part of the stacktrace]

Caused by: java.net.SocketTimeoutException: Read timed out

        at java.net.SocketInputStream.socketRead0(Native Method)

        at java.net.SocketInputStream.read(SocketInputStream.java:150)

        at java.net.SocketInputStream.read(SocketInputStream.java:121)

        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)

        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)

        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)

        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:633)

        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)

        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1322)

        at org.sonar.api.utils.HttpDownloader$HttpInputSupplier.getInput(HttpDow

nloader.java:200)

        at org.sonar.api.utils.HttpDownloader$HttpInputSupplier.getInput(HttpDow

nloader.java:184)

        at com.google.common.io.ByteStreams.copy(ByteStreams.java:116)

        at com.google.common.io.Files.copy(Files.java:231)

        at org.sonar.api.utils.HttpDownloader.download(HttpDownloader.java:173)

        ... 45 more

 

NOTE that using the “default” Sonar plugin with Maven (mvn sonar:sonar), I get a different error (Sonar server cannot be reached).

(of course the URL is the right one…)

 

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (d

efault-cli) on project poc: Sonar server can not be reached at http://localhost:

9000. Please check the parameter 'sonar.host.url'. -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o

rg.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project poc: Sona

r server can not be reached at http://localhost:9000. Please check the parameter

'sonar.host.url'.

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:217)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:153)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:145)

        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

ct(LifecycleModuleBuilder.java:84)

        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

ct(LifecycleModuleBuilder.java:59)

        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu

ild(LifecycleStarter.java:183)

        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl

eStarter.java:161)

        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)

        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)

        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)

        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)

        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun

cher.java:290)

        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav

a:230)

        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La

uncher.java:409)

        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:

352)

Caused by: org.apache.maven.plugin.MojoExecutionException: Sonar server can not

be reached at http://localhost:9000. Please check the parameter 'sonar.host.url'

.

        at org.codehaus.mojo.sonar.ServerMetadata.logSettings(ServerMetadata.jav

a:79)

        at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:86)

        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default

BuildPluginManager.java:101)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:209)

        ... 19 more

 

-- Using Ant  –

 

I get the same “read timed out” error but this time on a “Bootstrapper.getServerVersion()” request.

Note that the same result is produced if I use the sonar-runner application.

 

sonar:

[sonar:sonar] Apache Ant(TM) version 1.8.4 compiled on May 22 2012

[sonar:sonar] Sonar Ant Task version: 1.4

[sonar:sonar] Loaded from: file:/C:/dev/code-quality/sonar-3.2/ant/sonar-ant-tas

k-1.4.jar

[sonar:sonar] Sonar work directory: C:\dev\workspaces\code-quality\poc\.sonar

[sonar:sonar] Sonar server: http://localhost:9000

 

BUILD FAILED

C:\dev\workspaces\code-quality\poc\build.xml:17: org.sonar.batch.bootstrapper.Bo

otstrapException: Read timed out

        at org.sonar.batch.bootstrapper.Bootstrapper.getServerVersion(Bootstrapp

er.java:71)

        at org.sonar.ant.SonarTask.checkSonarVersion(SonarTask.java:264)

        at org.sonar.ant.SonarTask.execute(SonarTask.java:192)

        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav

a:106)

        at org.apache.tools.ant.Task.perform(Task.java:348)

        at org.apache.tools.ant.Target.execute(Target.java:392)

        at org.apache.tools.ant.Target.performTasks(Target.java:413)

        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)

        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)

        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe

cutor.java:41)

        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)

        at org.apache.tools.ant.Main.runBuild(Main.java:811)

        at org.apache.tools.ant.Main.startAnt(Main.java:217)

        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)

        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Caused by: java.net.SocketTimeoutException: Read timed out

        at java.net.SocketInputStream.socketRead0(Native Method)

        at java.net.SocketInputStream.read(SocketInputStream.java:150)

        at java.net.SocketInputStream.read(SocketInputStream.java:121)

        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)

        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)

        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)

        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:633)

        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)

        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1322)

        at java.net.URLConnection.getContent(URLConnection.java:748)

        at org.sonar.batch.bootstrapper.Bootstrapper.remoteContent(Bootstrapper.

java:123)

        at org.sonar.batch.bootstrapper.Bootstrapper.getServerVersion(Bootstrapp

er.java:69)

        ... 19 more

 

-- Using the Eclipse plugin –

Trying to attach an Eclipse project to Sonar gives me an “unknown error” which, according to the documentation, is likely to be an authentication error, but the user/passwords are set to the default ones (“admin”) either in the Eclipse plugin and in Sonar, so it is probably not that.

 

 

 



This electronic mail (including any attachments) may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents (including any attachments) by persons other than the intended recipient(s) is strictly prohibited. If you have received this message in error, please notify us immediately by reply e-mail so that we may correct our internal records. Please then delete the original message (including any attachments) in its entirety. Thank you.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Read timed out while trying to run an analysis

Balazuc, Denis

Hi Freddy

 

Thanks a lot for the quick reply.

 

Alas, with or without proxy settings, the problem remains the same. I had also thought there was a hidden reverse proxy on my network that would cause troubles, but that doesn’t seem to be the case either.

 

Given that the 3 different approaches (Ant, Maven & sonar-runner) produce the same kind of error, I am a little confused and wonder if using JDK 1.7 would be an issue. At this point, I am a bit out of possible options and I’m confused as to what could be the cause since a simple wget works just fine.

 

I will also try my setup on a different network environment (devoid of proxies or other network oddities) when I have some time, and follow up on that.

 

Thanks again

Denis

 

From: Freddy Mallet [mailto:[hidden email]]
Sent: Wednesday, September 12, 2012 2:57 PM
To: [hidden email]
Subject: Re: [sonar-user] Read timed out while trying to run an analysis

 

Hi Denis,

 

If my understanding is correct the Sonar server is running on your local machine and you're launching the Sonar analysis on your local machine. So indeed if you've configured the Sonar analysis to use a proxy in order to access your local machine this can't work. On the other side perhaps Maven needs this proxy configuration to access to a public Maven repository ? 

 

In order to validate my feeling, could you give a try with the Sonar Runner without defining any proxy ?

 

Kind regards,

Freddy

 

-----

Sonar for Continuous Inspection



On Wed, Sep 12, 2012 at 7:26 PM, Balazuc, Denis <[hidden email]> wrote:

Hi list

 

I am trying to run a first analysis with Sonar 3.2 on an empty project (one main Java class only) for a proof of concept.

When I try to run the analysis, using Ant, Maven or sonar-runner, I get a “Read timed out” exception, no matter what I try.

(details further down).

 

I am behind a proxy, so I have set the proxy parameters in Sonar, as well as Ant and Maven, but this didn’t make any difference (without proxy settings, Sonar update page would not load, so I know those settings do work).

 

I have also tried to change the read timeout and connection timeout in Maven, but again, although the settings are taken into account by the Maven plugin (I can verify that a long timeout hangs for a long time), no cake for me.

 

I have been scourging the internet and tried to apply various recipes I’ve found (noticeably on this mailing list) but to no avail.

Any help or enlightenment would be very much appreciated.

 

Thanks a lot.

 

----- Details ----

 

I am running JDK 1.7 on a Windows 7-64 platform.

java version "1.7.0_07"

Java(TM) SE Runtime Environment (build 1.7.0_07-b10)

Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

 

The installation is the default Sonar 3.2 with the Derby database. I only added proxy settings to the properties and activated the “-server” JVM option on wrapper.conf.

Sonar 3.2, Ant 1.8, Maven3, and sonar-runner 1.4 are running from the same (local) machine.

 

-- Using Maven –

mvn clean install org.codehaus.sonar:sonar-maven-plugin:3.2:sonar -X –e

 

The Maven plugins tries to download “ http://localhost:9000/deploy/jdbc-driver.jar” but fails with  a “read timed out”.

I can fetch this file using any web browser or by using “wget” without problem.

 

[ERROR] Failed to execute goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar (

default-cli) on project poc: Execution default-cli of goal org.codehaus.sonar:so

nar-maven-plugin:3.2:sonar failed: Fail to download the file: http://localhost:9

000/deploy/jdbc-driver.jar (no proxy): Read timed out -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o

rg.codehaus.sonar:sonar-maven-plugin:3.2:sonar (default-cli) on project poc: Exe

cution default-cli of goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar faile

d: Fail to download the file: http://localhost:9000/deploy/jdbc-driver.jar (no p

roxy)

[SNIP non interesting part of the stacktrace]

Caused by: java.net.SocketTimeoutException: Read timed out

        at java.net.SocketInputStream.socketRead0(Native Method)

        at java.net.SocketInputStream.read(SocketInputStream.java:150)

        at java.net.SocketInputStream.read(SocketInputStream.java:121)

        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)

        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)

        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)

        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:633)

        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)

        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1322)

        at org.sonar.api.utils.HttpDownloader$HttpInputSupplier.getInput(HttpDow

nloader.java:200)

        at org.sonar.api.utils.HttpDownloader$HttpInputSupplier.getInput(HttpDow

nloader.java:184)

        at com.google.common.io.ByteStreams.copy(ByteStreams.java:116)

        at com.google.common.io.Files.copy(Files.java:231)

        at org.sonar.api.utils.HttpDownloader.download(HttpDownloader.java:173)

        ... 45 more

 

NOTE that using the “default” Sonar plugin with Maven (mvn sonar:sonar), I get a different error (Sonar server cannot be reached).

(of course the URL is the right one…)

 

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (d

efault-cli) on project poc: Sonar server can not be reached at http://localhost:

9000. Please check the parameter 'sonar.host.url'. -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o

rg.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project poc: Sona

r server can not be reached at http://localhost:9000. Please check the parameter

'sonar.host.url'.

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:217)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:153)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:145)

        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

ct(LifecycleModuleBuilder.java:84)

        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

ct(LifecycleModuleBuilder.java:59)

        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu

ild(LifecycleStarter.java:183)

        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl

eStarter.java:161)

        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)

        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)

        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)

        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)

        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun

cher.java:290)

        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav

a:230)

        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La

uncher.java:409)

        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:

352)

Caused by: org.apache.maven.plugin.MojoExecutionException: Sonar server can not

be reached at http://localhost:9000. Please check the parameter 'sonar.host.url'

.

        at org.codehaus.mojo.sonar.ServerMetadata.logSettings(ServerMetadata.jav

a:79)

        at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:86)

        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default

BuildPluginManager.java:101)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:209)

        ... 19 more

 

-- Using Ant  –

 

I get the same “read timed out” error but this time on a “Bootstrapper.getServerVersion()” request.

Note that the same result is produced if I use the sonar-runner application.

 

sonar:

[sonar:sonar] Apache Ant(TM) version 1.8.4 compiled on May 22 2012

[sonar:sonar] Sonar Ant Task version: 1.4

[sonar:sonar] Loaded from: file:/C:/dev/code-quality/sonar-3.2/ant/sonar-ant-tas

k-1.4.jar

[sonar:sonar] Sonar work directory: C:\dev\workspaces\code-quality\poc\.sonar

[sonar:sonar] Sonar server: http://localhost:9000

 

BUILD FAILED

C:\dev\workspaces\code-quality\poc\build.xml:17: org.sonar.batch.bootstrapper.Bo

otstrapException: Read timed out

        at org.sonar.batch.bootstrapper.Bootstrapper.getServerVersion(Bootstrapp

er.java:71)

        at org.sonar.ant.SonarTask.checkSonarVersion(SonarTask.java:264)

        at org.sonar.ant.SonarTask.execute(SonarTask.java:192)

        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav

a:106)

        at org.apache.tools.ant.Task.perform(Task.java:348)

        at org.apache.tools.ant.Target.execute(Target.java:392)

        at org.apache.tools.ant.Target.performTasks(Target.java:413)

        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)

        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)

        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe

cutor.java:41)

        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)

        at org.apache.tools.ant.Main.runBuild(Main.java:811)

        at org.apache.tools.ant.Main.startAnt(Main.java:217)

        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)

        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Caused by: java.net.SocketTimeoutException: Read timed out

        at java.net.SocketInputStream.socketRead0(Native Method)

        at java.net.SocketInputStream.read(SocketInputStream.java:150)

        at java.net.SocketInputStream.read(SocketInputStream.java:121)

        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)

        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)

        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)

        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:633)

        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)

        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1322)

        at java.net.URLConnection.getContent(URLConnection.java:748)

        at org.sonar.batch.bootstrapper.Bootstrapper.remoteContent(Bootstrapper.

java:123)

        at org.sonar.batch.bootstrapper.Bootstrapper.getServerVersion(Bootstrapp

er.java:69)

        ... 19 more

 

-- Using the Eclipse plugin –

Trying to attach an Eclipse project to Sonar gives me an “unknown error” which, according to the documentation, is likely to be an authentication error, but the user/passwords are set to the default ones (“admin”) either in the Eclipse plugin and in Sonar, so it is probably not that.

 

 

 

 


This electronic mail (including any attachments) may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents (including any attachments) by persons other than the intended recipient(s) is strictly prohibited. If you have received this message in error, please notify us immediately by reply e-mail so that we may correct our internal records. Please then delete the original message (including any attachments) in its entirety. Thank you.

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Read timed out while trying to run an analysis

Freddy Mallet
Hi Denis,

Alas, with or without proxy settings, the problem remains the same. I had also thought there was a hidden reverse proxy on my network that would cause troubles, but that doesn’t seem to be the case either.

Given that the 3 different approaches (Ant, Maven & sonar-runner) produce the same kind of error, I am a little confused and wonder if using JDK 1.7 would be an issue. At this point, I am a bit out of possible options and I’m confused as to what could be the cause since a simple wget works just fine.


I'm pretty sure that you always encounter this issue because whatever is the reason the proxy configuration is always taken into account by the Sonar analysis. Where have you defined this configuration ?

Kind regards,
Freddy

 

I will also try my setup on a different network environment (devoid of proxies or other network oddities) when I have some time, and follow up on that.

 

Thanks again

Denis

 

From: Freddy Mallet [mailto:[hidden email]]
Sent: Wednesday, September 12, 2012 2:57 PM
To: [hidden email]
Subject: Re: [sonar-user] Read timed out while trying to run an analysis

 

Hi Denis,

 

If my understanding is correct the Sonar server is running on your local machine and you're launching the Sonar analysis on your local machine. So indeed if you've configured the Sonar analysis to use a proxy in order to access your local machine this can't work. On the other side perhaps Maven needs this proxy configuration to access to a public Maven repository ? 

 

In order to validate my feeling, could you give a try with the Sonar Runner without defining any proxy ?

 

Kind regards,

Freddy

 

-----

Sonar for Continuous Inspection



On Wed, Sep 12, 2012 at 7:26 PM, Balazuc, Denis <[hidden email]> wrote:

Hi list

 

I am trying to run a first analysis with Sonar 3.2 on an empty project (one main Java class only) for a proof of concept.

When I try to run the analysis, using Ant, Maven or sonar-runner, I get a “Read timed out” exception, no matter what I try.

(details further down).

 

I am behind a proxy, so I have set the proxy parameters in Sonar, as well as Ant and Maven, but this didn’t make any difference (without proxy settings, Sonar update page would not load, so I know those settings do work).

 

I have also tried to change the read timeout and connection timeout in Maven, but again, although the settings are taken into account by the Maven plugin (I can verify that a long timeout hangs for a long time), no cake for me.

 

I have been scourging the internet and tried to apply various recipes I’ve found (noticeably on this mailing list) but to no avail.

Any help or enlightenment would be very much appreciated.

 

Thanks a lot.

 

----- Details ----

 

I am running JDK 1.7 on a Windows 7-64 platform.

java version "1.7.0_07"

Java(TM) SE Runtime Environment (build 1.7.0_07-b10)

Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

 

The installation is the default Sonar 3.2 with the Derby database. I only added proxy settings to the properties and activated the “-server” JVM option on wrapper.conf.

Sonar 3.2, Ant 1.8, Maven3, and sonar-runner 1.4 are running from the same (local) machine.

 

-- Using Maven –

mvn clean install org.codehaus.sonar:sonar-maven-plugin:3.2:sonar -X –e

 

The Maven plugins tries to download “ http://localhost:9000/deploy/jdbc-driver.jar” but fails with  a “read timed out”.

I can fetch this file using any web browser or by using “wget” without problem.

 

[ERROR] Failed to execute goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar (

default-cli) on project poc: Execution default-cli of goal org.codehaus.sonar:so

nar-maven-plugin:3.2:sonar failed: Fail to download the file: http://localhost:9

000/deploy/jdbc-driver.jar (no proxy): Read timed out -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o

rg.codehaus.sonar:sonar-maven-plugin:3.2:sonar (default-cli) on project poc: Exe

cution default-cli of goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar faile

d: Fail to download the file: http://localhost:9000/deploy/jdbc-driver.jar (no p

roxy)

[SNIP non interesting part of the stacktrace]

Caused by: java.net.SocketTimeoutException: Read timed out

        at java.net.SocketInputStream.socketRead0(Native Method)

        at java.net.SocketInputStream.read(SocketInputStream.java:150)

        at java.net.SocketInputStream.read(SocketInputStream.java:121)

        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)

        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)

        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)

        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:633)

        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)

        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1322)

        at org.sonar.api.utils.HttpDownloader$HttpInputSupplier.getInput(HttpDow

nloader.java:200)

        at org.sonar.api.utils.HttpDownloader$HttpInputSupplier.getInput(HttpDow

nloader.java:184)

        at com.google.common.io.ByteStreams.copy(ByteStreams.java:116)

        at com.google.common.io.Files.copy(Files.java:231)

        at org.sonar.api.utils.HttpDownloader.download(HttpDownloader.java:173)

        ... 45 more

 

NOTE that using the “default” Sonar plugin with Maven (mvn sonar:sonar), I get a different error (Sonar server cannot be reached).

(of course the URL is the right one…)

 

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (d

efault-cli) on project poc: Sonar server can not be reached at http://localhost:

9000. Please check the parameter 'sonar.host.url'. -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o

rg.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project poc: Sona

r server can not be reached at http://localhost:9000. Please check the parameter

'sonar.host.url'.

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:217)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:153)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:145)

        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

ct(LifecycleModuleBuilder.java:84)

        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

ct(LifecycleModuleBuilder.java:59)

        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu

ild(LifecycleStarter.java:183)

        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl

eStarter.java:161)

        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)

        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)

        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)

        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)

        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun

cher.java:290)

        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav

a:230)

        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La

uncher.java:409)

        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:

352)

Caused by: org.apache.maven.plugin.MojoExecutionException: Sonar server can not

be reached at http://localhost:9000. Please check the parameter 'sonar.host.url'

.

        at org.codehaus.mojo.sonar.ServerMetadata.logSettings(ServerMetadata.jav

a:79)

        at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:86)

        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default

BuildPluginManager.java:101)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:209)

        ... 19 more

 

-- Using Ant  –

 

I get the same “read timed out” error but this time on a “Bootstrapper.getServerVersion()” request.

Note that the same result is produced if I use the sonar-runner application.

 

sonar:

[sonar:sonar] Apache Ant(TM) version 1.8.4 compiled on May 22 2012

[sonar:sonar] Sonar Ant Task version: 1.4

[sonar:sonar] Loaded from: file:/C:/dev/code-quality/sonar-3.2/ant/sonar-ant-tas

k-1.4.jar

[sonar:sonar] Sonar work directory: C:\dev\workspaces\code-quality\poc\.sonar

[sonar:sonar] Sonar server: http://localhost:9000

 

BUILD FAILED

C:\dev\workspaces\code-quality\poc\build.xml:17: org.sonar.batch.bootstrapper.Bo

otstrapException: Read timed out

        at org.sonar.batch.bootstrapper.Bootstrapper.getServerVersion(Bootstrapp

er.java:71)

        at org.sonar.ant.SonarTask.checkSonarVersion(SonarTask.java:264)

        at org.sonar.ant.SonarTask.execute(SonarTask.java:192)

        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav

a:106)

        at org.apache.tools.ant.Task.perform(Task.java:348)

        at org.apache.tools.ant.Target.execute(Target.java:392)

        at org.apache.tools.ant.Target.performTasks(Target.java:413)

        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)

        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)

        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe

cutor.java:41)

        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)

        at org.apache.tools.ant.Main.runBuild(Main.java:811)

        at org.apache.tools.ant.Main.startAnt(Main.java:217)

        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)

        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Caused by: java.net.SocketTimeoutException: Read timed out

        at java.net.SocketInputStream.socketRead0(Native Method)

        at java.net.SocketInputStream.read(SocketInputStream.java:150)

        at java.net.SocketInputStream.read(SocketInputStream.java:121)

        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)

        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)

        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)

        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:633)

        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)

        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1322)

        at java.net.URLConnection.getContent(URLConnection.java:748)

        at org.sonar.batch.bootstrapper.Bootstrapper.remoteContent(Bootstrapper.

java:123)

        at org.sonar.batch.bootstrapper.Bootstrapper.getServerVersion(Bootstrapp

er.java:69)

        ... 19 more

 

-- Using the Eclipse plugin –

Trying to attach an Eclipse project to Sonar gives me an “unknown error” which, according to the documentation, is likely to be an authentication error, but the user/passwords are set to the default ones (“admin”) either in the Eclipse plugin and in Sonar, so it is probably not that.

 

 

 

 


This electronic mail (including any attachments) may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents (including any attachments) by persons other than the intended recipient(s) is strictly prohibited. If you have received this message in error, please notify us immediately by reply e-mail so that we may correct our internal records. Please then delete the original message (including any attachments) in its entirety. Thank you.

 


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Read timed out while trying to run an analysis

Balazuc, Denis

Hi Freddy

 

Well, I have tried to poke around any config file I could change basically ;-)

·         The java plugin (just in case I was wrongly using a JRE instead of the JDK)

·         Maven settings

·         In Eclipse for the Eclipse plugin

·         Using “–DhttpProxy=” parameters on the java command line

·         I even tried disabling the proxy setting in Sonar 3.2 itself…

 

But again, wiping ALL the proxy configurations didn’t change the situation.

I will create a new pristine install of the same environment I use from a different network environment, and report back to you with my results.

 

However, this makes me think: is there any kind of authentication token that needs to be passed to Sonar from those “client”  tools to request files and such? My Sonar installation has a user (me) and the admin one but I see nowhere where I can specify my credentials before running analysis.

 

Thanks again for your help

Denis

 

From: Freddy Mallet [mailto:[hidden email]]
Sent: Wednesday, September 12, 2012 3:25 PM
To: [hidden email]
Subject: Re: [sonar-user] Read timed out while trying to run an analysis

 

Hi Denis,

 

Alas, with or without proxy settings, the problem remains the same. I had also thought there was a hidden reverse proxy on my network that would cause troubles, but that doesn’t seem to be the case either.

Given that the 3 different approaches (Ant, Maven & sonar-runner) produce the same kind of error, I am a little confused and wonder if using JDK 1.7 would be an issue. At this point, I am a bit out of possible options and I’m confused as to what could be the cause since a simple wget works just fine.

 

I'm pretty sure that you always encounter this issue because whatever is the reason the proxy configuration is always taken into account by the Sonar analysis. Where have you defined this configuration ?

 

Kind regards,

Freddy

 

I will also try my setup on a different network environment (devoid of proxies or other network oddities) when I have some time, and follow up on that.

 

Thanks again

Denis

 

From: Freddy Mallet [mailto:[hidden email]]
Sent: Wednesday, September 12, 2012 2:57 PM
To: [hidden email]
Subject: Re: [sonar-user] Read timed out while trying to run an analysis

 

Hi Denis,

 

If my understanding is correct the Sonar server is running on your local machine and you're launching the Sonar analysis on your local machine. So indeed if you've configured the Sonar analysis to use a proxy in order to access your local machine this can't work. On the other side perhaps Maven needs this proxy configuration to access to a public Maven repository ? 

 

In order to validate my feeling, could you give a try with the Sonar Runner without defining any proxy ?

 

Kind regards,

Freddy

 

-----

Sonar for Continuous Inspection

 

On Wed, Sep 12, 2012 at 7:26 PM, Balazuc, Denis <[hidden email]> wrote:

Hi list

 

I am trying to run a first analysis with Sonar 3.2 on an empty project (one main Java class only) for a proof of concept.

When I try to run the analysis, using Ant, Maven or sonar-runner, I get a “Read timed out” exception, no matter what I try.

(details further down).

 

I am behind a proxy, so I have set the proxy parameters in Sonar, as well as Ant and Maven, but this didn’t make any difference (without proxy settings, Sonar update page would not load, so I know those settings do work).

 

I have also tried to change the read timeout and connection timeout in Maven, but again, although the settings are taken into account by the Maven plugin (I can verify that a long timeout hangs for a long time), no cake for me.

 

I have been scourging the internet and tried to apply various recipes I’ve found (noticeably on this mailing list) but to no avail.

Any help or enlightenment would be very much appreciated.

 

Thanks a lot.

 

----- Details ----

 

I am running JDK 1.7 on a Windows 7-64 platform.

java version "1.7.0_07"

Java(TM) SE Runtime Environment (build 1.7.0_07-b10)

Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

 

The installation is the default Sonar 3.2 with the Derby database. I only added proxy settings to the properties and activated the “-server” JVM option on wrapper.conf.

Sonar 3.2, Ant 1.8, Maven3, and sonar-runner 1.4 are running from the same (local) machine.

 

-- Using Maven –

mvn clean install org.codehaus.sonar:sonar-maven-plugin:3.2:sonar -X –e

 

The Maven plugins tries to download “ http://localhost:9000/deploy/jdbc-driver.jar” but fails with  a “read timed out”.

I can fetch this file using any web browser or by using “wget” without problem.

 

[ERROR] Failed to execute goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar (

default-cli) on project poc: Execution default-cli of goal org.codehaus.sonar:so

nar-maven-plugin:3.2:sonar failed: Fail to download the file: http://localhost:9

000/deploy/jdbc-driver.jar (no proxy): Read timed out -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o

rg.codehaus.sonar:sonar-maven-plugin:3.2:sonar (default-cli) on project poc: Exe

cution default-cli of goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar faile

d: Fail to download the file: http://localhost:9000/deploy/jdbc-driver.jar (no p

roxy)

[SNIP non interesting part of the stacktrace]

Caused by: java.net.SocketTimeoutException: Read timed out

        at java.net.SocketInputStream.socketRead0(Native Method)

        at java.net.SocketInputStream.read(SocketInputStream.java:150)

        at java.net.SocketInputStream.read(SocketInputStream.java:121)

        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)

        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)

        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)

        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:633)

        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)

        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1322)

        at org.sonar.api.utils.HttpDownloader$HttpInputSupplier.getInput(HttpDow

nloader.java:200)

        at org.sonar.api.utils.HttpDownloader$HttpInputSupplier.getInput(HttpDow

nloader.java:184)

        at com.google.common.io.ByteStreams.copy(ByteStreams.java:116)

        at com.google.common.io.Files.copy(Files.java:231)

        at org.sonar.api.utils.HttpDownloader.download(HttpDownloader.java:173)

        ... 45 more

 

NOTE that using the “default” Sonar plugin with Maven (mvn sonar:sonar), I get a different error (Sonar server cannot be reached).

(of course the URL is the right one…)

 

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (d

efault-cli) on project poc: Sonar server can not be reached at http://localhost:

9000. Please check the parameter 'sonar.host.url'. -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o

rg.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project poc: Sona

r server can not be reached at http://localhost:9000. Please check the parameter

'sonar.host.url'.

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:217)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:153)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:145)

        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

ct(LifecycleModuleBuilder.java:84)

        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

ct(LifecycleModuleBuilder.java:59)

        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu

ild(LifecycleStarter.java:183)

        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl

eStarter.java:161)

        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)

        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)

        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)

        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)

        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun

cher.java:290)

        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav

a:230)

        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La

uncher.java:409)

        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:

352)

Caused by: org.apache.maven.plugin.MojoExecutionException: Sonar server can not

be reached at http://localhost:9000. Please check the parameter 'sonar.host.url'

.

        at org.codehaus.mojo.sonar.ServerMetadata.logSettings(ServerMetadata.jav

a:79)

        at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:86)

        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default

BuildPluginManager.java:101)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:209)

        ... 19 more

 

-- Using Ant  –

 

I get the same “read timed out” error but this time on a “Bootstrapper.getServerVersion()” request.

Note that the same result is produced if I use the sonar-runner application.

 

sonar:

[sonar:sonar] Apache Ant(TM) version 1.8.4 compiled on May 22 2012

[sonar:sonar] Sonar Ant Task version: 1.4

[sonar:sonar] Loaded from: file:/C:/dev/code-quality/sonar-3.2/ant/sonar-ant-tas

k-1.4.jar

[sonar:sonar] Sonar work directory: C:\dev\workspaces\code-quality\poc\.sonar

[sonar:sonar] Sonar server: http://localhost:9000

 

BUILD FAILED

C:\dev\workspaces\code-quality\poc\build.xml:17: org.sonar.batch.bootstrapper.Bo

otstrapException: Read timed out

        at org.sonar.batch.bootstrapper.Bootstrapper.getServerVersion(Bootstrapp

er.java:71)

        at org.sonar.ant.SonarTask.checkSonarVersion(SonarTask.java:264)

        at org.sonar.ant.SonarTask.execute(SonarTask.java:192)

        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav

a:106)

        at org.apache.tools.ant.Task.perform(Task.java:348)

        at org.apache.tools.ant.Target.execute(Target.java:392)

        at org.apache.tools.ant.Target.performTasks(Target.java:413)

        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)

        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)

        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe

cutor.java:41)

        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)

        at org.apache.tools.ant.Main.runBuild(Main.java:811)

        at org.apache.tools.ant.Main.startAnt(Main.java:217)

        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)

        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Caused by: java.net.SocketTimeoutException: Read timed out

        at java.net.SocketInputStream.socketRead0(Native Method)

        at java.net.SocketInputStream.read(SocketInputStream.java:150)

        at java.net.SocketInputStream.read(SocketInputStream.java:121)

        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)

        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)

        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)

        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:633)

        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)

        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1322)

        at java.net.URLConnection.getContent(URLConnection.java:748)

        at org.sonar.batch.bootstrapper.Bootstrapper.remoteContent(Bootstrapper.

java:123)

        at org.sonar.batch.bootstrapper.Bootstrapper.getServerVersion(Bootstrapp

er.java:69)

        ... 19 more

 

-- Using the Eclipse plugin –

Trying to attach an Eclipse project to Sonar gives me an “unknown error” which, according to the documentation, is likely to be an authentication error, but the user/passwords are set to the default ones (“admin”) either in the Eclipse plugin and in Sonar, so it is probably not that.

 

 

 

 


This electronic mail (including any attachments) may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents (including any attachments) by persons other than the intended recipient(s) is strictly prohibited. If you have received this message in error, please notify us immediately by reply e-mail so that we may correct our internal records. Please then delete the original message (including any attachments) in its entirety. Thank you.

 

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Read timed out while trying to run an analysis

Balazuc, Denis

Also, I am pretty sure at least the Maven plugin doesn’t proxy its connection since the stacktrace shows “(no proxy)”

 

Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar failed:

Fail to download the file: http://localhost:9000/deploy/jdbc-driver.jar (no proxy)

 

Cheers

 

From: Balazuc, Denis [mailto:[hidden email]]
Sent: Wednesday, September 12, 2012 3:40 PM
To: [hidden email]
Subject: RE: [sonar-user] Read timed out while trying to run an analysis

 

Hi Freddy

 

Well, I have tried to poke around any config file I could change basically ;-)

·         The java plugin (just in case I was wrongly using a JRE instead of the JDK)

·         Maven settings

·         In Eclipse for the Eclipse plugin

·         Using “–DhttpProxy=” parameters on the java command line

·         I even tried disabling the proxy setting in Sonar 3.2 itself…

 

But again, wiping ALL the proxy configurations didn’t change the situation.

I will create a new pristine install of the same environment I use from a different network environment, and report back to you with my results.

 

However, this makes me think: is there any kind of authentication token that needs to be passed to Sonar from those “client”  tools to request files and such? My Sonar installation has a user (me) and the admin one but I see nowhere where I can specify my credentials before running analysis.

 

Thanks again for your help

Denis

 

From: Freddy Mallet [mailto:[hidden email]]
Sent: Wednesday, September 12, 2012 3:25 PM
To: [hidden email]
Subject: Re: [sonar-user] Read timed out while trying to run an analysis

 

Hi Denis,

 

Alas, with or without proxy settings, the problem remains the same. I had also thought there was a hidden reverse proxy on my network that would cause troubles, but that doesn’t seem to be the case either.

Given that the 3 different approaches (Ant, Maven & sonar-runner) produce the same kind of error, I am a little confused and wonder if using JDK 1.7 would be an issue. At this point, I am a bit out of possible options and I’m confused as to what could be the cause since a simple wget works just fine.

 

I'm pretty sure that you always encounter this issue because whatever is the reason the proxy configuration is always taken into account by the Sonar analysis. Where have you defined this configuration ?

 

Kind regards,

Freddy

 

I will also try my setup on a different network environment (devoid of proxies or other network oddities) when I have some time, and follow up on that.

 

Thanks again

Denis

 

From: Freddy Mallet [mailto:[hidden email]]
Sent: Wednesday, September 12, 2012 2:57 PM
To: [hidden email]
Subject: Re: [sonar-user] Read timed out while trying to run an analysis

 

Hi Denis,

 

If my understanding is correct the Sonar server is running on your local machine and you're launching the Sonar analysis on your local machine. So indeed if you've configured the Sonar analysis to use a proxy in order to access your local machine this can't work. On the other side perhaps Maven needs this proxy configuration to access to a public Maven repository ? 

 

In order to validate my feeling, could you give a try with the Sonar Runner without defining any proxy ?

 

Kind regards,

Freddy

 

-----

Sonar for Continuous Inspection

 

On Wed, Sep 12, 2012 at 7:26 PM, Balazuc, Denis <[hidden email]> wrote:

Hi list

 

I am trying to run a first analysis with Sonar 3.2 on an empty project (one main Java class only) for a proof of concept.

When I try to run the analysis, using Ant, Maven or sonar-runner, I get a “Read timed out” exception, no matter what I try.

(details further down).

 

I am behind a proxy, so I have set the proxy parameters in Sonar, as well as Ant and Maven, but this didn’t make any difference (without proxy settings, Sonar update page would not load, so I know those settings do work).

 

I have also tried to change the read timeout and connection timeout in Maven, but again, although the settings are taken into account by the Maven plugin (I can verify that a long timeout hangs for a long time), no cake for me.

 

I have been scourging the internet and tried to apply various recipes I’ve found (noticeably on this mailing list) but to no avail.

Any help or enlightenment would be very much appreciated.

 

Thanks a lot.

 

----- Details ----

 

I am running JDK 1.7 on a Windows 7-64 platform.

java version "1.7.0_07"

Java(TM) SE Runtime Environment (build 1.7.0_07-b10)

Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

 

The installation is the default Sonar 3.2 with the Derby database. I only added proxy settings to the properties and activated the “-server” JVM option on wrapper.conf.

Sonar 3.2, Ant 1.8, Maven3, and sonar-runner 1.4 are running from the same (local) machine.

 

-- Using Maven –

mvn clean install org.codehaus.sonar:sonar-maven-plugin:3.2:sonar -X –e

 

The Maven plugins tries to download “ http://localhost:9000/deploy/jdbc-driver.jar” but fails with  a “read timed out”.

I can fetch this file using any web browser or by using “wget” without problem.

 

[ERROR] Failed to execute goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar (

default-cli) on project poc: Execution default-cli of goal org.codehaus.sonar:so

nar-maven-plugin:3.2:sonar failed: Fail to download the file: http://localhost:9

000/deploy/jdbc-driver.jar (no proxy): Read timed out -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o

rg.codehaus.sonar:sonar-maven-plugin:3.2:sonar (default-cli) on project poc: Exe

cution default-cli of goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar faile

d: Fail to download the file: http://localhost:9000/deploy/jdbc-driver.jar (no p

roxy)

[SNIP non interesting part of the stacktrace]

Caused by: java.net.SocketTimeoutException: Read timed out

        at java.net.SocketInputStream.socketRead0(Native Method)

        at java.net.SocketInputStream.read(SocketInputStream.java:150)

        at java.net.SocketInputStream.read(SocketInputStream.java:121)

        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)

        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)

        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)

        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:633)

        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)

        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1322)

        at org.sonar.api.utils.HttpDownloader$HttpInputSupplier.getInput(HttpDow

nloader.java:200)

        at org.sonar.api.utils.HttpDownloader$HttpInputSupplier.getInput(HttpDow

nloader.java:184)

        at com.google.common.io.ByteStreams.copy(ByteStreams.java:116)

        at com.google.common.io.Files.copy(Files.java:231)

        at org.sonar.api.utils.HttpDownloader.download(HttpDownloader.java:173)

        ... 45 more

 

NOTE that using the “default” Sonar plugin with Maven (mvn sonar:sonar), I get a different error (Sonar server cannot be reached).

(of course the URL is the right one…)

 

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (d

efault-cli) on project poc: Sonar server can not be reached at http://localhost:

9000. Please check the parameter 'sonar.host.url'. -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o

rg.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project poc: Sona

r server can not be reached at http://localhost:9000. Please check the parameter

'sonar.host.url'.

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:217)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:153)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:145)

        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

ct(LifecycleModuleBuilder.java:84)

        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

ct(LifecycleModuleBuilder.java:59)

        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu

ild(LifecycleStarter.java:183)

        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl

eStarter.java:161)

        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)

        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)

        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)

        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)

        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun

cher.java:290)

        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav

a:230)

        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La

uncher.java:409)

        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:

352)

Caused by: org.apache.maven.plugin.MojoExecutionException: Sonar server can not

be reached at http://localhost:9000. Please check the parameter 'sonar.host.url'

.

        at org.codehaus.mojo.sonar.ServerMetadata.logSettings(ServerMetadata.jav

a:79)

        at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:86)

        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default

BuildPluginManager.java:101)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:209)

        ... 19 more

 

-- Using Ant  –

 

I get the same “read timed out” error but this time on a “Bootstrapper.getServerVersion()” request.

Note that the same result is produced if I use the sonar-runner application.

 

sonar:

[sonar:sonar] Apache Ant(TM) version 1.8.4 compiled on May 22 2012

[sonar:sonar] Sonar Ant Task version: 1.4

[sonar:sonar] Loaded from: file:/C:/dev/code-quality/sonar-3.2/ant/sonar-ant-tas

k-1.4.jar

[sonar:sonar] Sonar work directory: C:\dev\workspaces\code-quality\poc\.sonar

[sonar:sonar] Sonar server: http://localhost:9000

 

BUILD FAILED

C:\dev\workspaces\code-quality\poc\build.xml:17: org.sonar.batch.bootstrapper.Bo

otstrapException: Read timed out

        at org.sonar.batch.bootstrapper.Bootstrapper.getServerVersion(Bootstrapp

er.java:71)

        at org.sonar.ant.SonarTask.checkSonarVersion(SonarTask.java:264)

        at org.sonar.ant.SonarTask.execute(SonarTask.java:192)

        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav

a:106)

        at org.apache.tools.ant.Task.perform(Task.java:348)

        at org.apache.tools.ant.Target.execute(Target.java:392)

        at org.apache.tools.ant.Target.performTasks(Target.java:413)

        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)

        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)

        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe

cutor.java:41)

        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)

        at org.apache.tools.ant.Main.runBuild(Main.java:811)

        at org.apache.tools.ant.Main.startAnt(Main.java:217)

        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)

        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Caused by: java.net.SocketTimeoutException: Read timed out

        at java.net.SocketInputStream.socketRead0(Native Method)

        at java.net.SocketInputStream.read(SocketInputStream.java:150)

        at java.net.SocketInputStream.read(SocketInputStream.java:121)

        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)

        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)

        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)

        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:633)

        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)

        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1322)

        at java.net.URLConnection.getContent(URLConnection.java:748)

        at org.sonar.batch.bootstrapper.Bootstrapper.remoteContent(Bootstrapper.

java:123)

        at org.sonar.batch.bootstrapper.Bootstrapper.getServerVersion(Bootstrapp

er.java:69)

        ... 19 more

 

-- Using the Eclipse plugin –

Trying to attach an Eclipse project to Sonar gives me an “unknown error” which, according to the documentation, is likely to be an authentication error, but the user/passwords are set to the default ones (“admin”) either in the Eclipse plugin and in Sonar, so it is probably not that.

 

 

 

 


This electronic mail (including any attachments) may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents (including any attachments) by persons other than the intended recipient(s) is strictly prohibited. If you have received this message in error, please notify us immediately by reply e-mail so that we may correct our internal records. Please then delete the original message (including any attachments) in its entirety. Thank you.

 

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Read timed out while trying to run an analysis

Balazuc, Denis

Hi List, Hi Freddy

 

I’ve found what the problem was. It turns out some ports are blocked on my machine for some corporate reason by a Symantec software.

I switched to using 8080 as the Sonar server port, and everything went fine and I could run my analysis without problem.

 

Case closed.

Thanks for your support and sorry for the annoyance.

 

Denis

 

 

From: Balazuc, Denis [mailto:[hidden email]]
Sent: Wednesday, September 12, 2012 3:49 PM
To: [hidden email]
Subject: RE: [sonar-user] Read timed out while trying to run an analysis

 

Also, I am pretty sure at least the Maven plugin doesn’t proxy its connection since the stacktrace shows “(no proxy)”

 

Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar failed:

Fail to download the file: http://localhost:9000/deploy/jdbc-driver.jar (no proxy)

 

Cheers

 

From: Balazuc, Denis [mailto:[hidden email]]
Sent: Wednesday, September 12, 2012 3:40 PM
To: [hidden email]
Subject: RE: [sonar-user] Read timed out while trying to run an analysis

 

Hi Freddy

 

Well, I have tried to poke around any config file I could change basically ;-)

·         The java plugin (just in case I was wrongly using a JRE instead of the JDK)

·         Maven settings

·         In Eclipse for the Eclipse plugin

·         Using “–DhttpProxy=” parameters on the java command line

·         I even tried disabling the proxy setting in Sonar 3.2 itself…

 

But again, wiping ALL the proxy configurations didn’t change the situation.

I will create a new pristine install of the same environment I use from a different network environment, and report back to you with my results.

 

However, this makes me think: is there any kind of authentication token that needs to be passed to Sonar from those “client”  tools to request files and such? My Sonar installation has a user (me) and the admin one but I see nowhere where I can specify my credentials before running analysis.

 

Thanks again for your help

Denis

 

From: Freddy Mallet [mailto:[hidden email]]
Sent: Wednesday, September 12, 2012 3:25 PM
To: [hidden email]
Subject: Re: [sonar-user] Read timed out while trying to run an analysis

 

Hi Denis,

 

Alas, with or without proxy settings, the problem remains the same. I had also thought there was a hidden reverse proxy on my network that would cause troubles, but that doesn’t seem to be the case either.

Given that the 3 different approaches (Ant, Maven & sonar-runner) produce the same kind of error, I am a little confused and wonder if using JDK 1.7 would be an issue. At this point, I am a bit out of possible options and I’m confused as to what could be the cause since a simple wget works just fine.

 

I'm pretty sure that you always encounter this issue because whatever is the reason the proxy configuration is always taken into account by the Sonar analysis. Where have you defined this configuration ?

 

Kind regards,

Freddy

 

I will also try my setup on a different network environment (devoid of proxies or other network oddities) when I have some time, and follow up on that.

 

Thanks again

Denis

 

From: Freddy Mallet [mailto:[hidden email]]
Sent: Wednesday, September 12, 2012 2:57 PM
To: [hidden email]
Subject: Re: [sonar-user] Read timed out while trying to run an analysis

 

Hi Denis,

 

If my understanding is correct the Sonar server is running on your local machine and you're launching the Sonar analysis on your local machine. So indeed if you've configured the Sonar analysis to use a proxy in order to access your local machine this can't work. On the other side perhaps Maven needs this proxy configuration to access to a public Maven repository ? 

 

In order to validate my feeling, could you give a try with the Sonar Runner without defining any proxy ?

 

Kind regards,

Freddy

 

-----

Sonar for Continuous Inspection

 

On Wed, Sep 12, 2012 at 7:26 PM, Balazuc, Denis <[hidden email]> wrote:

Hi list

 

I am trying to run a first analysis with Sonar 3.2 on an empty project (one main Java class only) for a proof of concept.

When I try to run the analysis, using Ant, Maven or sonar-runner, I get a “Read timed out” exception, no matter what I try.

(details further down).

 

I am behind a proxy, so I have set the proxy parameters in Sonar, as well as Ant and Maven, but this didn’t make any difference (without proxy settings, Sonar update page would not load, so I know those settings do work).

 

I have also tried to change the read timeout and connection timeout in Maven, but again, although the settings are taken into account by the Maven plugin (I can verify that a long timeout hangs for a long time), no cake for me.

 

I have been scourging the internet and tried to apply various recipes I’ve found (noticeably on this mailing list) but to no avail.

Any help or enlightenment would be very much appreciated.

 

Thanks a lot.

 

----- Details ----

 

I am running JDK 1.7 on a Windows 7-64 platform.

java version "1.7.0_07"

Java(TM) SE Runtime Environment (build 1.7.0_07-b10)

Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

 

The installation is the default Sonar 3.2 with the Derby database. I only added proxy settings to the properties and activated the “-server” JVM option on wrapper.conf.

Sonar 3.2, Ant 1.8, Maven3, and sonar-runner 1.4 are running from the same (local) machine.

 

-- Using Maven –

mvn clean install org.codehaus.sonar:sonar-maven-plugin:3.2:sonar -X –e

 

The Maven plugins tries to download “ http://localhost:9000/deploy/jdbc-driver.jar” but fails with  a “read timed out”.

I can fetch this file using any web browser or by using “wget” without problem.

 

[ERROR] Failed to execute goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar (

default-cli) on project poc: Execution default-cli of goal org.codehaus.sonar:so

nar-maven-plugin:3.2:sonar failed: Fail to download the file: http://localhost:9

000/deploy/jdbc-driver.jar (no proxy): Read timed out -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o

rg.codehaus.sonar:sonar-maven-plugin:3.2:sonar (default-cli) on project poc: Exe

cution default-cli of goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar faile

d: Fail to download the file: http://localhost:9000/deploy/jdbc-driver.jar (no p

roxy)

[SNIP non interesting part of the stacktrace]

Caused by: java.net.SocketTimeoutException: Read timed out

        at java.net.SocketInputStream.socketRead0(Native Method)

        at java.net.SocketInputStream.read(SocketInputStream.java:150)

        at java.net.SocketInputStream.read(SocketInputStream.java:121)

        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)

        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)

        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)

        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:633)

        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)

        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1322)

        at org.sonar.api.utils.HttpDownloader$HttpInputSupplier.getInput(HttpDow

nloader.java:200)

        at org.sonar.api.utils.HttpDownloader$HttpInputSupplier.getInput(HttpDow

nloader.java:184)

        at com.google.common.io.ByteStreams.copy(ByteStreams.java:116)

        at com.google.common.io.Files.copy(Files.java:231)

        at org.sonar.api.utils.HttpDownloader.download(HttpDownloader.java:173)

        ... 45 more

 

NOTE that using the “default” Sonar plugin with Maven (mvn sonar:sonar), I get a different error (Sonar server cannot be reached).

(of course the URL is the right one…)

 

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (d

efault-cli) on project poc: Sonar server can not be reached at http://localhost:

9000. Please check the parameter 'sonar.host.url'. -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o

rg.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project poc: Sona

r server can not be reached at http://localhost:9000. Please check the parameter

'sonar.host.url'.

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:217)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:153)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:145)

        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

ct(LifecycleModuleBuilder.java:84)

        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

ct(LifecycleModuleBuilder.java:59)

        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu

ild(LifecycleStarter.java:183)

        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl

eStarter.java:161)

        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)

        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)

        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)

        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)

        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun

cher.java:290)

        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav

a:230)

        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La

uncher.java:409)

        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:

352)

Caused by: org.apache.maven.plugin.MojoExecutionException: Sonar server can not

be reached at http://localhost:9000. Please check the parameter 'sonar.host.url'

.

        at org.codehaus.mojo.sonar.ServerMetadata.logSettings(ServerMetadata.jav

a:79)

        at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:86)

        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default

BuildPluginManager.java:101)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:209)

        ... 19 more

 

-- Using Ant  –

 

I get the same “read timed out” error but this time on a “Bootstrapper.getServerVersion()” request.

Note that the same result is produced if I use the sonar-runner application.

 

sonar:

[sonar:sonar] Apache Ant(TM) version 1.8.4 compiled on May 22 2012

[sonar:sonar] Sonar Ant Task version: 1.4

[sonar:sonar] Loaded from: file:/C:/dev/code-quality/sonar-3.2/ant/sonar-ant-tas

k-1.4.jar

[sonar:sonar] Sonar work directory: C:\dev\workspaces\code-quality\poc\.sonar

[sonar:sonar] Sonar server: http://localhost:9000

 

BUILD FAILED

C:\dev\workspaces\code-quality\poc\build.xml:17: org.sonar.batch.bootstrapper.Bo

otstrapException: Read timed out

        at org.sonar.batch.bootstrapper.Bootstrapper.getServerVersion(Bootstrapp

er.java:71)

        at org.sonar.ant.SonarTask.checkSonarVersion(SonarTask.java:264)

        at org.sonar.ant.SonarTask.execute(SonarTask.java:192)

        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav

a:106)

        at org.apache.tools.ant.Task.perform(Task.java:348)

        at org.apache.tools.ant.Target.execute(Target.java:392)

        at org.apache.tools.ant.Target.performTasks(Target.java:413)

        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)

        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)

        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe

cutor.java:41)

        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)

        at org.apache.tools.ant.Main.runBuild(Main.java:811)

        at org.apache.tools.ant.Main.startAnt(Main.java:217)

        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)

        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Caused by: java.net.SocketTimeoutException: Read timed out

        at java.net.SocketInputStream.socketRead0(Native Method)

        at java.net.SocketInputStream.read(SocketInputStream.java:150)

        at java.net.SocketInputStream.read(SocketInputStream.java:121)

        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)

        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)

        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)

        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:633)

        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)

        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1322)

        at java.net.URLConnection.getContent(URLConnection.java:748)

        at org.sonar.batch.bootstrapper.Bootstrapper.remoteContent(Bootstrapper.

java:123)

        at org.sonar.batch.bootstrapper.Bootstrapper.getServerVersion(Bootstrapp

er.java:69)

        ... 19 more

 

-- Using the Eclipse plugin –

Trying to attach an Eclipse project to Sonar gives me an “unknown error” which, according to the documentation, is likely to be an authentication error, but the user/passwords are set to the default ones (“admin”) either in the Eclipse plugin and in Sonar, so it is probably not that.

 

 

 

 


This electronic mail (including any attachments) may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents (including any attachments) by persons other than the intended recipient(s) is strictly prohibited. If you have received this message in error, please notify us immediately by reply e-mail so that we may correct our internal records. Please then delete the original message (including any attachments) in its entirety. Thank you.

 

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Read timed out while trying to run an analysis

Freddy Mallet
And thanks Denis for this notification.

-----
Sonar for Continuous Inspection



On Thu, Sep 13, 2012 at 3:21 PM, Balazuc, Denis <[hidden email]> wrote:

Hi List, Hi Freddy

 

I’ve found what the problem was. It turns out some ports are blocked on my machine for some corporate reason by a Symantec software.

I switched to using 8080 as the Sonar server port, and everything went fine and I could run my analysis without problem.

 

Case closed.

Thanks for your support and sorry for the annoyance.

 

Denis

 

 

From: Balazuc, Denis [mailto:[hidden email]]
Sent: Wednesday, September 12, 2012 3:49 PM


To: [hidden email]
Subject: RE: [sonar-user] Read timed out while trying to run an analysis

 

Also, I am pretty sure at least the Maven plugin doesn’t proxy its connection since the stacktrace shows “(no proxy)”

 

Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar failed:

Fail to download the file: http://localhost:9000/deploy/jdbc-driver.jar (no proxy)

 

Cheers

 

From: Balazuc, Denis [mailto:[hidden email]]
Sent: Wednesday, September 12, 2012 3:40 PM
To: [hidden email]
Subject: RE: [sonar-user] Read timed out while trying to run an analysis

 

Hi Freddy

 

Well, I have tried to poke around any config file I could change basically ;-)

·         The java plugin (just in case I was wrongly using a JRE instead of the JDK)

·         Maven settings

·         In Eclipse for the Eclipse plugin

·         Using “–DhttpProxy=” parameters on the java command line

·         I even tried disabling the proxy setting in Sonar 3.2 itself…

 

But again, wiping ALL the proxy configurations didn’t change the situation.

I will create a new pristine install of the same environment I use from a different network environment, and report back to you with my results.

 

However, this makes me think: is there any kind of authentication token that needs to be passed to Sonar from those “client”  tools to request files and such? My Sonar installation has a user (me) and the admin one but I see nowhere where I can specify my credentials before running analysis.

 

Thanks again for your help

Denis

 

From: Freddy Mallet [mailto:[hidden email]]
Sent: Wednesday, September 12, 2012 3:25 PM
To: [hidden email]
Subject: Re: [sonar-user] Read timed out while trying to run an analysis

 

Hi Denis,

 

Alas, with or without proxy settings, the problem remains the same. I had also thought there was a hidden reverse proxy on my network that would cause troubles, but that doesn’t seem to be the case either.

Given that the 3 different approaches (Ant, Maven & sonar-runner) produce the same kind of error, I am a little confused and wonder if using JDK 1.7 would be an issue. At this point, I am a bit out of possible options and I’m confused as to what could be the cause since a simple wget works just fine.

 

I'm pretty sure that you always encounter this issue because whatever is the reason the proxy configuration is always taken into account by the Sonar analysis. Where have you defined this configuration ?

 

Kind regards,

Freddy

 

I will also try my setup on a different network environment (devoid of proxies or other network oddities) when I have some time, and follow up on that.

 

Thanks again

Denis

 

From: Freddy Mallet [mailto:[hidden email]]
Sent: Wednesday, September 12, 2012 2:57 PM
To: [hidden email]
Subject: Re: [sonar-user] Read timed out while trying to run an analysis

 

Hi Denis,

 

If my understanding is correct the Sonar server is running on your local machine and you're launching the Sonar analysis on your local machine. So indeed if you've configured the Sonar analysis to use a proxy in order to access your local machine this can't work. On the other side perhaps Maven needs this proxy configuration to access to a public Maven repository ? 

 

In order to validate my feeling, could you give a try with the Sonar Runner without defining any proxy ?

 

Kind regards,

Freddy

 

-----

Sonar for Continuous Inspection

 

On Wed, Sep 12, 2012 at 7:26 PM, Balazuc, Denis <[hidden email]> wrote:

Hi list

 

I am trying to run a first analysis with Sonar 3.2 on an empty project (one main Java class only) for a proof of concept.

When I try to run the analysis, using Ant, Maven or sonar-runner, I get a “Read timed out” exception, no matter what I try.

(details further down).

 

I am behind a proxy, so I have set the proxy parameters in Sonar, as well as Ant and Maven, but this didn’t make any difference (without proxy settings, Sonar update page would not load, so I know those settings do work).

 

I have also tried to change the read timeout and connection timeout in Maven, but again, although the settings are taken into account by the Maven plugin (I can verify that a long timeout hangs for a long time), no cake for me.

 

I have been scourging the internet and tried to apply various recipes I’ve found (noticeably on this mailing list) but to no avail.

Any help or enlightenment would be very much appreciated.

 

Thanks a lot.

 

----- Details ----

 

I am running JDK 1.7 on a Windows 7-64 platform.

java version "1.7.0_07"

Java(TM) SE Runtime Environment (build 1.7.0_07-b10)

Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode)

 

The installation is the default Sonar 3.2 with the Derby database. I only added proxy settings to the properties and activated the “-server” JVM option on wrapper.conf.

Sonar 3.2, Ant 1.8, Maven3, and sonar-runner 1.4 are running from the same (local) machine.

 

-- Using Maven –

mvn clean install org.codehaus.sonar:sonar-maven-plugin:3.2:sonar -X –e

 

The Maven plugins tries to download “ http://localhost:9000/deploy/jdbc-driver.jar” but fails with  a “read timed out”.

I can fetch this file using any web browser or by using “wget” without problem.

 

[ERROR] Failed to execute goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar (

default-cli) on project poc: Execution default-cli of goal org.codehaus.sonar:so

nar-maven-plugin:3.2:sonar failed: Fail to download the file: http://localhost:9

000/deploy/jdbc-driver.jar (no proxy): Read timed out -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o

rg.codehaus.sonar:sonar-maven-plugin:3.2:sonar (default-cli) on project poc: Exe

cution default-cli of goal org.codehaus.sonar:sonar-maven-plugin:3.2:sonar faile

d: Fail to download the file: http://localhost:9000/deploy/jdbc-driver.jar (no p

roxy)

[SNIP non interesting part of the stacktrace]

Caused by: java.net.SocketTimeoutException: Read timed out

        at java.net.SocketInputStream.socketRead0(Native Method)

        at java.net.SocketInputStream.read(SocketInputStream.java:150)

        at java.net.SocketInputStream.read(SocketInputStream.java:121)

        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)

        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)

        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)

        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:633)

        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)

        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1322)

        at org.sonar.api.utils.HttpDownloader$HttpInputSupplier.getInput(HttpDow

nloader.java:200)

        at org.sonar.api.utils.HttpDownloader$HttpInputSupplier.getInput(HttpDow

nloader.java:184)

        at com.google.common.io.ByteStreams.copy(ByteStreams.java:116)

        at com.google.common.io.Files.copy(Files.java:231)

        at org.sonar.api.utils.HttpDownloader.download(HttpDownloader.java:173)

        ... 45 more

 

NOTE that using the “default” Sonar plugin with Maven (mvn sonar:sonar), I get a different error (Sonar server cannot be reached).

(of course the URL is the right one…)

 

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (d

efault-cli) on project poc: Sonar server can not be reached at http://localhost:

9000. Please check the parameter 'sonar.host.url'. -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o

rg.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project poc: Sona

r server can not be reached at http://localhost:9000. Please check the parameter

'sonar.host.url'.

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:217)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:153)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:145)

        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

ct(LifecycleModuleBuilder.java:84)

        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje

ct(LifecycleModuleBuilder.java:59)

        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu

ild(LifecycleStarter.java:183)

        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl

eStarter.java:161)

        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)

        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)

        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)

        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)

        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun

cher.java:290)

        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav

a:230)

        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La

uncher.java:409)

        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:

352)

Caused by: org.apache.maven.plugin.MojoExecutionException: Sonar server can not

be reached at http://localhost:9000. Please check the parameter 'sonar.host.url'

.

        at org.codehaus.mojo.sonar.ServerMetadata.logSettings(ServerMetadata.jav

a:79)

        at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:86)

        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(Default

BuildPluginManager.java:101)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor

.java:209)

        ... 19 more

 

-- Using Ant  –

 

I get the same “read timed out” error but this time on a “Bootstrapper.getServerVersion()” request.

Note that the same result is produced if I use the sonar-runner application.

 

sonar:

[sonar:sonar] Apache Ant(TM) version 1.8.4 compiled on May 22 2012

[sonar:sonar] Sonar Ant Task version: 1.4

[sonar:sonar] Loaded from: file:/C:/dev/code-quality/sonar-3.2/ant/sonar-ant-tas

k-1.4.jar

[sonar:sonar] Sonar work directory: C:\dev\workspaces\code-quality\poc\.sonar

[sonar:sonar] Sonar server: http://localhost:9000

 

BUILD FAILED

C:\dev\workspaces\code-quality\poc\build.xml:17: org.sonar.batch.bootstrapper.Bo

otstrapException: Read timed out

        at org.sonar.batch.bootstrapper.Bootstrapper.getServerVersion(Bootstrapp

er.java:71)

        at org.sonar.ant.SonarTask.checkSonarVersion(SonarTask.java:264)

        at org.sonar.ant.SonarTask.execute(SonarTask.java:192)

        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.

java:57)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces

sorImpl.java:43)

        at java.lang.reflect.Method.invoke(Method.java:601)

        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav

a:106)

        at org.apache.tools.ant.Task.perform(Task.java:348)

        at org.apache.tools.ant.Target.execute(Target.java:392)

        at org.apache.tools.ant.Target.performTasks(Target.java:413)

        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)

        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)

        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe

cutor.java:41)

        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)

        at org.apache.tools.ant.Main.runBuild(Main.java:811)

        at org.apache.tools.ant.Main.startAnt(Main.java:217)

        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)

        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

Caused by: java.net.SocketTimeoutException: Read timed out

        at java.net.SocketInputStream.socketRead0(Native Method)

        at java.net.SocketInputStream.read(SocketInputStream.java:150)

        at java.net.SocketInputStream.read(SocketInputStream.java:121)

        at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)

        at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)

        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)

        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:633)

        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)

        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon

nection.java:1322)

        at java.net.URLConnection.getContent(URLConnection.java:748)

        at org.sonar.batch.bootstrapper.Bootstrapper.remoteContent(Bootstrapper.

java:123)

        at org.sonar.batch.bootstrapper.Bootstrapper.getServerVersion(Bootstrapp

er.java:69)

        ... 19 more

 

-- Using the Eclipse plugin –

Trying to attach an Eclipse project to Sonar gives me an “unknown error” which, according to the documentation, is likely to be an authentication error, but the user/passwords are set to the default ones (“admin”) either in the Eclipse plugin and in Sonar, so it is probably not that.

 

 

 

 


This electronic mail (including any attachments) may contain information that is privileged, confidential, and/or otherwise protected from disclosure to anyone other than its intended recipient(s). Any dissemination or use of this electronic mail or its contents (including any attachments) by persons other than the intended recipient(s) is strictly prohibited. If you have received this message in error, please notify us immediately by reply e-mail so that we may correct our internal records. Please then delete the original message (including any attachments) in its entirety. Thank you.

 

 


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Read timed out while trying to run an analysis

srisaravananwt
In reply to this post by Balazuc, Denis
Hi,

Getting the below exception when executing the analysis using sonar-runner. Please guide to resolve this. We are using Sonar 3.4.1. When I stop and execute again downloading a jar and throwing ReadTimeout exception, again I start executing sonar-runner it is downloading the next jar and again exception,

Exception in thread "main" java.lang.IllegalStateException: Fail to download libraries from server
      at org.sonar.runner.Bootstrapper.downloadBatchFiles(Bootstrapper.java:173)
      at org.sonar.runner.Bootstrapper.createClassLoader(Bootstrapper.java:93)
      at org.sonar.runner.Runner.createClassLoader(Runner.java:229)
      at org.sonar.runner.Runner.execute(Runner.java:151)
      at org.sonar.runner.Main.execute(Main.java:84)
      at org.sonar.runner.Main.main(Main.java:56)
Caused by: java.lang.IllegalStateException: Fail to download the file: http://10.238.237.44:8080/sonar/batch/gson-2.2.2.jar
      at org.sonar.runner.Bootstrapper.remoteContentToFile(Bootstrapper.java:119)
      at org.sonar.runner.Bootstrapper.downloadBatchFiles(Bootstrapper.java:167)
      ... 5 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.io.BufferedInputStream.fill(Unknown Source)
      at java.io.BufferedInputStream.read1(Unknown Source)
      at java.io.BufferedInputStream.read(Unknown Source)
      at sun.net.www.http.ChunkedInputStream.fastRead(Unknown Source)
      at sun.net.www.http.ChunkedInputStream.read(Unknown Source)
      at java.io.FilterInputStream.read(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
      at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(Unknown Source)
      at org.sonar.runner.IOUtils.copyLarge(IOUtils.java:67)
      at org.sonar.runner.Bootstrapper.remoteContentToFile(Bootstrapper.java:115)
      ... 6 more
Loading...