Using git with an SSH private key for authentication fails on one specific agent. This seems to coinside with an upgrade of the Bamboo server from 4.2 to 5.1.1 It works on all other agents. I can checkout on the offending agent with the key from the console. It seems to have something to do with the SSH proxy that is used by Bamboo to protect the repository key. The agent is running Ubuntu 12.
The error "Private key cannot be read" is confusing because of the proxy. What key? Where is it looking for it? Is the error on the server or on the agent? And since this works for all other agents, It would seem to rule out the repository key, and the Bamboo server.
imple 11-Oct-2013 09:49:57 Cleaned source directory '/home/build/bamboo-agent-home/xml-data/build-dir/TJM-LTST-FW'...
simple 11-Oct-2013 09:49:57 Creating local git repository in '/home/build/bamboo-agent-home/xml-data/build-dir/TJM-LTST-FW/.git'.
simple 11-Oct-2013 09:49:57 /usr/bin/git init
simple 11-Oct-2013 09:49:57 Initialized empty Git repository in /home/build/bamboo-agent-home/xml-data/build-dir/TJM-LTST-FW/.git/
error 11-Oct-2013 09:49:57 Cannot fetch branch '(unresolved) master' from 'ssh://user@server/project/repo.git' to source directory '/home/build/bamboo-agent-home/xml-data/build-dir/TJM-LTST-FW'. Cannot decode connection params
simple 11-Oct-2013 09:49:57 Updating source code to revision: 2dddbe824e96e5a5cbe9149472b1d1f91e5cc2dc
simple 11-Oct-2013 09:49:57 /usr/bin/git log -1 --encoding=UTF-8 --format=%H HEAD
error 11-Oct-2013 09:49:57 Cannot fetch branch '(unresolved) master' from 'ssh://user@server/project/repo.git' to source directory '/home/build/bamboo-agent-home/xml-data/build-dir/TJM-LTST-FW'. Cannot decode connection params
simple 11-Oct-2013 09:49:57 Warning: failed to checkout source code to directory '/home/build/bamboo-agent-home/xml-data/build-dir/TJM-LTST-FW', trying to recover...
simple 11-Oct-2013 09:49:57 Cleaned source directory '/home/build/bamboo-agent-home/xml-data/build-dir/TJM-LTST-FW'...
simple 11-Oct-2013 09:49:57 Creating local git repository in '/home/build/bamboo-agent-home/xml-data/build-dir/TJM-LTST-FW/.git'.
simple 11-Oct-2013 09:49:57 /usr/bin/git init
simple 11-Oct-2013 09:49:57 Initialized empty Git repository in /home/build/bamboo-agent-home/xml-data/build-dir/TJM-LTST-FW/.git/
error 11-Oct-2013 09:49:57 Cannot fetch branch '(unresolved) master' from 'ssh://user@server/project/repo.git' to source directory '/home/build/bamboo-agent-home/xml-data/build-dir/TJM-LTST-FW'. Cannot decode connection params
error 11-Oct-2013 09:49:57 Error occurred while running Task 'Checkout Default Repository(1)' of type com.atlassian.bamboo.plugins.vcs:task.vcs.checkout.
error 11-Oct-2013 09:49:57 java.lang.RuntimeException: com.atlassian.bamboo.repository.RepositoryException: Cannot fetch branch '(unresolved) master' from 'ssh://user@server/project/repo.git' to source directory '/home/build/bamboo-agent-home/xml-data/build-dir/TJM-LTST-FW'. Cannot decode connection params
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:132)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.executor.RetryingTaskExecutor.runTask(RetryingTaskExecutor.java:88)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:191)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.executor.RetryingTaskExecutor.retry(RetryingTaskExecutor.java:176)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.execute(VcsCheckoutTask.java:170)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:220)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.task.TaskExecutorImpl.executePreparationTasks(TaskExecutorImpl.java:73)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.build.pipeline.tasks.PrepareBuildTask.call(PrepareBuildTask.java:74)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:189)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:102)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:108)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:55)
error 11-Oct-2013 09:49:57 at java.lang.Thread.run(Thread.java:662)
error 11-Oct-2013 09:49:57 Caused by: com.atlassian.bamboo.repository.RepositoryException: Cannot fetch branch '(unresolved) master' from 'ssh://user@server/project/repo.git' to source directory '/home/build/bamboo-agent-home/xml-data/build-dir/TJM-LTST-FW'. Cannot decode connection params
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.fetch(NativeGitOperationHelper.java:389)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.plugins.git.GitRepository.retrieveSourceCode(GitRepository.java:361)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.plugins.git.GitRepository.retrieveSourceCode(GitRepository.java:293)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.fillWorkingDirFromVcs(VcsCheckoutTask.java:248)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask.access$100(VcsCheckoutTask.java:54)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask$2.call(VcsCheckoutTask.java:175)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.plugins.vcs.task.VcsCheckoutTask$2.call(VcsCheckoutTask.java:171)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.executor.RetryingTaskExecutor.rerun(RetryingTaskExecutor.java:108)
error 11-Oct-2013 09:49:57 ... 12 more
error 11-Oct-2013 09:49:57 Caused by: com.atlassian.bamboo.repository.RepositoryException: Cannot decode connection params
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.adjustRepositoryAccess(NativeGitOperationHelper.java:201)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.fetch(NativeGitOperationHelper.java:353)
error 11-Oct-2013 09:49:57 ... 19 more
error 11-Oct-2013 09:49:57 Caused by: java.io.IOException: Couldn't register Bouncy Castle as a JCE provider. Private key cannot be read
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.plugins.ssh.ProxyConnectionDataBuilderImpl.withKeyFromReader(ProxyConnectionDataBuilderImpl.java:90)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.plugins.ssh.ProxyConnectionDataBuilderImpl.withKeyFromString(ProxyConnectionDataBuilderImpl.java:67)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.plugins.ssh.ProxyConnectionDataBuilderImpl.withKeyFromString(ProxyConnectionDataBuilderImpl.java:23)
error 11-Oct-2013 09:49:57 at com.atlassian.bamboo.plugins.git.NativeGitOperationHelper.adjustRepositoryAccess(NativeGitOperationHelper.java:178)
error 11-Oct-2013 09:49:57 ... 20 more
error 11-Oct-2013 09:49:57 Failed to prepare the build 'TJM-test - LEADTEST - Framework #33 (TJM-LTST-FW-33)'