1

I added SVN project as a subrepository to my Mercurial project (following this instructions) and now TeamCity cannot build Mercurial project. I get the following error:

[Updating sources] Failed to build patch for build #???, VCS root: "mercurial: https://myrepo" {instance id=41, parent internal id=22, parent id=mercurial_repo_id, description: "mercurial: https://myrepo"}, due to error: Cannot build patch: ClientAbortException:  java.io.IOException

[Updating sources] Problem while loading patch data stream: Failed to obtain stream from server. Server status: 504 (Gateway Time-out)

Problem while loading patch data stream: Failed to obtain stream from server. Server status: 504 (Gateway Time-out)

java.io.IOException: Failed to obtain stream from server. Server status: 504 (Gateway Time-out)

When I clone the repo locally, all goes fine, but TeamCity doesn't see the subrepo and there is no subrepo in changes graph. I tried to add different build steps, but it didn't help. I also tried to change VCS checkout mode in TeamCity to agent-checkout, but there is another error due to self-signed sertificates:

Failed to perform checkout on agent: 'hg --config ui.interactive=False clone -U --uncompressed https://...' command failed.
stderr: abort: could not find web.cacerts: /etc/ssl/ca-bundle.pem

However, the checkout mode shouldn't be the cause of errors since such issue has been resolved in 8 version of TeamCity (we use 8.0.6).

How should I configure TeamCity to work with SVN subrepo inside Mercurial repo?

Thanks.

UPD:

I finally found the answer: I though needed to fix errors while performing checkout on agent (add a certificate or force it to trust all) and the problem was solved!

Lia
  • 744
  • 1
  • 9
  • 30

1 Answers1

1

I haven't done this with SVN subrepos but I have done this with hg subrepos but the trick is the teamcity server's hgrc file needs to be configured to silently take the SVN repo so you probably need to supply authentication info and perhaps also trust the cert in the hgrc file.

Wyatt Barnett
  • 15,573
  • 3
  • 34
  • 53
  • 1
    The SVN repo is also added to TeamCity, so TeamCity has the auth information. Isn't this enough? If not, where is this file? Unfortunately, I am not good with TeamCity administration. – Lia Jul 21 '15 at 19:24
  • The trick here is TC isn't checking out the SVN repo, the HG client is and it can't access TC. – Wyatt Barnett Jul 21 '15 at 19:28
  • Another approach would be to skip the subrepo and add the SVN repo to the teamcity project directly. This might lose the "fix at a particular revision" feature that hg subs have though. – Wyatt Barnett Jul 21 '15 at 19:28
  • Could you please share your experience and provide a sequence of steps that should be done to make TeamCity detect subrepos? – Lia Jul 21 '15 at 19:28
  • if I won't find a workaround, I'll give up with subrepos, but I hope there is a solution – Lia Jul 21 '15 at 19:32
  • For detecting changes there is a checkbox, at least on 9.0.x. For checking them out the hg client needs to be able to do so when running in the context of teamcity. What exactly that means depends on your environment. – Wyatt Barnett Jul 21 '15 at 19:37