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

NPE when selecting a scan credential for GitHub SCM on Pipeline Libraries

    Details

    • Similar Issues:

      Description

      Use case:
      I want to add a Global Pipeline Library.
      1/ Go to Manage Jenkins -> Configuration
      2/ On Global Pipeline Libraries section I click on Add button.
      3/ I fill Name field
      4/ I select Modern SCM ratio button on Retrieval method section
      5/ I select GitHub button on Source Code Management section
      6/ I fill Owner field
      7/ I select a Scan credentials
      Just after selecting a credential i get this following stacktrace:

      javax.servlet.ServletException: java.lang.NullPointerException
          at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:796)
          at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
          at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:236)
          at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
          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:727)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
          at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
          at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135)
          at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:126)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
          at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:86)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
          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: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.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
          at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
          at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
          at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
          at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:610)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
          at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
          at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
          at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
          at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
          at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NullPointerException
          at org.jenkinsci.plugins.github_branch_source.Connector.checkScanCredentials(Connector.java:112)
          at org.jenkinsci.plugins.github_branch_source.GitHubSCMSource$DescriptorImpl.doCheckScanCredentialsId(GitHubSCMSource.java:1231)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:497)
          at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:335)
          at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:175)
          at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:108)
          at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:124)
          at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
          at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
                  ... 64 more
      
      

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment -

            2.0.4-beta-1 on the experimental UC; not sure when Stephen Connolly plans to cut a general release.

            Show
            jglick Jesse Glick added a comment - 2.0.4-beta-1 on the experimental UC; not sure when Stephen Connolly plans to cut a general release.
            Hide
            ronabop Ronald Gundlach-Chmara added a comment -

            Kudos forĀ putting in a fix! ETA on next release?

            Show
            ronabop Ronald Gundlach-Chmara added a comment - Kudos forĀ putting in a fix! ETA on next release?
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            pom.xml
            src/main/java/org/jenkinsci/plugins/github_branch_source/Connector.java
            src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java
            src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java
            http://jenkins-ci.org/commit/github-branch-source-plugin/dc13e7a53b4ff1bda2a1eeed547f510ebfdefb2d
            Log:
            [FIXED JENKINS-41904] NPE from GitHubSCMSource$DescriptorImpl.doCheckScanCredentialsId when there is no contextual SCMSourceOwner.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: pom.xml src/main/java/org/jenkinsci/plugins/github_branch_source/Connector.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMNavigator.java src/main/java/org/jenkinsci/plugins/github_branch_source/GitHubSCMSource.java http://jenkins-ci.org/commit/github-branch-source-plugin/dc13e7a53b4ff1bda2a1eeed547f510ebfdefb2d Log: [FIXED JENKINS-41904] NPE from GitHubSCMSource$DescriptorImpl.doCheckScanCredentialsId when there is no contextual SCMSourceOwner.
            Hide
            egutierrez Evaristo Gutierrez added a comment -

            I can confirm it was working for 1.10.1

            Show
            egutierrez Evaristo Gutierrez added a comment - I can confirm it was working for 1.10.1
            Hide
            jglick Jesse Glick added a comment -

            Only affects 2.x versions I think.

            Show
            jglick Jesse Glick added a comment - Only affects 2.x versions I think.
            Hide
            jglick Jesse Glick added a comment -

            Looks like a regression from the fix of JENKINS-40451.

            Show
            jglick Jesse Glick added a comment - Looks like a regression from the fix of JENKINS-40451 .
            Hide
            stephenconnolly Stephen Connolly added a comment -

            Hmmm seems like the global library configuration is not following the contract of invoking the descriptor within the context of a SCMSourceOwner

            Show
            stephenconnolly Stephen Connolly added a comment - Hmmm seems like the global library configuration is not following the contract of invoking the descriptor within the context of a SCMSourceOwner

              People

              • Assignee:
                jglick Jesse Glick
                Reporter:
                lautou Laurent TOURREAU
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: