2

I am getting this error message running a batch job with TeamCity. The batchjob is copying files from TeamCity Server to another server(server2). Have checked multiple times, the folders have all the rights permissions needed and this works fine (copies files between servers) when the batch job is run manually from command prompt. I have this error for each file that needs to be copied.

error MSB3021: Unable to copy file "..\bin\Release\Boo.Lang.Compiler.dll" to "\Server2\DestinationFolder\". Could not find a part of the path '\Server2\DestinationFolder'.[10:54:32]: Creating directory "\Server2\DestinationFolder".

I tried few things, but issue remains unresolved. Thanks for your input.

ZVenue
  • 4,967
  • 16
  • 61
  • 92

1 Answers1

4

TeamCity build Agent is running as System user account that has no access to the network resources, you should change the service user to an account that has network permissions, like your Administrator account.

See also the related question.

Community
  • 1
  • 1
CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • How do I change that now for an agent.. once its already been created. Is there an Edit Agent Configuration section anywhere in teamcity – ZVenue Sep 21 '11 at 19:11
  • I was able to change the agent log in settings going to Services and right clicking on the team agent name. After this change, TeamCity shows me that the build ran successfully and I can see in the build log it says that the files are copied from one location to the other, but I dont see the files in the destination folder. I tried this using UNC path and also just server name. – ZVenue Sep 21 '11 at 19:36
  • Should I change the TeamCity Server service user account setting also from System to Administrator account? Changing the agents settings did not make a difference. – ZVenue Sep 21 '11 at 19:56
  • Make sure you are using the valid UNC path with double backslashes, you don't need to change the TeamCity service account settings as the job is performed by the agent. Google for possible issues when using UNC paths from a service (could be permissions issue, for instance). Another option to verify that it works is to stop the Agent service and run build agent from your user session using the .bat file. – CrazyCoder Sep 22 '11 at 00:43
  • Changed the path to absolute path in the batchscript.. this worked. – ZVenue Sep 22 '11 at 13:55