Problems with Bamboo, Git and submodules
Asked by Pablo_Molnar:

Hi,

I setup a checkout task to pull one bitbucket project with submodules in Bamboo. I checked the submodules option but when it start to pull the submodules I get an error of permissin denied.

```
simple	11-Feb-2013 17:44:31	Cleaned source directory '/home/bamboo/bamboo-agent-home/xml-data/build-dir/STAGE-ADMIN-JOB1'...simple	11-Feb-2013 17:44:31	Creating local git repository in '/home/bamboo/bamboo-agent-home/xml-data/build-dir/STAGE-ADMIN-JOB1/.git'.simple	11-Feb-2013 17:44:31	Initialized empty Git repository in /home/bamboo/bamboo-agent-home/xml-data/build-dir/STAGE-ADMIN-JOB1/.git/simple	11-Feb-2013 17:44:31	Fetching 'refs/heads/*' from 'https://bitbucket.org/mashon/dabble-all'.simple	11-Feb-2013 17:44:32	From https://bitbucket.org/mashon/dabble-allsimple	11-Feb-2013 17:44:32	 * [new branch]      master     -&gt; mastersimple	11-Feb-2013 17:44:32	 * [new tag]         TEST.01.RC -&gt; TEST.01.RCsimple	11-Feb-2013 17:44:32	Fetching to source directory '/home/bamboo/bamboo-agent-home/xml-data/build-dir/STAGE-ADMIN-JOB1' completed, proceeding with checkout...simple	11-Feb-2013 17:44:32	Checking out revision 1be548fc20d6e222cab235ee53ca7301b8ac502f.simple	11-Feb-2013 17:44:32	Already on 'master'simple	11-Feb-2013 17:44:33	Submodule 'dabble-admin' (git@bitbucket.org:mashon/dabble-admin.git) registered for path 'dabble-admin'simple	11-Feb-2013 17:44:33	Submodule 'dabble-core' (git@bitbucket.org:mashon/dabble-core.git) registered for path 'dabble-core'simple	11-Feb-2013 17:44:33	Cloning into dabble-admin...simple	11-Feb-2013 17:44:33	Warning: Permanently added 'bitbucket.org,207.223.240.181' (RSA) to the list of known hosts.simple	11-Feb-2013 17:44:33	Permission denied (publickey).simple	11-Feb-2013 17:44:33	fatal: The remote end hung up unexpectedlysimple	11-Feb-2013 17:44:33	Clone of 'git@bitbucket.org:mashon/dabble-admin.git' into submodule path 'dabble-admin' failed
```

Why it has the right permissions to fetch the main project but not the submodules? (All of them are in bitbucket same account)

Full log details:

<https://gist.github.com/pablomolnar/4759525/raw/9e61e8b05adc69612664666299af54578c8e0cbc/gistfile1.txt>

Thanks!


Answers:
author: Przemek Bruski
body: When handling submodules, Git does not ask Bamboo for the private key and just uses whatever is available in \~/bamboo/.ssh/ . Try adding your private key there.

comments: author: James Barwick
body: How do you add files to \~/bamboo/.ssh?

What is the name of the file need to be?

How do you specify this file for the git authentication?

Will this work with bitbucket? (https://or [ssh:// ?](ssh://answers.atlassian.com) which?)

Do you mean to put this on the Elastic EC2 instance, then create a new 'image'?

What if I have a lot of changes in the "Capabilities" for the image? Do I need to redo them all over again?


author: Alexey Shcherbak
body: It doesn't work with https protocols and private bitbucket repositories. Main repository which is being pulled from bitbucket via https: and username\\password is working fine. Submodule which requires same authentication credentials - failing with fatal: Authentication failed for 'https://bitbucket.org/\<teamname\>/logging.git/';Is there any workaround for this bug ?


author: James Barwick
body: How do you add files to \~/bamboo/.ssh?

What is the name of the file need to be?

How do you specify this file for the git authentication?

Will this work with bitbucket?

Do you mean to put this on the Elastic EC2 instance, then create a new 'image'?

What if I have a lot of changes in the "Capabilities" for the image? Do I need to redo them all over again?


Tags: cloud