# Problem building repository with subrepositories

**URL:** https://www.finalbuilder.com/forums/t/problem-building-repository-with-subrepositories/5767
**Category:** Bugs
**Created:** [December 20, 2012, 11:27am UTC](https://www.finalbuilder.com/forums/t/problem-building-repository-with-subrepositories/5767 "2012-12-20T11:27:46Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![diegogarcia](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/diegogarcia/32/105_2.png) [@diegogarcia](https://www.finalbuilder.com/forums/u/diegogarcia)
#### Post date: [December 20, 2012, 11:27am UTC](https://www.finalbuilder.com/forums/t/problem-building-repository-with-subrepositories/5767/1 "2012-12-20T11:27:46Z")

</div>

Hi guys I've noted that using mercurial repository with subrepository on it gives me an error if I do the follow steps:

1- Make a change in my code, not the subrepository.

2- Push it to the base repository.

3- Try to Build it.

Unexpected error reported from server: Unable to queue a build because Respository : Project is in an error state

The follow error is reported:

Cannot get new changesets for&nbsp;[ERx](http://localhost:8080/view/2002/a7882681-9cd0-44e5-8fab-f551d8d297a0): Running C:\Program Files\TortoiseHg\hg.exe failed with return code -1 and error output abort: error: getaddrinfo failed  
(Args were : pull -f -u -R C:\Temp\ContinuaCI\Rc\a7882681 https://dmgarcia:pass@hqsoftwares.codebasehq.com/project/project.hg --config ui.username=Continua)

But if after that I enter in continua repository settings, edit, validate, save it and build it again the build runs fine..

Regards,

Diego Garcia

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [December 20, 2012, 11:31am UTC](https://www.finalbuilder.com/forums/t/problem-building-repository-with-subrepositories/5767/2 "2012-12-20T11:31:12Z")

</div>

Do you have a proxy you access the net through? If so then this might help :   
  
 [http://www.markhneedham.com/blog/2009/05/13/mercurial-pulling-from-behind-a-proxy/](http://www.markhneedham.com/blog/2009/05/13/mercurial-pulling-from-behind-a-proxy/)

---

<div class="post-metadata">

### Author: ![diegogarcia](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/diegogarcia/32/105_2.png) [@diegogarcia](https://www.finalbuilder.com/forums/u/diegogarcia)
#### Post date: [December 20, 2012, 12:18pm UTC](https://www.finalbuilder.com/forums/t/problem-building-repository-with-subrepositories/5767/3 "2012-12-20T12:18:12Z")

</div>

Hi Vincent,

I dont think its related to proxy as I dont have one in my company ....

It seens to be something related to the continua not finding the changeset of the subrepository or mixing the changeset from main repository with the subrepository.

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [December 20, 2012, 10:21am UTC](https://www.finalbuilder.com/forums/t/problem-building-repository-with-subrepositories/5767/4 "2012-12-20T10:21:51Z")

</div>

Ah I missed the subrepository bit. I don’t believe we have done anything with subrepositories, so they may not be supported at the moment. Is the path to your subrepo relative to your main repo is it an absolute path. I’ve had had a quick look, they should work, however subrepos with absolute paths probably won’t. We’ll do some testing in this area, we may need to makes some changes, especially with regards to populating the workspace from the repositories.

---

<div class="post-metadata">

### Author: ![diegogarcia](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/diegogarcia/32/105_2.png) [@diegogarcia](https://www.finalbuilder.com/forums/u/diegogarcia)
#### Post date: [December 20, 2012, 10:58am UTC](https://www.finalbuilder.com/forums/t/problem-building-repository-with-subrepositories/5767/5 "2012-12-20T10:58:57Z")

</div>

Yep its relative, here is my .hgsub content Libs = [https://hqsoftwares.codebasehq.com/framework/framework.hg](https://hqsoftwares.codebasehq.com/framework/framework.hg)   
  
 Its very strange because the first time I run the build went fine, after it finish it sucessfully I try to build it again without change anything and that error happen … maybe something is not cleaned up ? or after it build the .hgsubstate has been changed and next build it breaks …   
  
 I think that its something related to this …

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [December 20, 2012, 10:59am UTC](https://www.finalbuilder.com/forums/t/problem-building-repository-with-subrepositories/5767/6 "2012-12-20T10:59:28Z")

</div>

This looks like a candidate for the cause :   
  
 [http://stackoverflow.com/questions/5177054/mercurial-workflow-with-subrepositories-and-offline-clones](http://stackoverflow.com/questions/5177054/mercurial-workflow-with-subrepositories-and-offline-clones)

---

<div class="post-metadata">

### Author: ![Sparky](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/sparky/32/10_2.png) [@Sparky](https://www.finalbuilder.com/forums/u/Sparky)
#### Post date: [December 21, 2012, 6:54am UTC](https://www.finalbuilder.com/forums/t/problem-building-repository-with-subrepositories/5767/7 "2012-12-21T06:54:28Z")

</div>

Hi Diego,&nbsp;  
  
I set up a mercurial repository and subrepository on codebasehq and did some testing today, but could not get this to fail.&nbsp;

Check the full error details by opening&nbsp;a command prompt and running&nbsp;

hg pull -v --debug -f -u -R C:\Temp\ContinuaCI\Rc\a7882681 [https://dmgarcia:pass@hqsoftwares.codebasehq.com/project/project.hg](https://dmgarcia:pass@hqsoftwares.codebasehq.com/project/project.hg) --config ui.username=Continua  
  
Also check that the .hg/hgrc file in both the repository and sub repository folders under C:\Temp\ContinuaCI\Rc\a7882681 have the correct server paths e.g.&nbsp;  
  
[paths]  
default = [https://dmgarcia@hqsoftwares.codebasehq.com/project/project.hg](https://dmgarcia@hqsoftwares.codebasehq.com/project/project.hg)  
  

Can you also ensure that you have the latest version of Tortoise / Mercurial installed?

---

<div class="post-metadata">

### Author: ![diegogarcia](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/diegogarcia/32/105_2.png) [@diegogarcia](https://www.finalbuilder.com/forums/u/diegogarcia)
#### Post date: [December 21, 2012, 5:08am UTC](https://www.finalbuilder.com/forums/t/problem-building-repository-with-subrepositories/5767/8 "2012-12-21T05:08:09Z")

</div>

Hi Dave,   
  
 I’ve runned the command in prompt and no error was found, here is the log:   
  
 Microsoft Windows [versão 6.1.7601]   
 Copyright © 2009 Microsoft Corporation. Todos os direitos reservados.   
  
 C:\Windows\system32\>hg pull -v --debug -f -u -R C:\Temp\ContinuaCI\Rc\a7882681 h   
 ttps://dmgarcia:@\*_**@hqsoftwares.codebasehq.com/project/project.hg --config ui.user   
 name=Continua   
 using [https://hqsoftwares.codebasehq.com/project/project.hg](https://hqsoftwares.codebasehq.com/project/project.hg)   
 http auth: user dmgarcia, password \*\*\*\*\*\*\*\*\*   
 sending capabilities command   
 [hqsoftwares.codebasehq.com](http://hqsoftwares.codebasehq.com) certificate successfully verified   
 http auth: user dmgarcia, password \*\*\*\*\*\*\*\*\*   
 [hqsoftwares.codebasehq.com](http://hqsoftwares.codebasehq.com) certificate successfully verified   
 pulling from [https://dmgarcia](https://dmgarcia):**_@hqsoftwares.codebasehq.com/project/project.hg   
 sending heads command   
 http auth: user dmgarcia, password \*\*\*\*\*\*\*\*\*   
 [hqsoftwares.codebasehq.com](http://hqsoftwares.codebasehq.com) certificate successfully verified   
 searching for changes   
 no changes found   
 checking for updated bookmarks   
  
 C:\Windows\system32\>   
  
 So after that I’ve looked for the paths and its fine, take a look on it:   
  
 path for main project:   
 [paths]   
 default = [https://dmgarcia@hqsoftwares.codebasehq.com/project/project.hg](https://dmgarcia@hqsoftwares.codebasehq.com/project/project.hg)   
  
 path for libs project   
 [paths]   
 default = [https://hqsoftwares.codebasehq.com/framework/framework.hg](https://hqsoftwares.codebasehq.com/framework/framework.hg)   
  
 The most strange is that in the first time continua do it fine … just the second one that it do the problem.   
  
 Maybe the log of the error should be more detailed so we can analise it…   
  
 I will try to update my tortoise and mercurial to see if it is something related to this, but I dont think it is.   
  
 Regards,   
 Diego Garcia.

---

<div class="post-metadata">

### Author: ![diegogarcia](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/diegogarcia/32/105_2.png) [@diegogarcia](https://www.finalbuilder.com/forums/u/diegogarcia)
#### Post date: [January 1, 2013, 4:31am UTC](https://www.finalbuilder.com/forums/t/problem-building-repository-with-subrepositories/5767/9 "2013-01-01T04:31:59Z")

</div>

I found that the problem was really happening um hg update that wasnt passing the user and password to the command, so I’ve config my global hg file to pass it and everything works fine.   
  
 I think you guys could look at the code and fixit to pass the user and password when performing an update with subrepositories

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [January 1, 2013, 4:45am UTC](https://www.finalbuilder.com/forums/t/problem-building-repository-with-subrepositories/5767/10 "2013-01-01T04:45:57Z")

</div>

Thanks for the info, we’ll look into it. I believe we only call update on a local copy of a hg repo and don’t pass the credentials, but I suspect they may be required for subrepos.

---

<div class="post-metadata">

### Author: ![diegogarcia](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/diegogarcia/32/105_2.png) [@diegogarcia](https://www.finalbuilder.com/forums/u/diegogarcia)
#### Post date: [January 1, 2013, 4:50am UTC](https://www.finalbuilder.com/forums/t/problem-building-repository-with-subrepositories/5767/11 "2013-01-01T04:50:33Z")

</div>

Yep I think you are right !

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [January 1, 2013, 7:25am UTC](https://www.finalbuilder.com/forums/t/problem-building-repository-with-subrepositories/5767/12 "2013-01-01T07:25:17Z")

</div>

Hi Diego   
  
 It looks like we were calling hg update when it was no longer needed (due to recent changes). We also were not specifying --subrepos on the archive command so the subrepos were not getting exported on the agents properly. Hopefully we’ll have a new build ready tomorrow.

---

<div class="post-metadata">

### Author: ![diegogarcia](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/diegogarcia/32/105_2.png) [@diegogarcia](https://www.finalbuilder.com/forums/u/diegogarcia)
#### Post date: [January 1, 2013, 12:08pm UTC](https://www.finalbuilder.com/forums/t/problem-building-repository-with-subrepositories/5767/13 "2013-01-01T12:08:17Z")

</div>

Nice news will be waiting for test it again !

---

<div class="post-metadata">

### Author: ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)
#### Post date: [January 2, 2013, 7:55am UTC](https://www.finalbuilder.com/forums/t/problem-building-repository-with-subrepositories/5767/14 "2013-01-02T07:55:14Z")

</div>

Build 1281 is available now with the fix for this issue. Note that only subrepos that use the same credentials as the main repo will work at this time. Handling individual credentials for subrepos is difficult, not something we want to be looking at this close to release.

---

<div class="post-metadata">

### Author: ![diegogarcia](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/diegogarcia/32/105_2.png) [@diegogarcia](https://www.finalbuilder.com/forums/u/diegogarcia)
#### Post date: [January 4, 2013, 8:10am UTC](https://www.finalbuilder.com/forums/t/problem-building-repository-with-subrepositories/5767/15 "2013-01-04T08:10:01Z")

</div>

Just came back to the office, thats nice Vincent thanks.   
  
 I dont think this will be a problem now because every external repository (that is not ours) has the login and pass setup inside the .hgsub file so this doesnt seens to be a problem.
