Frequent errors running TFS-2013 with git

We have TFS-2013 configured to use a git repository. All works fine most of the time but we are getting intermittent build errors – they even seem to become more frequent over time.

This is what we can find in the build logs when the problem occurs:

  • Undoing latest push to remote branch
  • git 8728 fork: child -1 - died waiting for longjmp before initial
  • Gitlab workflow and configuration for users
  • Why ApplicationInsights.config file was ignored automatically from being added to Github Repository
  • Git pulls files in .gitignore
  • What does the '^{}' at the end of a git tag mean?
  • Exception Message: An error was raised by libgit2. Category = Os

    Could not remove directory. File
    cannot be removed: The process cannot access the file because it is
    being used by another process.

    (type LibGit2SharpException)

    Exception Data Dictionary:

    libgit2.code = -1

    libgit2.category = 1

    What could cause these errors..?

  • How to fix permission denied for .git/ directory when performing git push?
  • Git Variables in Jenkins Workflow plugin
  • Open Ruby on Rails project from another computer
  • How to use Github with Xcode4's version control
  • How can I have my three website variants (with their deployment directories) as branches in one repository instead of three different ones?
  • Not able to access git repo from jenkins
  • 2 Solutions collect form web for “Frequent errors running TFS-2013 with git”

    This seems to be a bug in progress, as seen by this thread:

    Can you repaire your VS2013 RTM and try again? Also, you can can see event viewer to see if there any useful info or have a try on other machines as I mentioned above.

    I noticed that when the issue happens, Process Explorer shows the open file handles from TFSBuildServiceHost. Restarting the service appears to be a workaround.

    We never had this issue before we introduced several builds for different branches within one repository. Then one day the build failed with exception:

    Exception Message: Attempted to access an unloaded AppDomain. (type AppDomainUnloadedException)
    Exception Stack Trace: 
    Server stack trace: 
    at LibGit2Sharp.Core.NativeMethods.git_clone(RepositorySafeHandle& repo, String origin_url, FilePath workdir_path, GitCloneOptions& opts)
    at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts)
    at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options)
    at Microsoft.TeamFoundation.Build.Activities.Git.GitPull.GitClone.GetRepository(String repositoryUrl, String workingFolder, Boolean checkoutSubmodules)
    at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
    at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

    After this the issue started appearing from time to time until I restarted TfsBuildServiceHost. TFS 2013 U4.

    Git Baby is a git and github fan, let's start git clone.