dtmland
dtmland

Reputation: 2216

Team Foundation Server 2015 git repo with submodules on external git servers

I've got Team Foundation Server 2015 installed. Everything is working great expect one thing.

I am working with two main repositories (Created from team projects). The build for the first repository works great but the build for the second repository has problems.

The first has sub-modules that live on the TFS server itself. The build works great here.

The second has sub-modules that live on a different server. When this build runs TFS fails to obtain those submodules:

******************************************************************************
    Starting: Get sources
******************************************************************************
Syncing repository: my_app (Git)
Checking out dbab6... to C:\TfsBuildAgents\Agent-UTP120W-1\_work\5\s with submodules

Object not found - no matching loose object (f8334...)

Prepare repository failed with exception.

(I've abbreviated the SHA's here for simplicity)

The SHA that starts with f8334... is the submodule that lives on an external git server. My guess is that this error:

Object not found - no matching loose object

actually has something to do with the credentials that TFS is attempting to use on the remote server. Is there a way to see which credentials TFS is using to interact with the remote server? Is there a way to configure these credentials myself?

I attempted to change the repository type in the build settings from git to external git so that I could specify credentials. However, this results in yet a different error:

******************************************************************************
    Starting: Get sources
******************************************************************************
Syncing repository: my_app (Git)

Too many redirects or authentication replays

Prepare repository failed with exception.

Google results for both this error:

Too many redirects or authentication replays

and the previous don't seem to turn up anything useful for this scenario. Anyone have any clues?

UPDATE

It looks like TFS 2015 only supports repos with submodules that are in TFS itself, or are anonymously accessible. However, a new feature request was created to address external authentication for submodules.

However, in my case the external git server is anonymously accessible. So, unfortunately, I'm guessing that the problem somehow lies with my external git server? For reference it is the open source software Bonobo Git server.

Upvotes: 0

Views: 4727

Answers (1)

Cece Dong - MSFT
Cece Dong - MSFT

Reputation: 31083

I couldn't reproduce your issue, but I'd like to update my test for your reference:

  1. Create a Git team project "git5" in TFS 2015, create a new solution "project2" and push it to TFS.

  2. I use Visual Studio Team Services as the external git server. And create a Git team project "Git", as well as pushing a project "GitForVSO" in it.

  3. Add the project "GitForVSO" to project "Project2" as submodule, the command is: %Project2%>git submodule add https://xxx.visualstudio.com/DefaultCollection/_git/Git/

  4. Commit the changes and push it to TFS. Now the the team project "git5" looks like the screenshot below:

enter image description here

  1. Create an empty build definition and specify the "Repository" tab like the screenshot below:

enter image description here

  • If I specify the "User name" and "Password" with TFVS alternate authentication credentials, which is also used to add submodule. Then I'll get a successful "Get sources".
  • If I type the wrong "User name" or "Password", then I'll get a "401" error.

enter image description here

There is no error like "Too many redirects or authentication replays" under my test. You may check my steps to see whether there is something different from yours.

Upvotes: 2

Related Questions