I've moved a Git repository from a shared folder on the network to a SSH server running gitolite. I've added a public/private key for TeamCity to use and pointed the VCS root at it. This all works OK as Test Connection is successful and my build configuration shows the pending changes.
However, when TeamCity attempts to fetch those pending changes I get the following error:
'git fetch' command failed.
exception: Timeout exception
Switching to verbose logging I see that it timed out after 90 seconds - I would expect under normal circumstances that it would be a matter of a couple of seconds to fetch these changes.
Since I started trying to troubleshoot the problem I have changed my VCS root to "Default Private Key" and added the required .ssh folder with config, id_rsa and known_hosts files. I saw the fingerprint and then password messages in the log until I put the necessary stuff in these files, and now my server is back to giving the Timeout exception again just as it does when I specify the key in the VCS root.
If I run Git from the command line I am able to clone the repository without any prompts (when I have the .ssh folder set up as above). This is from a different user account as TC is running as a service under the default SYSTEM account, but I don't think that's the cause because as I said I can see that TC has picked up the changes to the .ssh folder for that account.
What could be wrong?
You have setup the keys for the TeamCity server, but have you done it for the agent as well? That would explain why in the configuration the test connection works, but it doesn't work when the agent is executing.
Quick way to debug the issue:
In the VCS settings, change VCS Checkout mode
to Automatically on server
and see if it works?
Update:
Can you login to the TeamCity server and run a manula git clone
from your git repo as teamcity
user? This way you can see it working and also save as trusted hosts etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With