Error while applying patch: Failed to create directory: TeamCity\buildAgent\work\*\<default>

I'm really pretty sure this is a bug...

I have only lightly been using TeamCity, but am trying to get all our builds working on it now, and am having an issue when working with Mercurial and different builds.

TeamCity Professional 9.0.2 (build 32195)

There are two projects configured.
Both are using Mercurial as VCS.
They both contain a 'dev' branch and a 'default' branch.
I can get both projects to run PERFECTLY when on the DEV branch.

Bug:
Configure the VCS item with a checkout rule, and the checkout rule includes "teamcity.build.branch".
When the Agent runs a build on the DEFAULT branch, durring the "Updating sources: server side checkout...." process, it appears that "<default>" is passed in as a folder name. This obviously is not a valid path name, and so fails with the error below.

To configure:
In the project go to:
Build Configuration Settings > Version Control Settings > (Specific VCS item) > Edit Checkout Rules:
Then as a rule, add:
+:.=>%teamcity.build.branch%\Source\IBE_Core

Below are three log examples. The first works perfectly. The second are two other projects that fail with the same issue.

Updating sources: server side checkout....
[19:02:39][Updating sources] Removing C:\TeamCity\buildAgent\work\8688ad51b085c5c7
[19:02:50][Updating sources] Updating C:\TeamCity\buildAgent\work\8688ad51b085c5c7\dev\Source\IBE_Core
[19:02:53][Updating sources] Updating C:\TeamCity\buildAgent\work\8688ad51b085c5c7\dev\Source\IBE_Handlers
[19:02:57][Updating sources] Updating C:\TeamCity\buildAgent\work\8688ad51b085c5c7\dev\Source\IBE_SqlDeveloper

Updating sources: server side checkout....
[19:02:11][Updating sources] Removing C:\TeamCity\buildAgent\work\eea4a81f719b5729
[19:02:11][Updating sources] Updating C:\TeamCity\buildAgent\work\eea4a81f719b5729\<default>\Source\IBE_Core
[19:02:11][Updating sources] Error while applying patch: Failed to create directory: C:\TeamCity\buildAgent\work\eea4a81f719b5729\<default>

Updating sources: server side checkout....
[19:31:37][Updating sources] Removing C:\TeamCity\buildAgent\work\a57c62dd20bbb13f
[19:31:37][Updating sources] Updating C:\TeamCity\buildAgent\work\a57c62dd20bbb13f\<default>\Source\IBE_Designer
[19:31:37][Updating sources] Error while applying patch: Failed to create directory: C:\TeamCity\buildAgent\work\a57c62dd20bbb13f\<default>

2 comments
Comment actions Permalink

Hi Greg,

This is by design. We don't know actual value of this parameter for default branch until we collect changes in build.

0
Comment actions Permalink

The log snippet I sent is from when the folder structure in the Agent is being created. At that point the branch is known, otherwise the folder with a branch name couldn't be created.
If the system is trying to create a folder with the name "<default>", its obviously going to fail, and that I think is my problem. Theres a logic issue in the code where my branch named 'default' conficts with '<default>' which means take the default branch.

0

Please sign in to leave a comment.