Bamboo remote agent can't execute GIT repo operations with error: RPC failed; result=22, HTTP code = 422

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible



The build is failing when using a remote agent with the error : "error: RPC failed; result=22, HTTP code = 422", check the below stack trace from <bamboo-agent-home>atlassian-bamboo.log file. 

Caused by: com.atlassian.bamboo.repository.RepositoryException: Cannot fetch branch 'refs/heads/master' from '<repo-URL>' to source directory '<Bamboo-agent-home>/xml-data/build-dir/_git-repositories-cache/c164771460882b932d7f304d1811d5673bfc8ee0'. command [/usr/bin/git -c 'credential.helper=store --file=/tmp/gitCredentials5755204464707531159.tmp' fetch <repo-URL> +refs/heads/master:refs/heads/master --update-head-ok] failed with code 128. Working directory was [<Bamboo-agent-home>/xml-data/build-dir/_git-repositories-cache/c164771460882b932d7f304d1811d5673bfc8ee0]., stderr:
 error: RPC failed; result=22, HTTP code = 422
 fatal: The remote end hung up unexpectedly
 at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.fetch(
 at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.fetch(
 at com.atlassian.bamboo.plugins.git.v2.AbstractGitExecutor.fetchCacheWithRetry(
 at com.atlassian.bamboo.plugins.git.v2.GitWorkingCopyManager.lambda$checkout$1(
 at io.atlassian.util.concurrent.ManagedLocks$ManagedLockImpl.withLock(
 at com.atlassian.bamboo.plugins.git.GitCacheDirectory$LoggingManagedLock.withLock(
 at com.atlassian.bamboo.plugins.git.v2.GitWorkingCopyManager.checkout(
 at com.atlassian.bamboo.plugins.git.v2.GitWorkingCopyManager.retrieveSourceCode(
 at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.fillWorkingDirFromVcs(
 at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.access$000(
 at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask$
 at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask$
 at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(
 ... 20 more
 Caused by: com.atlassian.bamboo.plugins.git.GitCommandException: command [/usr/bin/git -c 'credential.helper=store --file=/tmp/gitCredentials5755204464707531159.tmp' fetch <repo-URL> +refs/heads/master:refs/heads/master --update-head-ok] failed with code 128. Working directory was [<Bamboo-agent-home>/xml-data/build-dir/_git-repositories-cache/c164771460882b932d7f304d1811d5673bfc8ee0]., stderr: 


Bamboo 8.0.9 with remote agent and GIT 1.8 but the solution listed below will be applicable for all supported Bamboo version


Build execution is successful on the local agent

The repository is accessible and you are able to clone the repository manually on the remote agent

Compared the git version between the local agent and remote agent


Git version 1.8 is used on the remote agent


Upgrade git to a supported version on the remote agent, refer supported platform for more details regarding right version to use. 

Last modified on Apr 3, 2023

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.