krosenvold/bgit

Fail to checkout when using bamboo remote agent

kesor opened this issue · 4 comments

I created a project that will run on a remote agent (the local server does not support the build process). And when I started running the first build git cloned and started working on the remote agent server.

But trying to build the project a second time fails with a strange error message saying:
"Unable to detect changes"

The more verbose error contains this:

com.atlassian.bamboo.repository.RepositoryException: retrieveSourceCode
    at com.atlassian.labs.bamboo.git.GitRepository.retrieveSourceCode(GitRepository.java:155)
    at com.atlassian.bamboo.v2.build.task.CheckoutUpdateForBuild.call(CheckoutUpdateForBuild.java:100)
    at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:188)
    at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:90)
    at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:101)
    at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$1.run(NamedThreadFactory.java:33)
    at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: 020001: File or path does not exist.  { filename=[checkout] }
    at edu.nyu.cs.javagit.utilities.CheckUtilities.checkFileValidity(CheckUtilities.java:53)
    at edu.nyu.cs.javagit.client.cli.CliGitSubmodule.init(CliGitSubmodule.java:20)
    at com.atlassian.labs.bamboo.git.GitRepository.submodule_update(GitRepository.java:352)
    at com.atlassian.labs.bamboo.git.GitRepository.reallyCloneOrFetch(GitRepository.java:418)
    at com.atlassian.labs.bamboo.git.GitRepository.cloneOrFetch(GitRepository.java:388)
    at com.atlassian.labs.bamboo.git.GitRepository.retrieveSourceCode(GitRepository.java:151)
    ... 6 more

Using bamboo 2.5.3 / git 1.6.3.3 / bgit 1.2.2 snapshot from master branch (dae90b3)

Completely forgot to check the logs on the agent, and this piece of information in there helped me to resolve the problem:

INFO   | jvm 1    | 2010/04/26 18:37:34 | --------  fatal: Could not switch to 'gitserver/git/repo'

I configured the repository as "gitserver/git/repo" instead of "ssh://gitserver/git/repo.git" - for some reason the initial clone did work, but subsequential updates did not. So it is not related to agents, just general git url syntax.

Again I was wrong. The final problem was that I had ssh keys setup properly on the agent, but not on the bamboo server. So fetching from git on the bamboo server failed while it worked on the agent. This caused all kinds of problems.

I've had variations of this issue reported earlier and I'll see if I can do anything sensible to give feedback.

Updated readme for 1.2.2 for now