# Submodules with JGit

**URL:** <https://community.jenkins.io/t/submodules-with-jgit/13306>\
**Category:** Ask a question\
**Created:** [March 13, 2024, 4:18pm UTC](https://community.jenkins.io/t/submodules-with-jgit/13306 "2024-03-13T16:18:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonny\_vb](https://avatars.discourse-cdn.com/v4/letter/j/8edcca/32.png) [@jonny\_vb](https://community.jenkins.io/u/jonny_vb)\
**Post date:** [March 13, 2024, 4:18pm UTC](https://community.jenkins.io/t/submodules-with-jgit/13306/1 "2024-03-13T16:18:18Z")

</div>

> **Jenkins setup**
>
> ## Jenkins: 2.448 OS: Windows Server 2019 - 10.0 Java: 21.0.2 - Eclipse Adoptium (OpenJDK 64-Bit Server VM)
> 
> Office-365-Connector:4.21.0  
> analysis-model-api:12.1.0  
> ansicolor:1.0.4  
> antisamy-markup-formatter:162.v0e6ec0fcfcf6  
> apache-httpcomponents-client-4-api:4.5.14-208.v438351942757  
> authentication-tokens:1.53.v1c90fd9191a\_b\_  
> blueocean:1.27.11  
> blueocean-autofavorite:1.2.5  
> blueocean-bitbucket-pipeline:1.27.11  
> blueocean-commons:1.27.11  
> blueocean-config:1.27.11  
> blueocean-core-js:1.27.11  
> blueocean-dashboard:1.27.11  
> blueocean-display-url:2.4.2  
> blueocean-events:1.27.11  
> blueocean-git-pipeline:1.27.11  
> blueocean-github-pipeline:1.27.11  
> blueocean-i18n:1.27.11  
> blueocean-jwt:1.27.11  
> blueocean-personalization:1.27.11  
> blueocean-pipeline-api-impl:1.27.11  
> blueocean-pipeline-editor:1.27.11  
> blueocean-pipeline-scm-api:1.27.11  
> blueocean-rest:1.27.11  
> blueocean-rest-impl:1.27.11  
> blueocean-web:1.27.11  
> bootstrap5-api:5.3.3-1  
> bouncycastle-api:2.30.1.77-225.v26ea\_c9455fd9  
> branch-api:2.1152.v6f101e97dd77  
> build-timeout:1.32  
> caffeine-api:3.1.8-133.v17b\_1ff2e0599  
> checks-api:2.0.2  
> cloudbees-bitbucket-branch-source:877.vb\_b\_d5243f6794  
> cloudbees-folder:6.928.v7c780211d66e  
> command-launcher:107.v773860566e2e  
> commons-httpclient3-api:3.1-3  
> commons-lang3-api:3.13.0-62.v7d18e55f51e2  
> commons-text-api:1.11.0-95.v22a\_d30ee5d36  
> coverage:1.13.0  
> credentials:1337.v60b\_d7b\_c7b\_c9f  
> credentials-binding:657.v2b\_19db\_7d6e6d  
> data-tables-api:2.0.1-1  
> display-url-api:2.200.vb\_9327d658781  
> docker-commons:439.va\_3cb\_0a\_6a\_fb\_29  
> docker-workflow:572.v950f58993843  
> durable-task:550.v0930093c4b\_a\_6  
> echarts-api:5.5.0-1  
> email-ext:2.105  
> embeddable-build-status:467.v4a\_954796e45d  
> favorite:2.208.v91d65b\_7792a\_c  
> folder-properties:1.2.1  
> font-awesome-api:6.5.1-3  
> forensics-api:2.4.0  
> git:5.2.1  
> git-client:4.6.0  
> github:1.38.0  
> github-api:1.318-461.v7a\_c09c9fa\_d63  
> github-branch-source:1772.va\_69eda\_d018d4  
> gson-api:2.10.1-15.v0d99f670e0a\_7  
> handy-uri-templates-2-api:2.1.8-30.v7e777411b\_148  
> htmlpublisher:1.33  
> instance-identity:185.v303dc7c645f9  
> ionicons-api:56.v1b\_1c8c49374e  
> jackson2-api:2.16.1-373.ve709c6871598  
> jakarta-activation-api:2.1.3-1  
> jakarta-mail-api:2.1.3-1  
> javax-activation-api:1.2.0-6  
> javax-mail-api:1.6.2-9  
> jaxb:2.3.9-1  
> jdk-tool:73.vddf737284550  
> jenkins-design-language:1.27.11  
> jjwt-api:0.11.5-77.v646c772fddb\_0  
> joda-time-api:2.12.7-29.v5a\_b\_e3a\_82269a\_  
> jquery3-api:3.7.1-2  
> jsch:0.2.16-86.v42e010d9484b\_  
> json-api:20240205-27.va\_007549e895c  
> json-path-api:2.9.0-33.v2527142f2e1d  
> junit:1259.v65ffcef24a\_88  
> mailer:470.vc91f60c5d8e2  
> matrix-project:822.824.v14451b\_c0fd42  
> metrics:4.2.21-449.v6960d7c54c69  
> mina-sshd-api-common:2.12.0-90.v9f7fb\_9fa\_3d3b\_  
> mina-sshd-api-core:2.12.0-90.v9f7fb\_9fa\_3d3b\_  
> multibranch-action-triggers:1.8.6  
> okhttp-api:4.11.0-172.vda\_da\_1feeb\_c6e  
> pipeline-build-step:540.vb\_e8849e1a\_b\_d8  
> pipeline-graph-analysis:216.vfd8b\_ece330ca\_  
> pipeline-graph-view:227.v2a\_fb\_476da\_3a\_9  
> pipeline-groovy-lib:704.vc58b\_8890a\_384  
> pipeline-input-step:491.vb\_07d21da\_1a\_fb\_  
> pipeline-milestone-step:111.v449306f708b\_7  
> pipeline-model-api:2.2175.v76a\_fff0a\_2618  
> pipeline-model-definition:2.2175.v76a\_fff0a\_2618  
> pipeline-model-extensions:2.2175.v76a\_fff0a\_2618  
> pipeline-rest-api:2.34  
> pipeline-stage-step:305.ve96d0205c1c6  
> pipeline-stage-tags-metadata:2.2175.v76a\_fff0a\_2618  
> pipeline-stage-view:2.34  
> plain-credentials:179.vc5cb\_98f6db\_38  
> plugin-util-api:4.1.0  
> prism-api:1.29.0-13  
> pubsub-light:1.18  
> resource-disposer:0.23  
> role-strategy:711.vf33a\_d2c994b\_a\_  
> scm-api:683.vb\_16722fb\_b\_80b\_  
> scm-filter-branch-pr:148.v0b\_5f06e8b\_c84  
> script-security:1326.vdb\_c154de8669  
> snakeyaml-api:2.2-111.vc6598e30cc65  
> sse-gateway:1.26  
> ssh-credentials:322.v124df57ed808  
> sshd:3.322.v159e91f6a\_550  
> structs:337.v1b\_04ea\_4df7c8  
> timestamper:1.26  
> token-macro:400.v35420b\_922dcb\_  
> trilead-api:2.141.v284120fd0c46  
> variant:60.v7290fc0eb\_b\_cd  
> view-job-filters:369.ve0513a\_a\_f5524  
> warnings-ng:11.2.0  
> workflow-aggregator:596.v8c21c963d92d  
> workflow-api:1291.v51fd2a\_625da\_7  
> workflow-basic-steps:1049.v257a\_e6b\_30fb\_d  
> workflow-cps:3883.vb\_3ff2a\_e3eea\_f  
> workflow-durable-task-step:1331.vc8c2fed35334  
> workflow-job:1400.v7fd111b\_ec82f  
> workflow-multibranch:783.va\_6eb\_ef636fb\_d  
> workflow-scm-step:415.v434365564324  
> workflow-step-api:657.v03b\_e8115821b\_  
> workflow-support:865.v43e78cc44e0d  
> ws-cleanup:0.45
> 
> Agent:  
> Windows server agent
> 
> Both installed via docker on the same machine.

Been using Jenkins for a while now and mainly all good. However, we’ve recently tried to add a submodule to a project. After having enable the advanced submodule option to Recursively update submodules, the pipeline just completely fails (without this enabled the pipeline runs, but the submodule directory is empty).  
The issue seems to be that we’re using JGit and there is a call to `setupSubmoduleUrls` which throws an `UnsupportedOperationException`.  
Is this an issue with JGit and submodules, or something else?

Full console log:

> **Console Log**
>
> Started by user Jonny van Beek  
> Replayed #74  
> Obtained cmsis\_pack.Jenkinsfile from 4e773868948c149c7c945c75a3c8ad4965bac3a1  
> Loading library Horsham-Shared-Library@feature/CMSIS-pack-pipeline  
> Attempting to resolve feature/CMSIS-pack-pipeline from remote references…
> 
> > JGit ls-remote # timeout=10  
> > Found match: refs/heads/feature/CMSIS-pack-pipeline revision 7fe5e3035080738575359b60452fb826ff8f0fdd  
> > The recommended git tool is: NONE  
> > using credential jvb\_bitbucket\_full\_access\_personal\_token  
> > Fetching changes from the remote Git repository  
> > Fetching without tags  
> > JGit fetch # timeout=10  
> > Checking out Revision 7fe5e3035080738575359b60452fb826ff8f0fdd (feature/CMSIS-pack-pipeline)  
> > Commit message: “Remove command removed from shared library”  
> > [Bitbucket] Notifying commit build result  
> > Replacing contents of vars/PythonPipeline.groovy  
> > Replacing contents of vars/uVisionPipeline.groovy  
> > Replacing contents of vars/GprmPipeline.groovy  
> > Replacing contents of vars/CmsisPackPipeline.groovy  
> > [Pipeline] Start of Pipeline  
> > [Pipeline] node  
> > Running on cdls-jenkins-h\_Agent in C:/users/jenkins/work/workspace/ature\_shared-cmsis-pack-pipeline  
> > [Pipeline] {  
> > [Pipeline] stage  
> > [Pipeline] { (Declarative: Checkout SCM)  
> > [Pipeline] checkout  
> > The recommended git tool is: NONE  
> > using credential jvb\_bitbucket\_full\_access\_personal\_token  
> > Fetching changes from the remote Git repository  
> > Fetching without tags  
> > Checking out Revision 4e773868948c149c7c945c75a3c8ad4965bac3a1 (feature/shared-cmsis-pack-pipeline)  
> > Commit message: “Move install\_cmsis\_pack to submodule Update tasks to use new path”  
> > JGit fetch # timeout=10  
> > [Pipeline] }  
> > [Pipeline] // stage  
> > [Pipeline] }  
> > [Pipeline] // node  
> > [Pipeline] stage  
> > [Pipeline] { (Declarative: Post Actions)  
> > [Pipeline] emailext  
> > Sending email to: \*\*\*  
> > [Pipeline] cleanWs  
> > Error when executing cleanup post condition:  
> > Also: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: e7c83236-31b0-4f3a-bfda-1e5c0970ccaf  
> > org.jenkinsci.plugins.workflow.steps.MissingContextVariableException: Required context class hudson.FilePath is missing  
> > Perhaps you forgot to surround the step with a step that provides this, such as: node  
> > at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:90)  
> > at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:71)  
> > at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)  
> > at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)  
> > at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)  
> > at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)  
> > at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)  
> > at java.base/java.lang.Thread.run(Thread.java:1583)
> 
> [Pipeline] }  
> [Pipeline] // stage  
> [Pipeline] End of Pipeline  
> Also: hudson.remoting.Channel$CallSiteStackTrace: Remote call to cdls-jenkins-h\_Agent  
> at hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1787)  
> at hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)  
> at hudson.remoting.Channel.call(Channel.java:1003)  
> at hudson.remoting.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:285)  
> at jdk.proxy85/jdk.proxy85.$Proxy182.setupSubmoduleUrls(Unknown Source)  
> at org.jenkinsci.plugins.gitclient.RemoteGitImpl.setupSubmoduleUrls(RemoteGitImpl.java:788)  
> at hudson.plugins.git.extensions.impl.SubmoduleOption.onCheckoutCompleted(SubmoduleOption.java:181)  
> at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1390)  
> at org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:129)  
> at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:97)  
> at org.jenkinsci.plugins.workflow.steps.scm.SCMStep$StepExecutionImpl.run(SCMStep.java:84)  
> at org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47)  
> at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)  
> at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)  
> at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)  
> at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)  
> at java.base/java.lang.Thread.run(Thread.java:1583)  
> Also: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 1e503700-fa35-4489-83ce-5dbf6676c047  
> java.lang.UnsupportedOperationException: not implemented yet  
> at org.jenkinsci.plugins.gitclient.JGitAPIImpl.setupSubmoduleUrls(JGitAPIImpl.java:2719)  
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
> at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)  
> at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
> at java.base/java.lang.reflect.Method.invoke(Method.java:568)  
> at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:924)  
> at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:902)  
> at hudson.remoting.RemoteInvocationHandler$RPCRequest.call(RemoteInvocationHandler.java:853)  
> at hudson.remoting.UserRequest.perform(UserRequest.java:211)  
> at hudson.remoting.UserRequest.perform(UserRequest.java:54)  
> at hudson.remoting.Request$2.run(Request.java:377)  
> 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:1136)  
> at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)  
> at hudson.remoting.Engine$1.lambda$newThread$0(Engine.java:137)  
> at java.base/java.lang.Thread.run(Thread.java:833)  
> [Bitbucket] Notifying commit build result  
> [Bitbucket] Build result notified  
> Finished: FAILURE
