Unable to do checkout on agent using Git

 I have Git LFS files I'm trying to checkout on the agent (not the default agent, but one I added on a separate server).  My understanding is that this is supported with the latest versions of TeamCity.  But no matter what I do, I keep getting "Failed to perform checkout on agent: Unable to run git at path ....[path to Git.exe]", and in the logs and console I see this:  "Caused by: java.io.IOException: Cannot run program "[Correct path to Git]" (in directory "."): CreateProcess error=5, Access is denied."

This problem occurs on every type of agent side Git checkout regardless of whether they are Git-LFS or not, but server side works OK for all but Git LFS.

It actually also doesn't work on the TeamCity server with the default agent if I specify "always use Agent checkout" either.

I am using a domain service account which has Admin permissions on the agent server.  This same account is being used to run TeamCity server and agents.

I have checked and the URL and credentials work for the repo.

I have checked using that service account and it is able to use Git Bash to clone the repository on both TeamCity Server and on Agent Server after providing the same credentials for VCS as are configured in the Team City build.

I have expanded the permissions on the Git and the Git LFS directories so that Everyone can read and execute these.

I have made sure to run the Agent using the Console and not as a Service.

I have set it up so that java.exe, git.exe, etc. run "As Administrator" by default.

Still no luck.  It's clearly a permissions problem, but heck if I know how to fix it.  Can you help?

0
3 comments

It is strange that git works when you run it manually, but doesn't work if the Agent under the same windows account runs it. Please provide the logs from the agent machine.

0
Avatar
Permanently deleted user

Actually I figured it out since posting this.  Some tools apparently infer the .git suffix for the fetch url and others do not.  Adding the .git at the end solved the problem.  It does not always appear to be necessary, depending on the tool....

0
Avatar
Permanently deleted user

Hi @Dpmartin990, I am also facing same issue like above. Could you please let me know how you resolved it? Can you share me your settings?

0

Please sign in to leave a comment.