• Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Jenkins v.1.625.3
      Runs directly
      Is in a private network, access with a proxy.

      I've got this error:

      Bitbucket notify on start failed: There was a problem while creating a connection to the remote service.
      org.scribe.exceptions.OAuthConnectionException: There was a problem while creating a connection to the remote service.
      	at org.scribe.model.Request.send(Request.java:69)
      	at org.scribe.model.Request.send(Request.java:75)
      	at org.jenkinsci.plugins.bitbucket.api.BitbucketApiService.getAccessToken(BitbucketApiService.java:27)
      	at org.jenkinsci.plugins.bitbucket.BitbucketBuildStatusNotifier.notifyBuildStatus(BitbucketBuildStatusNotifier.java:216)
      	at org.jenkinsci.plugins.bitbucket.BitbucketBuildStatusNotifier.prebuild(BitbucketBuildStatusNotifier.java:79)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.preBuild(AbstractBuild.java:840)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.preBuild(AbstractBuild.java:835)
      	at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.doRun(MavenModuleSetBuild.java:664)
      	at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:537)
      	at hudson.model.Run.execute(Run.java:1741)
      	at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:531)
      	at hudson.model.ResourceController.execute(ResourceController.java:98)
      	at hudson.model.Executor.run(Executor.java:408)
      Caused by: java.net.ConnectException: Connection timed out
      	at java.net.PlainSocketImpl.socketConnect(Native Method)
      	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
      	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
      	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
      	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
      	at java.net.Socket.connect(Socket.java:579)
      	at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:637)
      	at sun.security.ssl.BaseSSLSocketImpl.connect(BaseSSLSocketImpl.java:160)
      	at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
      	at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
      	at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
      	at sun.net.www.protocol.https.HttpsClient.<init>(HttpsClient.java:264)
      	at sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:367)
      	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:191)
      	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:934)
      	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
      	at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1093)
      	at sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:250)
      	at org.scribe.model.Request.addBody(Request.java:134)
      	at org.scribe.model.Request.doSend(Request.java:112)
      	at org.scribe.model.Request.send(Request.java:65)
      	... 12 more
      

      I've tried a lot of settings without success:

      • Set the environment variable JAVA_TOOL_OPTIONS: -Dhttp.proxyHost=<proxyserver> -Dhttp.proxyPort=8080 -Dhttps.proxyHost=<proxyserver> -Dhttps.proxyPort=8080 in Jenkins configuration with value
      • Set the proxy in the advance tab of plugins configuration.
      • Add to the variable JENKINS_JAVA_OPTIONS: -Dhttp.proxyHost=<proxyserver> -Dhttp.proxyPort=8080 -Dhttps.proxyHost=<proxyserver> -Dhttps.proxyPort=8080 in JENKINS in the file: /etc/sysconfig/jenkins

      Nothing is working... Every other plugins and job are working. Only this plugin report an error.

          [JENKINS-32601] Connection timeout behind a proxy

          Hi sdeschenes, first thank you for reporting the problem, I got it, I'll try to identify the problem asap.

          Antonio Mansilla added a comment - Hi sdeschenes , first thank you for reporting the problem, I got it, I'll try to identify the problem asap.

          I'll close this issue since I'm not be able to reproduce the problem.

          Antonio Mansilla added a comment - I'll close this issue since I'm not be able to reproduce the problem.

          Marcelo Rocha added a comment -

          I am also facing the same issue when working behind a proxy.

          Also, another question: Does this plugin receives something from Bitbucket? I mean, when I have the Bitbucket notify plugin on my Jenkins, how exactly does it work? Jenkins sends the information to Bitbucket? Or also receives something from Bitbucket? If Bitbucket sends something to Jenkins, that could also be my issue, since my jenkins installation doesn't have a public IP and can't be reached from the internet, but I can go to the internet using my proxy and all other plugins work just fine, as well as jenkins updates, etc.

          Marcelo Rocha added a comment - I am also facing the same issue when working behind a proxy. Also, another question: Does this plugin receives something from Bitbucket? I mean, when I have the Bitbucket notify plugin on my Jenkins, how exactly does it work? Jenkins sends the information to Bitbucket? Or also receives something from Bitbucket? If Bitbucket sends something to Jenkins, that could also be my issue, since my jenkins installation doesn't have a public IP and can't be reached from the internet, but I can go to the internet using my proxy and all other plugins work just fine, as well as jenkins updates, etc.

          Stefan Cordes added a comment -

          This plugin uses

          sun.net.spi.DefaultProxySelector.select(java.net.URI) line: 208 sun.net.spi.DefaultProxySelector.select(java.net.URI) line: 208

          via

          sun.net.www.protocol.https.DelegateHttpsURLConnection(sun.net.www.protocol.http.HttpURLConnection).plainConnect0() line: 1156 [local variables unavailable] 

           

          In sun.net.NetProperties.get(String) the net.properties is read where no proxy is defined.  -Dhttps.proxyHost=<proxyserver> should use the proxy server.
          (to be safe you should set it to the jenkins.xml <arguments> instead of system variables.)

           

          Maybe you did specify a http.nonProxyHosts pattern via -Dhttp.nonProxyHosts=.* which overrules the https.proxyHost - see sun.net.spi.DefaultProxySelector.shouldNotUseProxyFor(Pattern, String) ?

          Stefan Cordes added a comment - This plugin uses sun.net.spi.DefaultProxySelector.select(java.net.URI) line: 208 sun.net.spi.DefaultProxySelector.select(java.net.URI) line: 208 via sun.net.www.protocol.https.DelegateHttpsURLConnection(sun.net.www.protocol.http.HttpURLConnection).plainConnect0() line: 1156 [local variables unavailable]     In sun.net.NetProperties.get(String) the net.properties is read where no proxy is defined.   -Dhttps.proxyHost=<proxyserver> should use the proxy server. (to be safe you should set it to the jenkins.xml <arguments> instead of system variables.)   Maybe you did specify a http.nonProxyHosts pattern via -Dhttp.nonProxyHosts=.* which overrules the https.proxyHost - see sun.net.spi.DefaultProxySelector.shouldNotUseProxyFor(Pattern, String) ?

          Stefan Cordes added a comment -

          Probably plugin should better use the pre-configured jenkins proxy ( https://YOUR_JENKINS/pluginManager/advanced ) for example via 

          hudson.ProxyConfiguration.open(java.net.URL) 

          or any other recommended way.

          Stefan Cordes added a comment - Probably plugin should better use the pre-configured jenkins proxy ( https://YOUR_JENKINS/pluginManager/advanced  ) for example via  hudson.ProxyConfiguration.open(java.net.URL)  or any other recommended way.

            flagbit Antonio Mansilla
            sdeschenes Sylvain Deschenes
            Votes:
            5 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: