Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Won't Fix
-
Component/s: git-plugin
-
Labels:None
-
Environment:jenkins 2.263.1
git-plugin 4.5.2
-
Similar Issues:
Description
We are checking out a repository with submodules in a multibranch pipeline using the following script:
checkout([ $class: 'GitSCM', branches: scm.branches, doGenerateSubmoduleConfigurations: true, extensions: scm.extensions + [[$class: 'SubmoduleOption', recursiveSubmodules: true]], userRemoteConfigs: scm.userRemoteConfigs ])
This however fails with the following error:
java.io.NotSerializableException: java.util.HashMap$Values at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184) at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1378) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1378) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174) at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548) at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509) at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432) at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178) at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348) at hudson.remoting.UserRequest._serialize(UserRequest.java:263) at hudson.remoting.UserRequest.serialize(UserRequest.java:272) Caused: java.io.IOException: Unable to serialize UserRPCRequest:org.jenkinsci.plugins.gitclient.GitClient.withRepository[org.jenkinsci.plugins.gitclient.RepositoryCallback](44) at hudson.remoting.UserRequest.serialize(UserRequest.java:274) at hudson.remoting.UserRequest.<init>(UserRequest.java:101) at hudson.remoting.Channel.call(Channel.java:996) at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:285) at com.sun.proxy.$Proxy78.withRepository(Unknown Source) at org.jenkinsci.plugins.gitclient.RemoteGitImpl.withRepository(RemoteGitImpl.java:237) at hudson.plugins.git.util.GitUtils.filterTipBranches(GitUtils.java:215) Caused: hudson.plugins.git.GitException: Error computing merge base at hudson.plugins.git.util.GitUtils.filterTipBranches(GitUtils.java:268) at hudson.plugins.git.SubmoduleCombinator.createSubmoduleCombinations(SubmoduleCombinator.java:41) at hudson.plugins.git.extensions.impl.SubmoduleOption.onCheckoutCompleted(SubmoduleOption.java:182) at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1379) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:125) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:93) at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:80) at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)
Interestingly the error does not occur when the submodules are not checked out or doGenerateSubmoduleConfigurations is set to false.
You don't want doGenerateSubmoduleConfigurations: true. Either remove that line or set it to the default value false.
I'm sorry that the setting is included in the pipeline syntax suggestions and that it is offered to users with the default value false. The setting is undocumented, untested, and unsupported. It was created many years ago when we were still trying to understand the ways that Jenkins would be used with git.
I intend to remove that setting from git plugin 5.0 so that it won't be visible to users.
Refer to similar comments I made on a previous issue.