Does agent Path environmental variable use only user-specific setting?

This is a question for TeamCity developers:

In TC web GUI, select Agents->Connected Agents. Click on one of the available agents and then "Environmental variables" tab. Find "Path" variable in "Additional variables defined by the operating system and agent runtime" section. The value of the variable is whatever is set for the user's environmental variable Path (this can be found in My Computer->Properties->Advanced->Environment Variables on Windows XP, "user variables for myusername" section). Is this by design or is it a bug?

If I open a command window and type "path", the result is system+user path values, which is what I would expect in TC.

The context that this presents a problem for me is an external software package, which, after installation, added the necessary path to the system Path variable only. Consequently, it did not get picked up by TC agent and caused issues in the build when the build runner could not find that package. My solution was to copy the path to the package to the user environment variable that runs TeamCity, but this is not ideal since I would have to update every agent with this setting.

Thanks,
Oleg.

4 comments

Oleg,

This appears to be a bug in the Java Service Wrapper that we use to launch the agent as a service.

It it fixed in the latest version of the tool and you can upgrade it yourself, if you like (note that they use GPLv2 licensing now):
from the download page: http://wrapper.tanukisoftware.org/doc/english/download.jsp
- download the Windows 32 executable: http://wrapper.tanukisoftware.org/download/3.3.1/wrapper-windows-x86-32-3.3.1.zip
- get wrapper-windows-x86-32-3.3.1\bin\wrapper.exe file and rename/overwrite it into \launcher\bin\TeamCityAgentService-windows-x86-32.exe - copy/overwrite wrapper-windows-x86-32-3.3.1\lib\wrapper.jar into \launcher\lib\wrapper.jar - rename/overwrite wrapper-windows-x86-32-3.3.1\lib\wrapper.dll into \launcher\lib\wrapper-windows-x86-32.dll If this approach works you can force automatic agent's upgrading by carefully patching the agent distribution found in \webapps\ROOT\update\buildAgent.zip with the above instructions and then modifying a file in ]]>\webapps\tc\update\plugins directory, by adding a directory in one of the archives there (make sure you do not add any files in the root of archives or this will fail agents' upgrading process).

--
Best regards,

Yegor Yarko
Project Manager
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Yegor,

Thanks very much for this solution. I will try it out. Will a future version of TeamCity include the corrected version of the wrapper? Let me know if you want me to file a bug report in the issue tracker.

Regards,
Oleg.

0

Oleg,

I've created the issue to upgrade to newer version: http://jetbrains.net/tracker/issue/TW-5645

We are planing the upgrade, but with moderate priority for now.

--
Best regards,

Yegor Yarko
Project Manager
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Excellent, thank you!

Also, I forgot to mention that I encountered the issue on Windows XP Professional x64 SP2. I don't know if 32-bit Windows would have the same issue, but it probably would.

Cheers,
Oleg

0

Please sign in to leave a comment.