Error while checkout on Agent, Mac OS X
Mac OS X: 10.10.3
Git version: git version 2.3.2 (Apple Git-55)
Xcode: 6.3.2 (previous 6.1.1)
Teamcity Server version: 9.0.3
Agent Mac OS X: BUILD_32334
We recently upgraded a Mac OS X Yosemite machine that runs an agent for iOS builds.
As soon as we upgraded builds started failing with the following error(s):
WARN - ch.UpdateSourcesBuildStageBase - Error while checkout on agent: '/usr/bin/git fetch --progress origin +refs/heads/develop:refs/remotes/origin/develop' command failed.
stderr: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
jetbrains.buildServer.vcs.VcsException: '/usr/bin/git fetch --progress origin +refs/heads/develop:refs/remotes/origin/develop' command failed.
stderr: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
at jetbrains.buildServer.buildTriggers.vcs.git.agent.command.impl.CommandUtil.commandFailed(CommandUtil.java:61)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.command.impl.CommandUtil.checkCommandFailed(CommandUtil.java:38)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.command.impl.CommandUtil.runCommand(CommandUtil.java:106)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.GitCommandLine.run(GitCommandLine.java:91)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.command.impl.FetchCommandImpl.call(FetchCommandImpl.java:103)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.UpdaterImpl.fetch(UpdaterImpl.java:509)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.UpdaterImpl.fetchDefaultBranch(UpdaterImpl.java:465)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.UpdaterImpl.fetchFromOriginalRepository(UpdaterImpl.java:453)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.UpdaterImpl.ensureCommitLoaded(UpdaterImpl.java:444)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.UpdaterImpl.doFetch(UpdaterImpl.java:439)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.UpdaterImpl.doUpdate(UpdaterImpl.java:109)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.UpdaterImpl.update(UpdaterImpl.java:102)
at jetbrains.buildServer.buildTriggers.vcs.git.agent.GitAgentVcsSupport.updateSources(GitAgentVcsSupport.java:91)
at jetbrains.buildServer.agent.impl.patch.ProjectSourcesOnAgent$1.run(ProjectSourcesOnAgent.java:252)
We've confirmed that the user/key works with github by doing the following:
ssh -v -T git@github.com
You've successfully authenticated, but GitHub does not provide shell access.
-and by manually recreating the steps the agent is failing on-
git init
git remote add origin git@github.com:(A PRIVATE REPO)/iOS.git
git show-ref
git show-ref refs/remote/origin/develop
git log -n1 --pretty=format:%H%x20%s daa8b866846271414bdd58deac703b872216824d --
git fetch --progress origin +refs/heads/develop:refs/remotes/origin/develop
And the above steps do not fail ^^^
We've changed nothing else, we've rebooted, triple checked our key/account for github and run countless builds all of them are failing with:
Screencap1
https://www.dropbox.com/s/pv52kgz949qk1cq/Screenshot%202015-05-27%2015.31.46.png?dl=0
Screencap2
https://www.dropbox.com/s/k996957uk0ramai/Screenshot%202015-05-27%2015.32.24.png?dl=0
Anyone know why this is happening?
Please sign in to leave a comment.
btw- we've noticed the root user will fail with the exact same error that is displayed on all the failed builds. It's as if the build is trying to run as root, when it should be running as a specified user.
Turns out in this case, despite being able to clone the repo manually, the issue with TC server/agent was that there was a passphrase on the key. We removed it and magically all was OK, even though the previous config was working great WITH a passphrase stored in KeyChain Access. Oh well...
Consider this resolved ;)