Matt Roberts
Matt Roberts

Reputation: 26917

TeamCity Agent has "lost" its environment path

I've been happily working with a TeamCity Build server for a while now, but all of a sudden things went wrong...

It seems the build agent no longer has anything in it's path. So, for example, if my build script (I use NANT) calls xcopy to copy files, this has suddenly started failing because xcopy can not be found - so the build will fail unless I change it to c:\windows\system32\xcopy.

I can manually browse to the build agent folder and run the nant script from there, and it all works (because the path is set correctly).

I've not upgraded TeamCity, so I'm baffled as to why this could have borked. I don't override anything in the environment parameters of the builds in TeamCity. I've not changed anything in the build settings either. The only thing I've done to this PC that contains the build agent is to install the RC of Visual Studio 2012.

Any ideas?

EDIT

Further investigation - I've found the agent settings in TeamCity - in there the environment variable called "path" is just set to C:\Program Files (x86)\Nmap (Recently installed). This is odd and quite possibly the cause of the issue. I just need to work out how to make TeamCity revert to the "real" path.

Upvotes: 2

Views: 1958

Answers (1)

Matt Roberts
Matt Roberts

Reputation: 26917

Figured it out - this may well be useful to someone else...

When I installed Nmap recently, it added a new "User Variable" for my account, which it called "path" and set to C:\Program Files (x86)\Nmap. This overrides the "System Variable" called path, and was causing all the havoc. Removed the user variable, and all working.

enter image description here

Upvotes: 3

Related Questions