5

3

In our build server (ccnet) I'm pulling from multiple repositories in the same time.

Occasionally I'm getting following exception when issuing following command hg pull kiln://path/to-my/repository.

ThoughtWorks.CruiseControl.Core.CruiseControlException: Source control operation failed: Cookie file C:\Users\robot.buildserver\_hgcookies\d41d8cd98f00b204e9800998ecf8427e exists, but could not be opened.
Continuing without cookie authentication.
** unknown exception encountered, please report by visiting
**  http://mercurial.selenic.com/wiki/BugTracker
** Python 2.6.6 (r266:84297, Aug 24 2010, 18:13:38) [MSC v.1500 64 bit (AMD64)]
** Mercurial Distributed SCM (version 1.8.1)
** Extensions loaded: kiln, kilnauth, kilnpath, purge
Traceback (most recent call last):
  File "hg", line 36, in <module>
  File "mercurial\dispatch.pyo", line 16, in run
  File "mercurial\dispatch.pyo", line 36, in dispatch
  File "mercurial\dispatch.pyo", line 58, in _runcatch
  File "mercurial\dispatch.pyo", line 601, in _dispatch
  File "mercurial\dispatch.pyo", line 406, in runcommand
  File "mercurial\dispatch.pyo", line 655, in _runcommand
  File "mercurial\dispatch.pyo", line 609, in checkargs
  File "mercurial\dispatch.pyo", line 598, in <lambda>

  File "mercurial\util.pyo", line 433, in check
  File "mercurial\extensions.pyo", line 133, in wrap
  File "mercurial\util.pyo", line 433, in check
  File "c:\Program Files (x86)\KilnExtensions\kiln.py", line 366, in guess_kilnpath
    return orig(ui, repo, dest, **opts)
  File "mercurial\util.pyo", line 433, in check
  File "mercurial\commands.pyo", line 2940, in pull
  File "mercurial\localrepo.pyo", line 1324, in pull
  File "mercurial\discovery.pyo", line 27, in findcommonincoming
  File "mercurial\wireproto.pyo", line 35, in heads
  File "mercurial\httprepo.pyo", line 137, in _call
  File "mercurial\httprepo.pyo", line 88, in _callstream
  File "c:\Program Files (x86)\KilnExtensions\kilnauth.py", line 172, in open
    cj.save(ignore_discard=True, ignore_expires=True)
  File "_MozillaCookieJar.pyo", line 116, in save
ValueError: a filename was not supplied (nor was the CookieJar instance initialised with one)
. Process command: hg pull kiln://path/to-my/repository
   at ThoughtWorks.CruiseControl.Core.Sourcecontrol.ProcessSourceControl.Execute(ProcessInfo processInfo)
   at ThoughtWorks.CruiseControl.Core.Sourcecontrol.Mercurial.Mercurial.HgPull(IIntegrationResult result)
   at ThoughtWorks.CruiseControl.Core.Sourcecontrol.Mercurial.Mercurial.GetModifications(IIntegrationResult from, IIntegrationResult to)
   at ThoughtWorks.CruiseControl.Core.Sourcecontrol.QuietPeriod.GetModificationsWithLogging(ISourceControl sc, IIntegrationResult from, IIntegrationResult to)
   at ThoughtWorks.CruiseControl.Core.Sourcecontrol.QuietPeriod.GetModifications(ISourceControl sourceControl, IIntegrationResult lastBuild, IIntegrationResult thisBuild)
   at ThoughtWorks.CruiseControl.Core.IntegrationRunner.GetModifications(IIntegrationResult from, IIntegrationResult to)
   at ThoughtWorks.CruiseControl.Core.IntegrationRunner.Integrate(IntegrationRequest request)

The strange thing is that this happens only sometimes. In most other cases the pull operation is processed without error. I'm suspecting some kind of race condition - I'm able to find several instances of this error when time of operation is exactly the same.

More context:

  • Multiple ccnet projects are pulling from the same repository (in the same time)
  • Kiln project is marked as public (so authentication is not used)
  • Kiln Version 2.4.111.0
  • using Mercurial 1.8/Tortoise HG 2 client with kiln, kilnpath and kilnauth extensions from version 2.4.111.0

How to get rid of this error?

Fog Creek Case FC2011631

flag
FYI, we are getting a ton of those errors as well (in a build farm running TeamCity; about 30 build machines pulling from 30+ repositories). So definitely doesn't seem to be CC specific. – Aras Pranckevičius May 4 2011 at 19:17
Is TeamCity running on Windows or on Unix? – Benjamin Pollack May 5 2011 at 20:26
Benjamin we run TeamCity on Linux. – Na'Tosha Bard May 12 2011 at 19:30

2 Answers

2

We're actively working on figuring this one out. We have a repro internally, and should get it fixed for the next Kiln release.

The workaround right now is to disable the kilnauth extension and store login credentials in .hgrc / Mercurial.ini

On the build server, as its user, edit the Mercurial ini files. The latest versions of the Kiln Client Tools extensions are self-updating and have their own ini file, Mercurial-kiln.ini, that gets included in your Mercurial.ini

  1. Edit Mercurial-kiln.ini to remove the auth section and comment out the line for the kilnauth extension using a # character:

    #kilnauth=C:\Users\adam\AppData\Local\KilnExtensions\kilnauth.py

  2. Edit Mercurial.ini to make your auth section look like this:

    [auth]
    kiln.prefix= https://fogbugz.com/
    kiln.username=CI Username
    kiln.password=ci-password
    kiln.schemes=*
    
link|flag
Hey there. Is there any progress on this issue? We just started getting it today, it seems. – Neil Barnwell Aug 17 2011 at 14:31
0

I'm told that this is fixed in v2.5. It happens that we can't upgrade yet but a workaround for earlier versions is to use a newer version of kilnauth.py from the public repository:

https://developers.kilnhg.com/Repo/Kiln/Group/Kiln-Extensions/File/kilnauth.py?rev=f0fe708a7d75

We're successfully using v2.6.8 of kilnauth.py when the rest of the install is v2.4.

link|flag

Your Answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.