Why won't TeamCity run my Nant build file?

I have a simple NAnt build file that tries to update from subversion in a specified directory. Sample test build file content:

<?xml version="1.0" ?>
<project name="Project_name" default="update">
<property name="root" value="C:\Subversion\UpdateDir" overwrite="false"/>
<property name="build.repos" value="http:/server/svnrepos" overwrite="false"/>
<property name="build.user" value="user" overwrite="false"/>
<property name="build.pwd" value="userpw" overwrite="false"/>
    <target name="update">
        <!-- Update all files to latest (head) revision from the repository -->
        <svn-update destination="${root}" uri="${build.repos}" username="${build.user}" password="${build.pwd}" commandline="-r HEAD -q --no-auth-cache"/>
    </target>
</project>

      

When a build is run in TeamCity (which has been configured to run the test build file), the build fails with error 1 returned from the svn.exe file of the subversion Collabnet client.

It's a shame that the NAnt GUI can run the assembly file without error, so I don't understand why TeamCity is not working as I believe it uses the same subversion client as the NAnt GUI, and the same MS.net skeleton version too.

The error log details are as follows, and the error is related to the NAnt Contrib task "svn-update":

[16:01:56]: svn-update
[16:01:56]: [svn-update] svn: Working copy '.' locked
[16:01:56]: [svn-update] svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details)
[16:01:56]: C:\Subversion\ProjectBuilds\BuildFiles\Update0412.build(9,10): External Program Failed: C:\Program Files\CollabNet Subversion\svn.exe (return code was 1)
[16:01:56]: NAnt output: "C:\Program Files\NAnt-Gui\bin\NAnt.exe" -buildfile:C:\Subversion\ProjectBuilds\BuildFiles\Update0412.build -extension:C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NAntLoggers.dll -listener:JetBrains.BuildServer.NAntLoggers.NAntListener -D:teamcity.buildConfName=0412 -D:DotNetFramework1.1_Path=C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 -D:agent.home.dir=C:\BuildAgent "-D:agent.name=TeamCity Build Agent" -D:build.number=0.0.33 -D:teamcity.dotnet.nunitlauncher2.0=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher2.0.exe -D:teamcity.dotnet.platform=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.TeamCity.PlatformProcessRunner.1.1.exe -D:DotNetFramework1.1= -D:build.number.format=0.0.{0} -D:user.language=en -D:user.country=GB -D:os.version=5.1 -D:user.timezone=Europe/London -D:file.encoding=Cp1252 -D:file.separator=\ -D:agent.work.dir=C:\BuildAgent\work "-D:teamcity.projectName=Project 0412" -D:teamcity.dotnet.nunitlauncher2.0.vsts=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher2.0.VSTS.exe -D:os.arch=x86 -D:DotNetFramework1.1_x86_Path=C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322 -D:DotNetFramework1.1_x86= -D:teamcity.build.tempDir=C:\BuildAgent\temp\buildTmp -D:teamcity.dotnet.coveragelauncher=C:\BuildAgent\plugins\dotnetPlugin\bin\TeamCityRunners\JetBrains.dotTrace.TeamCity.CoverageRunner.exe -D:build.vcs.number=5758 -D:teamcity.dotnet.nunitlauncher=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe -D:build.vcs.number.1=5758 -D:user.name=SYSTEM "-D:os.name=Windows XP" -D:build.vcs.number.0412=5758 "-D:teamcity.version=4.0 (build 8080)" -D:teamcity.dotnet.nunitaddin=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.TeamCity.NUnitAddin-NUnit -D:teamcity.auth.password=YVscypn9BG9okr0ojOES7LgevrD8Wpfp -D:idea.build.agent.port=9092 -D:teamcity.build.checkoutDir=C:\Subversion\ProjectBuilds\0412 -D:teamcity.buildType.id=bt2 -D:teamcity.auth.userId=TeamCityBuildId=36 -D:teamcity.dotnet.nunitlauncher1.1=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher1.1.exe -D:user.variant= -D:teamcity.agent.cpuBenchmark=107 -D:teamcity.dotnet.nunitlauncher.msbuild.task=C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.MSBuildLoggers.dll -D:user.home=C:\ -D:idea.build.server.build.id=36 -D:path.separator=; -D:teamcity.build.workingDir=C:\Subversion\ProjectBuilds -D:teamcity.build.properties.file=C:\BuildAgent\temp\agentTmp\teamcity.build31597.properties update NAnt 0.85 (Build 0.85.2478.0; release; 14/10/2006) Copyright (C) 2001-2006 Gerry Shaw http://nant.sourceforge.net Buildfile: file:///C:/Subversion/ProjectBuilds/BuildFiles/Update0412.build Target framework: Microsoft .NET Framework 1.1 Target(s) specified: update update: [svn-update] svn: Working copy '.' locked [svn-update] svn: run 'svn cleanup' to remove locks (type 'svn help cleanup' for details) BUILD FAILED - 0 non-fatal error(s), 2 warning(s) C:\Subversion\ProjectBuilds\BuildFiles\Update0412.build(9,10): External Program Failed: C:\Program Files\CollabNet Subversion\svn.exe (return code was 1) Total time: 0.4 seconds.
[16:01:56]: Process exit code: 1

      

EDIT: The problem is really with the SVN validation being in state. I fixed this by letting TeamCity do it on its own (and I probably did the cleanup in the meantime as well). It looks like both James Gregory and Ruben Bartellin were right!

+1


source to share


3 answers


TeamCity has its own checkout location in the agent that triggers the build. The error message indicates that the working copy is somehow messed up; this can happen if the build fails and it was in the middle of an update. I suggest trying to make a svn cleanup

specific agent in a working copy.



+4


source


Also, if you go to the project page and select "Enforce Clean Checkout" from the action menu (or force it in the project settings), it might lead you to this (ie force it to get a clean copy compared to the normal [more fast] approach just to get deltas).



You can also blow away the working directory and see if it fixes it.

+1


source


TeamCity supports svn checkout for agent. It can automatically trigger svn update on the build check directory. Please select checkout for agent in build config settings /2.Version Control.

Please take a look at the documentation page at http://www.jetbrains.net/confluence/display/TCD4/Build+Checkout+Directory

+1


source







All Articles