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

Using revList_ Command CliGitAPIImpl is not serializable

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker

      Hi,

      When developping a plugin i noticed that my code run on controller but not within remote agent.

       

      GitClient client = scm.createClient(listener, env, build, workspace);
      
      client.fetch_().from(remoteURI, remote.getFetchRefSpecs()).execute();
      
      // this code works everywhere
      listener.getLogger().println(client.revList("710a3136cb4cdc077f1ddb528120c4f1eaa68cfa"));
      
      // this part only on controller
      List<ObjectId> mergeIds = new ArrayList();
      client.revList_().reference("710a3136cb4cdc077f1ddb528120c4f1eaa68cfa").to(mergeIds).execute();
      listener.getLogger().println("Le dernier merge commit : " + mergeIds.get(0).name());
      

      The console output when build is run on remote :

      java.lang.ClassCastException: class org.jenkinsci.plugins.gitclient.CliGitAPIImpl$11 is returned from public abstract org.jenkinsci.plugins.gitclient.RevListCommand org.jenkinsci.plugins.gitclient.GitClient.revList_() on class hudson.plugins.git.GitAPI but it's not serializable
      Also:   hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect connection from kubernetes.docker.internal/127.0.0.1:59311
      		at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1800)
      		at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
      		at hudson.remoting.Channel.call(Channel.java:1001)
      		at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:286)
      		at com.sun.proxy.$Proxy102.revList_(Unknown Source)
      		at org.jenkinsci.plugins.gitclient.RemoteGitImpl.revList_(RemoteGitImpl.java:609)
      		at com.engie.franceb2b.ec.side.CreateReleaseBranchStep.createReleaseBranch(CreateReleaseBranchStep.java:94)
      		at com.engie.franceb2b.ec.side.CreateReleaseBranchStep.perform(CreateReleaseBranchStep.java:115)
      		at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:100)
      		at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:70)
      		at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)
      		at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      		at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      		at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      		at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      Caused: hudson.remoting.RemotingSystemException
      	at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:939)
      	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:905)
      	at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:857)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:211)
      	at hudson.remoting.UserRequest.perform(UserRequest.java:54)
      	at hudson.remoting.Request$2.run(Request.java:376)
      	at hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
      	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
      	at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:119)
      	at java.base/java.lang.Thread.run(Thread.java:829)
       > git.exe rev-list 710a3136cb4cdc077f1ddb528120c4f1eaa68cfa # timeout=10
      

            Unassigned Unassigned
            bouland Simon Bouland
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: