Skip to content

cloning git submodule with credential are partially updated (400 bad request) #9708

Open

Description

@ebarboni

Apache NetBeans version

Apache NetBeans 31

What happened

Cloning a gitlab hosted repo with 4-5 submodules in it that are hosted in the same gitlab instance lead to partial clone/update of the submodule (bad request exception)

test.git is a submodule:

Caused: org.netbeans.libs.git.GitException: https://....../test.git: 400 Bad Request
	at org.netbeans.libs.git.jgit.commands.TransportCommand.handleException(TransportCommand.java:235)
	at org.netbeans.libs.git.jgit.commands.SubmoduleUpdateCommand.runTransportCommand(SubmoduleUpdateCommand.java:80)
	at org.netbeans.libs.git.jgit.commands.TransportCommand.run(TransportCommand.java:165)
	at org.netbeans.libs.git.jgit.commands.GitCommand.execute(GitCommand.java:49)
	at org.netbeans.libs.git.GitClient.updateSubmodules(GitClient.java:1378)
	at org.netbeans.modules.git.client.GitClient$59.call(GitClient.java:849)
	at org.netbeans.modules.git.client.GitClient$59.call(GitClient.java:845)
	at org.openide.util.NetworkSettings.suppressAuthenticationDialog(NetworkSettings.java:138)
	at org.netbeans.modules.git.client.GitClient$CommandInvoker$1$1.call(GitClient.java:943)
	at org.netbeans.modules.git.client.GitClient$CommandInvoker$1.call(GitClient.java:968)
	at org.netbeans.modules.git.FilesystemInterceptor.runWithoutExternalEvents(FilesystemInterceptor.java:477)
	at org.netbeans.modules.git.Git.runWithoutExternalEvents(Git.java:259)
	at org.netbeans.modules.git.client.GitClient$CommandInvoker.runMethodIntern(GitClient.java:978)
	at org.netbeans.modules.git.client.GitClient$CommandInvoker.runMethod(GitClient.java:905)
	at org.netbeans.modules.git.client.GitClient$CommandInvoker.runMethod(GitClient.java:887)
	at org.netbeans.modules.git.client.GitClient.updateSubmodules(GitClient.java:845)
[catch] at org.netbeans.modules.git.ui.clone.CloneAction$2$1.initSubmodules(CloneAction.java:261)
	at org.netbeans.modules.git.ui.clone.CloneAction$2$1.call(CloneAction.java:229)
	at org.netbeans.modules.git.ui.clone.CloneAction$2$1.call(CloneAction.java:191)
	at org.netbeans.modules.versioning.indexingbridge.Bridge$1.call(Bridge.java:41)
	at org.netbeans.modules.parsing.api.indexing.IndexingManager.runProtected(IndexingManager.java:360)
	at org.netbeans.modules.versioning.indexingbridge.Bridge.runWithoutIndexing(Bridge.java:36)
	at org.netbeans.modules.versioning.util.IndexingBridge.runWithoutIndexing(IndexingBridge.java:116)
	at org.netbeans.modules.versioning.util.IndexingBridge.runWithoutIndexing(IndexingBridge.java:79)
	at org.netbeans.modules.git.utils.GitUtils.runWithoutIndexing(GitUtils.java:899)
	at org.netbeans.modules.git.ui.clone.CloneAction$2.perform(CloneAction.java:191)
	at org.netbeans.modules.git.client.GitProgressSupport.performIntern(GitProgressSupport.java:92)
	at org.netbeans.modules.git.client.GitProgressSupport.run(GitProgressSupport.java:85)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1370)
	at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
	at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
	at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1981)

Language / Project Type / NetBeans Component

java but not relevant

How to reproduce

Menu
Team->Git->Clone
-> select a git repo with submodules in it (I use gitlab hosted repo with credentials in my case, with maven project as submodule)
-> you will be prompted to open project (NetBeans only wants to open subset of expected)

IDE log contains exception,
Git log output windows looks ok

Did this work correctly in an earlier version?

No / Don't know

Operating System

linux wsl ubuntu 26.04

JDK

jdk 25

Apache NetBeans packaging

Apache NetBeans Snap Package

Anything else

I do a run with jgit on a maven project (using the same jgit version as in NetBeans) and no exception

 Git git = Git.cloneRepository()
                .setURI("https://nonpublic/metatest.git")
                .setDirectory(file)
                .setCredentialsProvider(credentialsProvider)
                .call();

        // init submodule
        Map<String, SubmoduleStatus> call = git.submoduleStatus().call();
        for (Map.Entry<String, SubmoduleStatus> entry : call.entrySet()) {
            System.err.println(entry.getKey());
            System.err.println(entry.getValue().getType());
            git.submoduleInit().addPath(entry.getKey()).call();
        }

        // update submodulle
        for (Map.Entry<String, SubmoduleStatus> entry : call.entrySet()) {
            System.err.println(entry.getKey());
            System.err.println(entry.getValue().getType());
            git.submoduleUpdate().addPath(entry.getKey()).setTimeout(45).setCredentialsProvider(credentialsProvider).call();
        }
        call = git.submoduleStatus().call();
        // check statuts
        for (Map.Entry<String, SubmoduleStatus> entry : call.entrySet()) {
            System.err.println(entry.getKey());
            System.err.println(entry.getValue().getType());
        }

Are you willing to submit a pull request?

No

Activity

  1. added
    kind:bugBug report or fix
    needs:triageRequires attention from one of the committers
    on Oct 12, 2026
  2. added
    git[ci] enable versioning job
    on Oct 12, 2026
  3. mbien commented on Oct 13, 2026

    @mbien
    Member

    Apache NetBeans 31

    have you tried a dev build? Since we swapped all libs out by now.

  4. ebarboni commented on Oct 15, 2026

    @ebarboni
    ContributorAuthor

    I tried dev build, but same random 400

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    git[ci] enable versioning jobkind:bugBug report or fixneeds:triageRequires attention from one of the committers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions