Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-32198

avax.servlet.ServletException: org.scribe.exceptions.OAuthConnectionException: There was a problem while creating a connection to the remote service.

    XMLWordPrintable

Details

    Description

      we are getting below error while login to jenkins.
      jenkins is authenticated using bitbucket oAuth Plugin .
      suddenly we are started getting below error when we hit jenkins URL
      we can telnet to 80 and 443 to bitbucket .
      Please help to resolve below issue

      javax.servlet.ServletException: org.scribe.exceptions.OAuthConnectionException: There was a problem while creating a connection to the remote service.
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:796)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      at org.kohsuke.stapler.MetaClass$4.doDispatch(MetaClass.java:211)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
      at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
      at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
      at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
      at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:123)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
      at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:49)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:135)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
      at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
      at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
      at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:81)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
      at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1474)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:499)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
      at org.eclipse.jetty.server.Server.handle(Server.java:370)
      at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
      at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:949)
      at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1011)
      at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
      at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
      at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
      at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
      at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
      at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: 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.api.BitbucketApiService.getUserByToken(BitbucketApiService.java:58)
      at org.jenkinsci.plugins.BitbucketAuthenticationToken.<init>(BitbucketAuthenticationToken.java:21)
      at org.jenkinsci.plugins.BitbucketSecurityRealm.doFinishLogin(BitbucketSecurityRealm.java:123)
      at sun.reflect.GeneratedMethodAccessor123.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
      at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
      at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
      at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:121)
      at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
      at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      ... 63 more
      Caused by: java.net.ConnectException: Connection refused
      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:933)
      at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:177)
      at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:153)
      at org.scribe.model.Response.<init>(Response.java:28)
      at org.scribe.model.Request.doSend(Request.java:115)
      at org.scribe.model.Request.send(Request.java:65).

      Attachments

        Activity

          I'm moving this ticket to another component.

          AFAIS, you are getting some "Caused by: java.net.ConnectException: Connection refused", it seems some networking issue.

          Environment=PROD doesn't provide enough information, you will need to provide details from your production environment, such as: OS, Java version, Jenkins version, plugin version....

          Cheers

          v2v Victor Martinez added a comment - I'm moving this ticket to another component. AFAIS, you are getting some "Caused by: java.net.ConnectException: Connection refused" , it seems some networking issue. Environment=PROD doesn't provide enough information, you will need to provide details from your production environment, such as: OS, Java version, Jenkins version, plugin version.... Cheers

          OS:- Red Hat Enterprise Linux Server release 6.7 (Santiago)
          JAVA:-
          java version "1.7.0_85"
          OpenJDK Runtime Environment (rhel-2.6.1.3.el6_7-x86_64 u85-b01)
          OpenJDK 64-Bit Server VM (build 24.85-b03, mixed mode)

          Jenkins:- 1.630
          Auth Plugin :- Bitbucket OAuth Plugin 0.4.

          I am unable to login my prod environment and this is information from our test jenkins environment and both are similar.

          I checked connectivity from our jenkins server to bitbucket its working
          i used telnet bitbucket 443 and its working

          Please help me to resolve the issue

          aloknagaonkar Alok Nagaonkar added a comment - OS:- Red Hat Enterprise Linux Server release 6.7 (Santiago) JAVA:- java version "1.7.0_85" OpenJDK Runtime Environment (rhel-2.6.1.3.el6_7-x86_64 u85-b01) OpenJDK 64-Bit Server VM (build 24.85-b03, mixed mode) Jenkins:- 1.630 Auth Plugin :- Bitbucket OAuth Plugin 0.4. I am unable to login my prod environment and this is information from our test jenkins environment and both are similar. I checked connectivity from our jenkins server to bitbucket its working i used telnet bitbucket 443 and its working Please help me to resolve the issue

          You can add some loggers
          https://wiki.jenkins-ci.org/display/JENKINS/Logging

          Look at the bitbucket oauth source code https://github.com/jenkinsci/bitbucket-oauth-plugin/blob/master/src/main/java/org/jenkinsci/plugins/BitbucketSecurityRealm.java

          In order to grab those logger details and get some verbose output.

          Cheers

          v2v Victor Martinez added a comment - You can add some loggers https://wiki.jenkins-ci.org/display/JENKINS/Logging Look at the bitbucket oauth source code https://github.com/jenkinsci/bitbucket-oauth-plugin/blob/master/src/main/java/org/jenkinsci/plugins/BitbucketSecurityRealm.java In order to grab those logger details and get some verbose output. Cheers

          we have resolved the issue it was related to network

          aloknagaonkar Alok Nagaonkar added a comment - we have resolved the issue it was related to network

          People

            Unassigned Unassigned
            aloknagaonkar Alok Nagaonkar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: