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

Changing GHE Server after nearly completing Pipeline setup causes lengthy UI delay

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • Blue Ocean - Candidates

      Summary:
      While moving through the New Pipeline flow, it is possible for the user to scroll back up, and attempt to change the location of their GitHub Enterprise server. Doing so causes a lengthy delay in the UI. Eventually the user will be told, "An unknown error has occurred. You may try again."

      This appears to only affect GitHub Enterprise. A similar path using Bitbucket Server does not show the same problem, at least not yet. I'll update this ticket if I find that I can recreate it using BBS.

      Prerequisites:
      An already-configured GitHub Enterprise server, which you know will work and can be used to create Pipeline projects via the Create flow.

      Steps to recreate:
      1. Click the "New Pipeline" button in Blue Ocean.

      2. Pick GitHub Enterprise, and select your GHE server:

      3. Choose an Organization, then choose "New Pipeline," and select a Repository:

      4. Scroll back up to "Where is your GitHub Server," and click "Add." To trigger this hang, is to use http://your.githubserver.com as opposed to https://your.githubserver.com. The GHE I'm using supports automatic redirection to HTTPS - in other words, when I'm lazy, and type http://github.beescloud.com into my browser's address bar, I get automatically redirected to https. But here, it produces a timeout:

      5. If you happen to have the developer console open, you'll see an eventual 400 Bad Request error:

      6. Tailing the Jenkins log on the server also reveals a ConnectException from

      Aug 25, 2017 2:31:05 PM io.jenkins.blueocean.blueocean_github_pipeline.GithubServerContainer create
      INFO: Could not connect to Github
      java.net.ConnectException: Connection timed out
      	at java.net.PlainSocketImpl.socketConnect(Native Method)
      	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
      	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
      	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
      	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
      	at java.net.Socket.connect(Socket.java:589)
      	at java.net.Socket.connect(Socket.java:538)
      	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.http.HttpClient.<init>(HttpClient.java:211)
      	at sun.net.www.http.HttpClient.New(HttpClient.java:308)
      	at sun.net.www.http.HttpClient.New(HttpClient.java:326)
      	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1168)
      	at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1104)
      	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:998)
      	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:932)
      	at io.jenkins.blueocean.blueocean_github_pipeline.GithubServerContainer.create(GithubServerContainer.java:89)
      	at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:625)
      	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)
      	at org.kohsuke.stapler.ForwardingFunction.invoke(ForwardingFunction.java:63)
      	at io.jenkins.blueocean.commons.stapler.TreeResponse$Processor.invoke(TreeResponse.java:43)
      	at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184)
      	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:117)
      	at org.kohsuke.stapler.IndexDispatcher.dispatch(IndexDispatcher.java:26)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
      	at org.kohsuke.stapler.MetaClass$3.doDispatch(MetaClass.java:209)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
      	at org.kohsuke.stapler.MetaClass$10.dispatch(MetaClass.java:374)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
      	at org.kohsuke.stapler.MetaClass$10.dispatch(MetaClass.java:374)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
      	at org.kohsuke.stapler.MetaClass$10.dispatch(MetaClass.java:374)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
      	at org.kohsuke.stapler.MetaClass$10.dispatch(MetaClass.java:374)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
      	at org.kohsuke.stapler.MetaClass$10.dispatch(MetaClass.java:374)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:686)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
      	at org.kohsuke.stapler.MetaClass$10.dispatch(MetaClass.java:374)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:715)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:845)
      	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:790)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:841)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135)
      	at org.jenkinsci.plugins.ssegateway.Endpoint$SSEListenChannelFilter.doFilter(Endpoint.java:225)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
      	at io.jenkins.blueocean.ResourceCacheControl.doFilter(ResourceCacheControl.java:134)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
      	at io.jenkins.blueocean.auth.jwt.impl.JwtAuthenticationFilter.doFilter(JwtAuthenticationFilter.java:51)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
      	at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:59)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
      	at jenkins.metrics.impl.MetricsFilter.doFilter(MetricsFilter.java:125)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
      	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:138)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
      	at io.jenkins.blueocean.rest.APICrumbExclusion.process(APICrumbExclusion.java:30)
      	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:58)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
      	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:142)
      	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:92)
      	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:90)
      	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
      	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
      	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
      	at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1637)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
      	at org.eclipse.jetty.server.Server.handle(Server.java:564)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
      	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
      	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
      	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
      	at org.eclipse.jetty.util.thread.Invocable.invokePreferred(Invocable.java:128)
      	at org.eclipse.jetty.util.thread.Invocable$InvocableExecutor.invoke(Invocable.java:222)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:294)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:199)
      	at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      

      7. Eventually, you'll see the UI come back to life, and tell you that an unknown error has occurred:

      Jenkins needs to know where your GitHub Enterprise server is located.
      An unknown error has occurred. You may try again.
      Message: Failed to create Github server

      Field: apiUrl
      Code: INVALID
      Message: java.net.ConnectException: Connection timed out

      I've attached a HAR file from the above steps. I hope its data is useful.

          [JENKINS-46462] Changing GHE Server after nearly completing Pipeline setup causes lengthy UI delay

          Karl Shultz created issue -
          Karl Shultz made changes -
          Comment [ This might not be an entirely Blue Ocean related issue. I tried a similar thing in Manage Jenkins, by adding that same GHE server, using http instead of https. Jenkins threw a different exception, similar enough though, and it still didn't work to add the server:

          {code:none}
          Aug 25, 2017 2:48:05 PM org.kohsuke.github.Requester parse
          INFO: timed out accessing http://github.beescloud.com/api/v/; will try 2 more time(s)
          java.net.SocketTimeoutException: connect timed out
          at java.net.PlainSocketImpl.socketConnect(Native Method)
          at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
          at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
          at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
          at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
          (snip)
          {code}

          One last thought. If the UI delay is specific to the http/https thing when trying to connect to GHE, I'm happy to lower the severity of this. When I first found the issue, I thought it was any attempt to change to a different GHE server, which felt like a pretty big problem. But deliberately using http instead of https to connect to GHE feels like a lot more corner-case-y. ]
          Karl Shultz made changes -
          Attachment New: screenshot-1.png [ 39472 ]

          Karl Shultz added a comment - - edited

          So, actually, you don't need to do any of the Pipeline setup stuff. All you need to do to recreate this is:

          1. Have a known-working GHE server set up already. Let's say that's at https://github.example.com.

          2. Create a new Pipeline.

          3. Select GitHub Enterprise as the location where you store your source code.

          4. Add a new server. Give it a unique name, and set the URL as:

          http://github.example.com

          5. Click "Add"

          6. UI will go through the previously described lengthy delay, until finally responding as shown below. The terminal window in this screenshot also displays the exception in the Jenkins server's jenkins.log file.

          Karl Shultz added a comment - - edited So, actually, you don't need to do any of the Pipeline setup stuff. All you need to do to recreate this is: 1. Have a known-working GHE server set up already. Let's say that's at https ://github.example.com. 2. Create a new Pipeline. 3. Select GitHub Enterprise as the location where you store your source code. 4. Add a new server. Give it a unique name, and set the URL as: http ://github.example.com 5. Click "Add" 6. UI will go through the previously described lengthy delay, until finally responding as shown below. The terminal window in this screenshot also displays the exception in the Jenkins server's jenkins.log file.
          James Dumay made changes -
          Epic Link New: JENKINS-36588 [ 172614 ]
          James Dumay made changes -
          Sprint New: Blue Ocean 1.3 - candidates [ 326 ]
          James Dumay made changes -
          Sprint Original: Blue Ocean 1.4 - beta 2 [ 326 ] New: Blue Ocean 1.4 - beta 3 [ 416 ]
          James Dumay made changes -
          Rank New: Ranked higher
          James Dumay made changes -
          Sprint Original: Blue Ocean 1.4 - beta 3 [ 416 ] New: Blue Ocean 1.4 - beta 4 [ 441 ]

            Unassigned Unassigned
            kshultz Karl Shultz
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: