Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TeamCity agent error "failed to perform checkout on agent"

I am running my TeamCity 7 server and agent on MacOS. My repo is on github. I use ssh and I know that the authentication is correctly configured, because the test is successful.

The build works fine when I use VCS Checkout Mode "Automatically on server", however when I use VCS Checkout mode "Automatically on agent" I get this error.

[13:40:35][Updating sources] Failed to perform checkout on agent: '/usr/bin/git fetch --progress origin +refs/heads/master:refs/remotes/origin/master' command failed.
stderr: java.io.IOException: Authentication failed
    at org.jetbrains.git4idea.ssh.SSHMain.authenticate(SSHMain.java:275)
    at org.jetbrains.git4idea.ssh.SSHMain.start(SSHMain.java:159)
    at org.jetbrains.git4idea.ssh.SSHMain.main(SSHMain.java:139)
fatal: The remote end hung up unexpectedly

What am I missing?

like image 560
mishod Avatar asked May 31 '12 20:05

mishod


People also ask

How do I enable my TeamCity agent?

Agents can be manually enabled/disabled via the web UI by clicking the status icon (1) next to the agent's name. Optionally, you can tell TeamCity to automatically disable/enable the agent after a period of time and enter your comment. TeamCity will follow the instructions and show the comment icon (2).

How do I restart my TeamCity agent?

You can restart TeamCity right from the UI: Administration > Diagnostics > Server Restart .

What is checkout directory in TeamCity?

The build checkout directory is a directory on the TeamCity agent machine where all the sources of all builds are checked out into. If you use the agent-side checkout mode, the build agent checks out the sources into this directory before the build.


2 Answers

Try adding teamcity.git.use.native.ssh=true as a config parameter into your build configuration.

It is what helped me solve a similar problem. I learned this trick from here.

like image 102
max Avatar answered Sep 20 '22 01:09

max


What was not at all obvious to me is that the Default Private Key on the server is copied to the agent and used there. I tried first in vain to add the private key to the user the agent was running as (obviously on the agent machine). But then I added the private key to the user that was running TeamCity on the server machine, and then the Agent Side checkout started working.

I also used the teamcity.git.use.native.ssh=true property, but I don't think it helped with this particular problem.

The only trace of this information was in this comment.

like image 41
vidstige Avatar answered Sep 21 '22 01:09

vidstige