Agent VCS checkout empty!

Hey all,

I'm having a very odd problem setting up a new build server with TeamCity 8.1.3 (build 30101).  I have used TeamCity before, but not since v6, so I'm catching up to a lot of the new details.

Primary Problem:

When I run my build, the server takes a good 3-4 minutes "Updating Sources", but then the build on the agent fails because the agent work directory is empty (which I have verified by inspecting the agent filesystem directly).  The builds fail with the following build log:

[16:18:17]TeamCity server version is 8.1.3 (build 30101)
[16:18:16]Checking for changes
[16:18:16]Will collect changes in 1 VCS roots
[16:18:16]Loading current repository state for VCS root 'github-zzz'
[16:18:19]Waiting for completion of current operations for the VCS root 'github-zzz'
[16:18:19]Detecting changes in VCS root 'github-zzz' (used in Demo Simulator Package, Master Build, and 3 other configurations)
[16:18:19]Agent time zone: America/Los_Angeles
[16:18:20]Agent is running under JRE: 1.6.0_65-b14-466.1-11M4716
[16:18:20]Publishing internal artifacts
[16:18:20]Clearing temporary directory: /Volumes/HD2/TeamCity/buildAgent/temp/buildTmp
[16:18:20]Checkout directory: /Volumes/HD2/TeamCity/buildAgent/work/39f95ab8aed62f3e
[16:18:20]Updating sources: server side checkout
[16:18:20]##teamcity[buildStatisticValue key='buildStageDuration:sourcesUpdate' value='311.0']
[16:18:20]Step 1/3: Run Tests
[16:18:20][Step 1/3] Step 1/1: Run Automated Tests (Command Line)
[16:18:20][Step 1/1] ##teamcity[buildStatisticValue key='buildStageDuration:firstStepPreparation' value='87.0']
[16:18:20][Step 1/1] ##teamcity[buildStatisticValue key='buildStageDuration:buildStep_RunTests_0' value='0.0']
[16:18:20][Step 1/1] Starting: /Volumes/HD2/TeamCity/buildAgent/temp/agentTmp/custom_script349313267385893822
[16:18:20][Step 1/1] in directory: /Volumes/HD2/TeamCity/buildAgent/work/39f95ab8aed62f3e
[16:18:20][Step 1/1] /usr/local/bin/xctool -scheme AppTests clean test
[16:18:20][Step 1/1] ERROR: Unable to find projects (.xcodeproj) in directory /Volumes/HD2/TeamCity/buildAgent/work/39f95ab8aed62f3e. Please specify with -workspace, -project, or -find-target.
[16:18:20][Step 1/1]
[16:18:20][Step 1/1]
[16:18:20][Step 1/1] Process exited with code 1
[16:18:20][Step 1/1] ##teamcity[buildStatisticValue key='buildStageDuration:buildStep_RunTests_0' value='354.0']
[16:18:20][Step 1/1] Step Run Automated Tests (Command Line) failed
[16:18:20]Step 2/3: Build Archive/IPA
[16:18:20]##teamcity[buildStatisticValue key='buildStageDuration:buildFinishing' value='10.0']
[16:18:20]Publishing internal artifacts
[16:18:20]Publishing artifacts
[16:18:20]##teamcity[buildStatisticValue key='buildStageDuration:artifactsPublishing' value='71.0']
[16:18:20]Build finished


Other issues:

  • When I run a build manually, and attempt to specify the "Build branch:" under the Changes tab, "master" is not listed!



CONFIGURATION

In this project, I'm trying to use a single VCS Root, and different build configurations use checkout rules to be more precise about what they want.  Any advice to make sure I've set this up correctly is welcome.

The project is for an iOS application, but all the build details are being handled by scripts (not using the XCode builder).


VCS Root Configuration:




  • Type: Git
  • URL: ssh://git@github.com/xxx/yyy.git (private repo)
  • Default branch: refs/heads/master
  • Branch spec:
    • +:refs/heads/master
    • +:refs/heads/production
    • +:refs/(pull/4*)/head
    • +:refs/(pull/5*)/head
    • +:refs/heads/(release/*)
    • +:refs/heads/(hotfix/*)
  • Authentication: Default Private Key (verified to work)


Master Build:

  • VCS Checkout Mode: Automatically on server
    • This build config originally used "Automatically on agent" while I was experimenting
  • Checkout directory: Auto
  • Checkout Rules:
    • +:refs/heads/master
  • VCS Trigger
    • No trigger rules or branch filter


Pull Request Build:

  • VCS Checkout Mode: Automatically on server
  • Checkout directory: Auto
  • Checkout Rules:
    • +:refs/pull/*/head
    • -:refs/heads/master
  • Branch remote run trigger: refs/pull/*/head



Many thanks in advance!

3 comments
Comment actions Permalink

I have discovered that if I remove the VCS Checkout Rule from the build, it works correctly.

I have tried all the below VCS Checkout Rules, and they all produce the same failure case documented above:

  • +:refs/heads/master
  • +:refs/heads/master=>.
  • +:refs/heads/master=>refs/heads/master
  • +:refs/heads/master=>./refs/heads/master
  • +:refs/heads/master=>master


All of these result in an empty work directory on the agent.

0
Comment actions Permalink

Hi Justin,

checkout rules map files, not branches. You get an empty checkout directory on an agent because there are no paths like refs/heads/master in your repository. You can find more information about checkout rules in the documentation (http://confluence.jetbrains.com/display/TCD8/VCS+Checkout+Rules).

0
Comment actions Permalink

Ahh thank you!  I assumed that since TC is using a bare git clone that information would be available in the checkout rules too.  Darn!

0

Please sign in to leave a comment.