Unable to checkout code from git repository
Asked by Rafal Niedzialkowski:

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)

<br />


Answers:
author: Rafal Niedzialkowski
body: 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


author: francois
body: 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

comments: author: Damian
body: [@francois7](/t5/user/viewprofilepage/user-id/604638)your the best, hours wondering why i get this error and this has fixed it!!!


author: James Dumay
body: 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.

comments: author: Jim Bethancourt
body: 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.


author: Animesh Anand
body: 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


author: Rafal Niedzialkowski
body: 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?

comments: author: Rafal Niedzialkowski
body: 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


Tags: error

git

repository