Unable to checkout code from git repository

We recently switched to using git from subversion. Trying to reconfigure our build server to check out code from the git repo, and we're unable to do so. I can see the requests coming in on the git server (gitolite) :

2012-11-01.18:40:20 build 172.18.100.177 git-upload-pack 'portal-package.git'

2012-11-01.18:40:21 build 172.18.100.177 git-upload-pack 'portal-package.git'

The 'Build Result Summary' even lists the revisions (which match whats in the repo ), but the Bamboo server fails the job w/ the following exception:

com.atlassian.bamboo.repository.RepositoryDefinitionException: Task failed since repository with id 294914 does not exist. It may have been deleted, please update the task and pick a new repository

at com.atlassian.bamboo.repository.RepositoryFunctions$IdSelectorToRepositoryDefinition.apply(RepositoryFunctions.java:87)

at com.atlassian.bamboo.repository.RepositoryFunctions$IdSelectorToRepositoryDefinition.apply(RepositoryFunctions.java:51)

at com.atlassian.bamboo.task.repository.RepositoryTaskHelper.getRepositoryDefinitionByIdSelector(RepositoryTaskHelper.java:129)

at com.atlassian.bamboo.v2.build.task.CheckoutDirectoriesSnapshotHelper.<init>(CheckoutDirectoriesSnapshotHelper.java:103)

at com.atlassian.bamboo.v2.build.task.InitializeBuild.prepareCheckoutDirectories(InitializeBuild.java:102)

at com.atlassian.bamboo.v2.build.task.InitializeBuild.doCall(InitializeBuild.java:84)

at com.atlassian.bamboo.v2.build.task.InitializeBuild.call(InitializeBuild.java:51)

at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:206)

at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:103)

at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:111)

at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:52)

at java.lang.Thread.run(Thread.java:662)

5 answers

1 accepted

Problem turned out to be a documentation issue, the docs state you can use the pattern user@yourgitserver.com:repo.git This is not correct, and will result in weird errors, the : is only valid for hosts. You need to use a different git URL, like git@yourserver.com/repo.git

I had this issue when I changed my plan repository (github) to a linked repository.

It was solved by going back to the "Checkout Source Code" step and just saving it again. For some reason it linked to my old plan repository.

 

HTH

Rafal, looks like when you reconfigured your Plan to use Git instead of Subversion the Jobs 'Checkout source task' was not updated and is still refering to the old Subversion repository (thats now deleted).

To fix, for each job in your plan go to the 'Checkout source task' in the Task list and ensure you are checking out the Git repository defined in your Plan.

My case:

1) The repository definition had been deleted

2) I re-created the repository definition and specified the repository in the plan.  Ran the build, but got errors (several times)

3) Checked the job - the plan's repository was listed in the Source Code Checkout task.  I saved the task and the plan ran successfully.

So I'll buy that as a possibility, however I wiped my bamboo install and started clean. There are no Subversion repos defined, only git ones. And I've had no luck with it. If I have one 'default' repository it will get checked out ok, however if I have a 2nd one in the same build plan it will fail to check it out w/ the following error in the log:

com.atlassian.bamboo.repository.RepositoryDefinitionException: Task failed since repository with id 1376259 does not exist. It may have been deleted, please update the task and pick a new repository
	at com.atlassian.bamboo.repository.RepositoryFunctions$IdSelectorToRepositoryDefinition.apply(RepositoryFunctions.java:87)
	at com.atlassian.bamboo.repository.RepositoryFunctions$IdSelectorToRepositoryDefinition.apply(RepositoryFunctions.java:51)
	at com.atlassian.bamboo.task.repository.RepositoryTaskHelper.getRepositoryDefinitionByIdSelector(RepositoryTaskHelper.java:129)
	at com.atlassian.bamboo.v2.build.task.CheckoutDirectoriesSnapshotHelper.<init>(CheckoutDirectoriesSnapshotHelper.java:103)
	at com.atlassian.bamboo.v2.build.task.InitializeBuild.prepareCheckoutDirectories(InitializeBuild.java:102)
	at com.atlassian.bamboo.v2.build.task.InitializeBuild.doCall(InitializeBuild.java:84)
	at com.atlassian.bamboo.v2.build.task.InitializeBuild.call(InitializeBuild.java:51)
	at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:206)
	at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:103)
	at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:111)
	at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:52)
	at java.lang.Thread.run(Thread.java:662)

However if I create a 'fake' build configuration and set it up w/ the repository thats failing above, and it will check the source out correctly.

This is pretty frustrating right now, I've been trying to get the git integration working for a week.

Thoughts?

Problem turned out to be a documentation issue, the docs state you can use the pattern user@yourgitserver.com:repo.git This is not correct, and will result in weird errors, the : is only valid for hosts. You need to use a different git URL, like git@yourserver.com/repo.git

I too had same issue, tried recreating the linked repo, job etc but did not help. Went back to checkout source code task and saved it again, everything started working 

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Renan Battaglin
Published May 18, 2017 in Bamboo

FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,493 views 0 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you