Unable to checkout code from git repository

Rafal Niedzialkowski November 1, 2012

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

0 votes
Answer accepted
Rafal Niedzialkowski November 15, 2012

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

7 votes
francois April 20, 2016

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

Damian September 15, 2020

@francois7your the best, hours wondering why i get this error and this has fixed it!!!

1 vote
James Dumay
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 6, 2012

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.

Jim Bethancourt
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 25, 2016

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.

0 votes
Animesh Anand September 22, 2016

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 

0 votes
Rafal Niedzialkowski November 11, 2012

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?

Rafal Niedzialkowski November 15, 2012

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events