Reputation: 347
I want to pull the latest changes from the remote and I have a step
git fetch origin +refs/changes/*:refs/remotes/origin/changes/*
configured as a command line by calling git from C:\Program Files (x86)\Git\cmd\Git
However, when teamcity runs the command, it just waits and waits and waits..
Starting: C:\Windows\system32\cmd.exe /s /c ""c:\Program Files (x86)\Git\cmd\git" fetch origin"
[11:54:31]in directory: C:\BuildAgent\work\99b8cd174ffcc354
[11:55:04]Process exited with code 1
The exit code 1 at 11:55 is me stopping the build as it took more than a minute to run the fetch command. I have waited even longer.
Any help is appreciated.
Upvotes: 3
Views: 1856
Reputation: 11
run exact the same cmd in your build agent the problem is probably missing the remote host in the known_hosts file
Upvotes: 0
Reputation: 14262
Pavel commented:
To debug issues like this you should login to the agent machine and execute exactly the same command under the user who started agent process. Most likely it will hang too.
We were using git push in one of our build steps and it was hanging on the build server. What you might find is that you need to tell git that origin remote is trusted and that it should always be trusted. It comes up in the console when you first try to connect to a remote host that is not trusted.
Once you have done this once on one build agent you should be able to copy the known_hosts file from the build agents git folder between all the build agents.
Upvotes: 2