3

I'm having issues checking out code on the agent with teamcity 9.1.6. I'm using git and ssh with the ssh key being uploaded into teamcity.

If I checkout on the server, it works. If I checkout on the agent using username/password, it works. But ssh on the agent doesn't and fails with the following:

Failed to perform checkout on agent: '"C:\Program Files\Git\bin\git.exe" fetch --progress origin +refs/heads/master:refs/heads/master' command failed.
stderr: Authentication failed
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Anyone got any ideas?

Thanks.

Andrew Davis
  • 460
  • 3
  • 17
  • I assume the agent is also on a separate machine - Can you see in the logs that the SSH key is being passed to the agent? – Matt Apr 07 '16 at 22:03
  • Maybe your key doesn't have the right permissions, is corrupted, private key isn't being supplied to the agent, etc. The answers to all of these are in the ssh logs on the server. If you don't have access to those and you still want to troubleshoot, you can try logging in to the ssh interface with an actual ssh client that can log the connection (PuTTY if you're in Windows) – LinuxDisciple Apr 07 '16 at 22:03
  • The benefit of using an external ssh client is that you can set the logging level easily. That's probably not so easy on some purpose-built agent that may or may not log anything useful. – LinuxDisciple Apr 07 '16 at 22:06
  • @EvolveSoftwareLtd No the agent is on the same machine, I just need to run the check out on the agent as I need to do stuff with the cloned repo. – Andrew Davis Apr 07 '16 at 22:32
  • @LinuxDisciple The key works if I run the check on the server and not the agent – Andrew Davis Apr 07 '16 at 22:33
  • But is the agent running with the same user? – Thibault D. Apr 08 '16 at 08:29
  • yes @ThibaultD. both agent and server are running under a user account with full admin rights – Andrew Davis Apr 08 '16 at 09:59
  • in 9.1.7 I'm seeing "Failed to perform checkout on agent: TeamCity doesn't support authentication method 'Private Key' with agent checkout. Please use different authentication method." Did you ever figure this out? In my case the agent is also on the same machine. – tofutim Jul 08 '16 at 18:34
  • Unfortunately not. I had to revert to username/password – Andrew Davis Jul 11 '16 at 08:40

0 Answers0