I have a git repo that has a single submodule under it, both of which require the same credentials (they're being managed by stash on our in-house server).
Sometimes, and I have yet to determine exactly under what conditions, but it seems to be at least once a day, my build will fail with the following error: "Error while applying patch"
The full error log isn't very exciting, as it always seems to end the same way:
Failed to perform checkout on agent: '"C:\Program Files (x86)\Git\bin\git.exe" -c core.askpass=C:\TeamCity\buildAgent\temp\buildTmp\pass7942880129252967229.bat fetch --progress origin +refs/heads/master:refs/remotes/origin/master' command failed.
stdout: Fetching submodule 0001/Assets/Engine
stderr: remote: Counting objects: 40, done. [K
remote: Compressing objects: 3% (1/26) [K
remote: Compressing objects: 100% (26/26), done. [K
remote: Total 26 (delta 22), reused 0 (delta 0) [K
7ce1444..4b9c249 master -> origin/master
fatal: Authentication failed for 'http://server-pc:7990/scm/NGIN/engine.git/'
The weird thing is tho, that if I just restart the build, it'll work without a problem. And a lot of the time after this, it'll continue to work just fine. But at some undefined point (perhaps after leaving it for a while? I'm not sure what the catalyst is..) it'll fail again with the same error, and simply restarting the build will make it work again.
So now I have all of my build configurations set to retry 3 times, because I get these random failures that are rectified by restarting, but my build history is littered with these build failures that I just can't explain. Any thoughts?