Mercurial issues

I'm brand new to Team City. I'm trying it out because of the new Mercurial support. I believe I installed the plugin correctly (mercurial.zip went into Documents and Settings\Administrator\plugins and mercurial-agent.zip went into c:\TeamCity\Webapps\ROOT\update\plugins), but I keep getting the following error any time I try to check out from a mercurial repository:

Failed for the root 'Project' #1: 'hg tip' command failed. exception: Cannot start process, the working directory C:\Documents and Settings\Administrator\.BuildServer\system\caches\hg_8316476762429141010 does not exist

Any reason why this might be happening?

9 comments

What's the content of the directory on your server: C:\Documents and Settings\Administrator\.BuildServer\system\caches\hg_8316476762429141010 ?

--
Pavel Sher

0

The directory doesn't exist. The caches directory only has clearCase and sources directories. I didn't want to create the directory because it seems like that directory missing is probably a symptom of a larger issue?

0

This directory should be created by the hg clone command before tip command executed. The fact that this directory does not exist most likely means that clone command failed and this failure was not properly reported in the log.

Do you use some public Mercurial repository? Is it possible to obtain access to this repository to reproduce the bug?

--
Pavel Sher

0

Unfortunately, no the repository is not public.

A straight hg clone works (using hg from the command line) but why is it trying to clone into that directory in the first place? I've set the VCS checkout mode to "Automatically on server" and set a checkout directory for a separate root directory on my box. Shouldn't it clone there?

The only factor I can think of that might cause the problem (save me installing the plugin incorrectly) is that I'm serving the hg repository through http, using the cgi script provided by Mercurial.

0

Currently plugin always clones repository to its own place, however in the future an additional setting can be provided to use repository from the provided directory.

Checkout directory is for agents, it will be created on the PC where agent is installed. Specifying of checkout directory is necessary only if your build can be built in some specific folder, if your build isn't tied to a folder this setting is not necessary.

I'll try to add more debug logging to the commands issued by TeamCity.

--
Pavel Sher

0

I've added more debug logging, could you please download and install new version of plugin from here:
http://teamcity.jetbrains.com/viewLog.html?buildId=13403&buildTypeId=bt121&tab=artifacts

Also please modify file teamcity-server-log4j.xml from the TeamCity/conf directory and enable debugging for category jetbrains.buildServer.VCS:
add line ]]> in this category.

--
Pavel Sher

Edited by: Pavel Sher (Jetbrains) on Aug 22, 2008 8:25 PM

0

Here's the new debug output:

DEBUG - jetbrains.buildServer.VCS - Run command: hg clone --pull -U ]]> hg_8316476762429141010
WARN - jetbrains.buildServer.VCS - Error output produced by: hg clone --pull -U ]]> hg_8316476762429141010
WARN - jetbrains.buildServer.VCS - transaction abort!
rollback completed
abort: The system cannot find the path specified: C:\Documents and Settings\Administrator\.BuildServer\system\caches\hg_8316476762429141010\.hg\store\data/_aleph_generator/_tests/bin/_debug/_generator_tests/_languages/_expected_x_m_l/_writers/_all_features_user_p_ks/_sub_object_with_self_reference_event.xml.i

DEBUG - jetbrains.buildServer.VCS - requesting all changes
adding changesets
adding manifests
adding file changes

DEBUG - jetbrains.buildServer.VCS - Run command: hg tip
WARN - jetbrains.buildServer.VCS - 'hg tip' command failed.
exception: Cannot start process, the working directory C:\Documents and Settings\Administrator\.BuildServer\system\caches\hg_8316476762429141010 does not exist
DEBUG - jetbrains.buildServer.VCS - VCS connection problem in build configuration Aleph Metrics :: External Libraries: Failed for the root 'Aleph Stable' #1: 'hg tip' command failed.
exception: Cannot start process, the working directory C:\Documents and Settings\Administrator\.BuildServer\system\caches\hg_8316476762429141010 does not exist
jetbrains.buildServer.vcs.VcsException: 'hg tip' command failed.
exception: Cannot start process, the working directory C:\Documents and Settings\Administrator\.BuildServer\system\caches\hg_8316476762429141010 does not exist
at jetbrains.buildServer.buildTriggers.vcs.mercurial.command.CommandUtil.commandFailed(CommandUtil.java:46)
at jetbrains.buildServer.buildTriggers.vcs.mercurial.command.CommandUtil.checkCommandFailed(CommandUtil.java:29)
at jetbrains.buildServer.buildTriggers.vcs.mercurial.command.CommandUtil.runCommand(CommandUtil.java:53)
at jetbrains.buildServer.buildTriggers.vcs.mercurial.command.TipCommand.execute(TipCommand.java:43)
at jetbrains.buildServer.buildTriggers.vcs.mercurial.MercurialVcsSupport.getCurrentVersion(MercurialVcsSupport.java:214)
at jetbrains.buildServer.buildTriggers.vcs.VcsChangesLoader.updateCurrentVersion(VcsChangesLoader.java:23)
at jetbrains.buildServer.buildTriggers.vcs.VcsChangesLoader.loadChanges(VcsChangesLoader.java:161)
at jetbrains.buildServer.vcs.impl.VcsManagerImpl.loadChanges(VcsManagerImpl.java:143)
at jetbrains.buildServer.vcs.impl.VcsManagerImpl.loadChanges(VcsManagerImpl.java:700)
at jetbrains.buildServer.serverSide.impl.auth.SecuredVcsManager.loadChanges(SecuredVcsManager.java:40)
at jetbrains.buildServer.vcs.impl.VcsChangesCollectorImpl$3.call(VcsChangesCollectorImpl.java:1)
at jetbrains.buildServer.vcs.impl.VcsChangesCollectorImpl$3.call(VcsChangesCollectorImpl.java)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)

I checked and this is actually a problem with Mercurial (sort-of). I can't actually clone into the directory hg_8316476762429141010 manually either, I think because we're either hitting the limit of the python string, or we're hitting the Windows directory nesting limit. Trying to pull into a directory called just "hg" in that directory does work though, so I think we're hitting some internal limit on strings in python. I'll report it to the mercurial team.

In the mean time, is there any way that directory name could be shortened, or is that name chosen independently of the mercurial VCS plugin?

0

You can move your .BuildServer folder to another directory:
http://www.jetbrains.net/confluence/display/TCD3/TeamCityDataDirectory , hope this helps

I'll be on vacation for two weeks since next week and will not be able to answer your questions, please post any issues related to Mercurial plugin to our tracker: http://jetbrains.net/tracker

--
Pavel Sher

0

Alright. Thanks!

I'm going to report the issue to the tracker, even though it's technically not your fault. After further research, I've found that the 260 character limitation is a combined problem between windows and python. Windows, by default, only supports 260 characters for filenames, but there's a unicode extension API which supports up to 32k. The problem is that python's not using it, so neither is mercurial.

In the mean time, I'll move the team city data directory and see if that helps.

Thanks again!

0

Please sign in to leave a comment.