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

GitHub Enterprise creation ends with error; logs mention "invalid scan credentials"

    • Blue Ocean 1.3, Blue Ocean 1.4 - beta 1, Blue Ocean 1.4 - beta 2

      The final step in the GitHub Enterprise creation flow ends with error. Logs contain an error about "invalid scan credentials" (see below). Could possibly be related to GitHub Enterprise version as we've tested mostly against 2.9.2.

      Error creating pipeline jimmy: Invalid scan credentials jimmy/****** (GitHub Enterprise Access Token) to connect to https://<URI_OMITTED>/api/v3, skipping
      hudson.AbortException: Invalid scan credentials jimmy/****** (GitHub Enterprise Access Token) to connect to https://<URI_OMITTED>/api/v3, skipping  at org.jenkinsci.plugins.github_branch_source.Connector.checkConnectionValidity(Connector.java:435) at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource.retrieve(GitHubSCMSource.java:830) at jenkins.scm.api.SCMSource._retrieve(SCMSource.java:355) at jenkins.scm.api.SCMSource.fetch(SCMSource.java:285) at io.jenkins.blueocean.blueocean_github_pipeline.GithubPipelineCreateRequest.repoHasJenkinsFile(GithubPipelineCreateRequest.java:340) at io.jenkins.blueocean.blueocean_github_pipeline.GithubPipelineCreateRequest.create(GithubPipelineCreateRequest.java:178) at io.jenkins.blueocean.rest.model.BluePipelineContainer.create(BluePipelineContainer.java:54) at io.jenkins.blueocean.rest.model.BluePipelineContainer.create(BluePipelineContainer.java:50) at java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:627) at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343) at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184) at org.kohsuke.stapler.SelectionInterceptedFunction$Adapter.invoke(SelectionInterceptedFunction.java:36) at org.kohsuke.stapler.verb.HttpVerbInterceptor.invoke(HttpVerbInterceptor.java:48) at org.kohsuke.stapler.SelectionInterceptedFunction.bindAndInvoke(SelectionInterceptedFunction.java:26) 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.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:812) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669) 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.auth.jwt.impl.JwtAuthenticationFilter.doFilter(JwtAuthenticationFilter.java:51) 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 com.smartcodeltd.jenkinsci.plugin.assetbundler.filters.LessCSS.doFilter(LessCSS.java:47) at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132) at hudson.plugins.scm_sync_configuration.extensions.ScmSyncConfigurationFilter$1.call(ScmSyncConfigurationFilter.java:49) at hudson.plugins.scm_sync_configuration.extensions.ScmSyncConfigurationFilter$1.call(ScmSyncConfigurationFilter.java:44) at hudson.plugins.scm_sync_configuration.ScmSyncConfigurationDataProvider.provideRequestDuring(ScmSyncConfigurationDataProvider.java:106) at hudson.plugins.scm_sync_configuration.extensions.ScmSyncConfigurationFilter.doFilter(ScmSyncConfigurationFilter.java:44) 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.plugins.audit_trail.AuditTrailFilter.doFilter(AuditTrailFilter.java:95) 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:1652) 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:1652) 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:1652) at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:499) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544) 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:748)

          [JENKINS-46996] GitHub Enterprise creation ends with error; logs mention "invalid scan credentials"

          Jimmy Ray added a comment -

          GitHub API Plugin

          Local OSS Jenkins = 1.86

          CloudBees Jenkins = 1.79

          Jimmy Ray added a comment - GitHub API Plugin Local OSS Jenkins = 1.86 CloudBees Jenkins = 1.79

          Michael Neale added a comment -

          vivek do you have access to a GHE 2.10.4 to try with? or perhaps the stack trace hints at what the problem is with the credential. 

          Michael Neale added a comment - vivek do you have access to a GHE 2.10.4 to try with? or perhaps the stack trace hints at what the problem is with the credential. 

          Vivek Pandey added a comment -

          jimmyraywv From the looks of exception trace, Its failing validating credentials. GHE is returning an error. In case of bad credential GHE should return 401 status code.

          Code that does it is printing actual error received as FINE log. If possible enable FINE logging and report back the error printed along with stack trace.

          If you can't do that then try curl command below and report back whether its 200 with user object. In case of error (non 200 response code) please paste the error response.

          curl -v -H 'Authorization: token TOKEN'  YOUR_GHE_URL/api/v3/user
          

          Our GHE instance is having some issues, once its up I am going to try reproduce it.

          Vivek Pandey added a comment - jimmyraywv From the looks of exception trace, Its failing validating credentials. GHE is returning an error. In case of bad credential GHE should return 401 status code. Code that does it is printing actual error received as FINE log . If possible enable FINE logging and report back the error printed along with stack trace. If you can't do that then try curl command below and report back whether its 200 with user object. In case of error (non 200 response code) please paste the error response. curl -v -H 'Authorization: token TOKEN' YOUR_GHE_URL/api/v3/user Our GHE instance is having some issues, once its up I am going to try reproduce it.

          Jimmy Ray added a comment -

          Thank vivek for your recommendation.  Ran the curl command and saw that the URL I was using was returning a 301.  Once I changed the URL in the curl command, I got the appropriate reply, to the curl command, without the 301.  Then I tried the create pipeline action in BO and it worked.  Thanks for your help.

          Jimmy Ray added a comment - Thank vivek for your recommendation.  Ran the curl command and saw that the URL I was using was returning a 301.  Once I changed the URL in the curl command, I got the appropriate reply, to the curl command, without the 301.  Then I tried the create pipeline action in BO and it worked.  Thanks for your help.

          Michael Neale added a comment -

          jimmyraywv was is the v3 portion of the URL that was missing? (if so, there is another open ticket to set a suggested default for that to make it clearer in future)

          Michael Neale added a comment - jimmyraywv was is the v3 portion of the URL that was missing? (if so, there is another open ticket to set a suggested default for that to make it clearer in future)

          Jimmy Ray added a comment -

          michaelneale no, that was there.  It was an alias URL that worked in my browser.  It looks like the 301 was not being followed by the GHE plugin.

          Jimmy Ray added a comment - michaelneale no, that was there.  It was an alias URL that worked in my browser.  It looks like the 301 was not being followed by the GHE plugin.

          Michael Neale added a comment -

          jimmyraywv gotcha - do you think the 301 should be followed by an api client? (if so can open a bug somewhere) or is this ok but just not a suitable error message? 

          Michael Neale added a comment - jimmyraywv gotcha - do you think the 301 should be followed by an api client? (if so can open a bug somewhere) or is this ok but just not a suitable error message? 

          Karl Shultz added a comment -

          Testing Notes:
          Seems there are two ways to go about this.

          1. If we implement a fix for following 301 redirects, include an automated test which verifies that this works.
          2. If we change the error messaging, include an automated test which checks to make sure the expected error message is presented when needed.

          Karl Shultz added a comment - Testing Notes: Seems there are two ways to go about this. If we implement a fix for following 301 redirects, include an automated test which verifies that this works. If we change the error messaging, include an automated test which checks to make sure the expected error message is presented when needed.

          Jimmy Ray added a comment -

          Some security postures frown on apps following 301 redirects.  Perhaps you could add a configuration for this, but I would not make it work as the default.

          Jimmy Ray added a comment - Some security postures frown on apps following 301 redirects.  Perhaps you could add a configuration for this, but I would not make it work as the default.

          Michael Neale added a comment -

          jimmyraywv ah of course - I knew there was a reason why api clients don't follow that way... ok thanks. 

          Michael Neale added a comment - jimmyraywv ah of course - I knew there was a reason why api clients don't follow that way... ok thanks. 

            vivek Vivek Pandey
            cliffmeyers Cliff Meyers
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: