java.net.ConnectException: Connection timed out

Jenkins JIRA | Damien Nozay | 5 years ago
  1. 0

    Hi, I am trying to script installation of plugins on a jenkins instance, in the best case scenario, my script works as expected; but if there are any failures, then from the CLI we get no information, we don't even the install-plugin command failed. This makes it very hard to automate reliably. /tmp # java -jar jenkins-cli.jar -s http://localhost:8080/jenkins install-plugin violations Installing violations from update center tmp # echo $? 0 if I go to the update center through the GUI, then: 1) I can see it failed 2) I get a hint that my proxy settings are wrong 3) I get some stack trace java.net.ConnectException: Connection timed out at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1491) at java.security.AccessController.doPrivileged(Native Method) at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1485) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1139) at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:566) at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:849) at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:957) at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:832) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.net.ConnectException: Connection timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:529) at java.net.Socket.connect(Socket.java:478) at sun.net.NetworkClient.doConnect(NetworkClient.java:163) at sun.net.www.http.HttpClient.openServer(HttpClient.java:394) at sun.net.www.http.HttpClient.openServer(HttpClient.java:529) at sun.net.www.http.HttpClient.<init>(HttpClient.java:233) at sun.net.www.http.HttpClient.New(HttpClient.java:306) at sun.net.www.http.HttpClient.New(HttpClient.java:323) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:970) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:836) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172) at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2304) at java.net.URLConnection.getHeaderFieldInt(URLConnection.java:579) at java.net.URLConnection.getContentLength(URLConnection.java:474) at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:565) ... 9 more chat log: [02:56:14] <damien___> hi [02:56:49] <damien___> I have a problem with the cli, I've looked through the open bugs and I'm not sure the issue is already mentioned [02:57:04] <damien___> I do 'java -jar ... install-plugin foobar' [02:57:29] <damien___> then it says "Installing foobar from update center" [02:57:42] <damien___> but that actually fails because of proxy issues [02:57:48] <damien___> cli doesn't complain [02:57:56] <damien___> and cli returns 0 as return code [02:58:04] <jenkinsci_builds> Starting build 897 for job jenkins_main_trunk (previous build: SUCCESS) [03:00:37] *** sshaw has joined #jenkins [03:03:15] *** geronimo_ has quit IRC [03:03:48] <kohsuke> damien___: good point. I think it's because CLI doesn't actually wait for the completion of the installation [03:03:52] <kohsuke> It just submits the job and then returns [03:04:05] <damien___> okay [03:04:20] <damien___> so these cannot be automated safely as of now [03:05:00] <damien___> thanks, I will submit a bug report tomorrow morning [03:05:10] <kohsuke> thank you [03:05:18] <damien___> I think I have a scenario to repro [03:05:39] <damien___> (in my case fails when no proxy set, so it should fail all the time if a bad proxy is set) [03:06:06] <damien___> thanks [03:06:13] *** damien___ has quit IRC to reproduce: 1) set your proxy settings to something you expect *not* to work. 2) cli command install-plugin violations (or any existing plugin)

    Jenkins JIRA | 5 years ago | Damien Nozay
    java.net.ConnectException: Connection timed out
  2. 0

    Hi, I am trying to script installation of plugins on a jenkins instance, in the best case scenario, my script works as expected; but if there are any failures, then from the CLI we get no information, we don't even the install-plugin command failed. This makes it very hard to automate reliably. /tmp # java -jar jenkins-cli.jar -s http://localhost:8080/jenkins install-plugin violations Installing violations from update center tmp # echo $? 0 if I go to the update center through the GUI, then: 1) I can see it failed 2) I get a hint that my proxy settings are wrong 3) I get some stack trace java.net.ConnectException: Connection timed out at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1491) at java.security.AccessController.doPrivileged(Native Method) at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1485) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1139) at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:566) at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:849) at hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:957) at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:832) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.net.ConnectException: Connection timed out at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366) at java.net.Socket.connect(Socket.java:529) at java.net.Socket.connect(Socket.java:478) at sun.net.NetworkClient.doConnect(NetworkClient.java:163) at sun.net.www.http.HttpClient.openServer(HttpClient.java:394) at sun.net.www.http.HttpClient.openServer(HttpClient.java:529) at sun.net.www.http.HttpClient.<init>(HttpClient.java:233) at sun.net.www.http.HttpClient.New(HttpClient.java:306) at sun.net.www.http.HttpClient.New(HttpClient.java:323) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:970) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:836) at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172) at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2304) at java.net.URLConnection.getHeaderFieldInt(URLConnection.java:579) at java.net.URLConnection.getContentLength(URLConnection.java:474) at hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:565) ... 9 more chat log: [02:56:14] <damien___> hi [02:56:49] <damien___> I have a problem with the cli, I've looked through the open bugs and I'm not sure the issue is already mentioned [02:57:04] <damien___> I do 'java -jar ... install-plugin foobar' [02:57:29] <damien___> then it says "Installing foobar from update center" [02:57:42] <damien___> but that actually fails because of proxy issues [02:57:48] <damien___> cli doesn't complain [02:57:56] <damien___> and cli returns 0 as return code [02:58:04] <jenkinsci_builds> Starting build 897 for job jenkins_main_trunk (previous build: SUCCESS) [03:00:37] *** sshaw has joined #jenkins [03:03:15] *** geronimo_ has quit IRC [03:03:48] <kohsuke> damien___: good point. I think it's because CLI doesn't actually wait for the completion of the installation [03:03:52] <kohsuke> It just submits the job and then returns [03:04:05] <damien___> okay [03:04:20] <damien___> so these cannot be automated safely as of now [03:05:00] <damien___> thanks, I will submit a bug report tomorrow morning [03:05:10] <kohsuke> thank you [03:05:18] <damien___> I think I have a scenario to repro [03:05:39] <damien___> (in my case fails when no proxy set, so it should fail all the time if a bad proxy is set) [03:06:06] <damien___> thanks [03:06:13] *** damien___ has quit IRC to reproduce: 1) set your proxy settings to something you expect *not* to work. 2) cli command install-plugin violations (or any existing plugin)

    Jenkins JIRA | 5 years ago | Damien Nozay
    java.net.ConnectException: Connection timed out
  3. 0

    org.tmatesoft.svn.core.SVNCancelException: svn: E200015: authentication cancelled

    Eclipse Bugzilla | 4 years ago | lathax.ms
    java.net.ConnectException: Connection timed out
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    [#JENKINS-11598] Updating Plugins from plugins mirror and own update-center.json does not work - Jenkins JIRA

    jenkins-ci.org | 2 years ago
    java.net.ConnectException: Connection refused: connect
  6. 0

    Connection refused - Can not update plugins from own plugin mirror since 1.430

    Google Groups | 5 years ago | cforce
    java.net.ConnectException: Connection refused: connect

    2 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.net.ConnectException

      Connection timed out

      at java.net.PlainSocketImpl.socketConnect()
    2. Java RT
      URLConnection.getContentLength
      1. java.net.PlainSocketImpl.socketConnect(Native Method)
      2. java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
      3. java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
      4. java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
      5. java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
      6. java.net.Socket.connect(Socket.java:529)
      7. java.net.Socket.connect(Socket.java:478)
      8. sun.net.NetworkClient.doConnect(NetworkClient.java:163)
      9. sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
      10. sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
      11. sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
      12. sun.net.www.http.HttpClient.New(HttpClient.java:306)
      13. sun.net.www.http.HttpClient.New(HttpClient.java:323)
      14. sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:970)
      15. sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:911)
      16. sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:836)
      17. sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1172)
      18. sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2304)
      19. java.net.URLConnection.getHeaderFieldInt(URLConnection.java:579)
      20. java.net.URLConnection.getContentLength(URLConnection.java:474)
      20 frames
    3. Hudson
      UpdateCenter$DownloadJob.run
      1. hudson.model.UpdateCenter$UpdateCenterConfiguration.download(UpdateCenter.java:565)
      2. hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:849)
      3. hudson.model.UpdateCenter$InstallationJob._run(UpdateCenter.java:957)
      4. hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:832)
      4 frames
    4. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      2. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      3. java.util.concurrent.FutureTask.run(FutureTask.java:138)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      5. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      6. java.lang.Thread.run(Thread.java:662)
      6 frames