krosenvold/bgit

Plugin does not seem to work on remote agents

Closed this issue · 13 comments

It appears the collectChangesSinceLastBuild task is performed on the main Bamboo server, and not on the agent where the code was checked out last. It fails with the following exception:

2010-01-15 13:39:38,230 INFO [BAM::Events:pool-1-thread-3] [DefaultErrorHandler] Recording error: Unable to detect changes : N6REC-CI
com.atlassian.bamboo.repository.RepositoryException: collectChangesSinceLastBuild
    at com.atlassian.labs.bamboo.git.GitRepository.collectChangesSinceLastBuild(GitRepository.java:108)
    at com.atlassian.bamboo.v2.trigger.DefaultChangeDetectionManager.collectChangesSinceLastBuild(DefaultChangeDetectionManager.java:91)
    at com.atlassian.bamboo.v2.trigger.ChangeDetectionListenerAction.process(ChangeDetectionListenerAction.java:65)
    at com.atlassian.bamboo.build.DefaultBuildExecutionManager.tryToDetectAndBuild(DefaultBuildExecutionManager.java:99)
    at com.atlassian.bamboo.v2.trigger.ChangeDetectionListener.handleEvent(ChangeDetectionListener.java:41)
    at com.atlassian.bamboo.event.BambooEventManager$2.run(BambooEventManager.java:47)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:651)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:676)
    at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$1.run(NamedThreadFactory.java:33)
    at java.lang.Thread.run(Thread.java:595)
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:292)
    at com.atlassian.labs.bamboo.git.GitRepository.cloneOrFetch(GitRepository.java:340)
    at com.atlassian.labs.bamboo.git.GitRepository.collectChangesSinceLastBuild(GitRepository.java:96)
    ... 9 more

This is how bamboo works, all vcs access is done from Main console. Make sure you're using v 1.5 or 1.8, since 1.6 and 1.7 Are basically deprecated

Also try to force a clean build from the console, it looks like your checkout is inconsistent

I'm using plugin version 1.8 and just created a new project for testing. The initial build is successful, but after that both attempting to trigger a manual build and the periodic SCM checks throw the same exception. The checkout directory it looks for does not exist on the main Bamboo machine -- only in the bamboo-agent-home/xml-data/build-dir/JOB directory on the Bamboo remote agent.

Having Force Clean Builds on or off does not affect this.

Hmm. Looks like you'll have to debug this one. I believe bamboo checks out on your main machine and serializes a full image to the agent. If yoo open bgit in your ide you can just attach to the bamboo process. If i'm not totally wrong the agent doesnt need to have git installed.

I can debug when this when i get time; i will have to set up my environment with agents. If you're in a rush you should do it yourself

Actually, no. The build directory is empty on the master Bamboo server, both for Git and Subversion jobs. Take a look at http://confluence.atlassian.com/display/BAMBOO/Bamboo's+Build+Process where you see that change detection is performed on the server, but Repository#retrieveSourceCode is performed on the agent.

Cool. That must've changed somewhere along the line. The directory stuff is also anazingly different on the different os'es. Which Os Are you on?

Solaris actually. I'm in the process of importing the bgit project to read through the code.

Have you checked that you can actually do a git clone from the appropriate repo on the command line on the agent ?

You /may/ want to try out the current HEAD, since I made some changes to the general checkout algorithm. Atlassian has given a 2 week ETA on my open source license

I have now tested 1.2-SNAPSHOT with my new open source bamboo license. It works fine with agents on linux.

There 1.2-SNAPSHOT has some bug-fixes related to older git versions that may have been the cause of your problems. Please make sure that you're able to clone from the command line on the remote machine, and if problems persist also check the log-file of the remote agent.

Wow, those two weeks went fast! Atlassian must live on a different time axis than the rest of us..

This issue got slightly obstructed by the fact that the Git repository lives on a shared NFS volume that the main Bamboo server was unable to access... :-| It is actually working fine now.

But I'll try 1.2-SNAPSHOT to see whether that changes anything.

Thanks for your help and follow-ups :)

Closing