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

NullPointerException in launchCommandWithCredentials

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: git-client-plugin
    • Labels:
      None
    • Environment:
    • Similar Issues:

      Description

      When attempting to build git@github.com:jenkinsci/git-client-plugin.git my job fails with

      Started by user Richard Mortimer
      [EnvInject] - Loading node environment variables.
      Building remotely on bishop in workspace /opt/jenkins/slave/workspace/jenkins-git-client
      Fetching changes from the remote Git repository
      Fetching upstream changes from git@github.com:jenkinsci/git-client-plugin.git
      FATAL: null
      java.lang.NullPointerException
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:894)
      	at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.fetch(CliGitAPIImpl.java:175)
      	at hudson.plugins.git.GitAPI.fetch(GitAPI.java:229)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:616)
      	at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:299)
      	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:280)
      	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:239)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:118)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:48)
      	at hudson.remoting.Request$2.run(Request.java:326)
      	at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at hudson.remoting.Engine$1$1.run(Engine.java:63)
      	at java.lang.Thread.run(Thread.java:679)
      

      Looking at the code for the 1.4.5 release of git-client-plugin it looks like the failing line 894 is

      for (RemoteAgentFactory factory : Jenkins.getInstance().getExtensionList(RemoteAgentFactory.class)) {

      That would suggest that it is not finding any RemoteAgentFactory instances in getExtensionList().

        Attachments

          Activity

          Hide
          ndeloof Nicolas De Loof added a comment -

          This is a remoting issue. Code is ran on slave and can't access Jenkins.instance.
          Have to improve the test suite to run with remoting enabled (see remote branch on github)

          Show
          ndeloof Nicolas De Loof added a comment - This is a remoting issue. Code is ran on slave and can't access Jenkins.instance. Have to improve the test suite to run with remoting enabled (see remote branch on github)
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Nicolas De Loof
          Path:
          pom.xml
          src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
          http://jenkins-ci.org/commit/git-client-plugin/2de5e580926c3c2745ca125d0a22ff7dc6358942
          Log:
          JENKINS-20223 use GIT_SSH hack to set ssh key
          stop using ssh-agent plugin that can't be used from remote
          major drawback is that we don't support passphrase encrypted private keys.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Nicolas De Loof Path: pom.xml src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java http://jenkins-ci.org/commit/git-client-plugin/2de5e580926c3c2745ca125d0a22ff7dc6358942 Log: JENKINS-20223 use GIT_SSH hack to set ssh key stop using ssh-agent plugin that can't be used from remote major drawback is that we don't support passphrase encrypted private keys.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Oli Dagenais
          Path:
          src/main/java/hudson/plugins/tfs/model/Server.java
          http://jenkins-ci.org/commit/tfs-plugin/4771a8ad1c20de14f190d857be1fce3a67819d49
          Log:
          Query Jenkins through channel to support nodes

          According to
          https://issues.jenkins-ci.org/browse/JENKINS-20223?focusedCommentId=188427&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-188427
          it is not possible to obtain the Jenkins instance from a node, so we go
          through the remoting channel instead.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oli Dagenais Path: src/main/java/hudson/plugins/tfs/model/Server.java http://jenkins-ci.org/commit/tfs-plugin/4771a8ad1c20de14f190d857be1fce3a67819d49 Log: Query Jenkins through channel to support nodes According to https://issues.jenkins-ci.org/browse/JENKINS-20223?focusedCommentId=188427&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-188427 it is not possible to obtain the Jenkins instance from a node, so we go through the remoting channel instead.

            People

            • Assignee:
              ndeloof Nicolas De Loof
              Reporter:
              oldelvet Richard Mortimer
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: