1

When attempting to install an agent using the Agent Push feature I get the following error:

[12:05:15]: AgentPush v32407 - Install Agent on remote host
[12:05:15]: Looking for Target Host...
[12:05:15]: Validating TeamCity Server Root URL 'http://####' ...
[12:05:19]: Starting agent push to '###'(IP: ###) using preset 'Packer Baker' (Username 'administrator'. Target platform: 'Windows')
[12:05:19]: Checking Platform...
[12:05:24]: 'ssw0rd'' is not recognized as an internal or external command,
[12:05:24]: operable program or batch file.
[12:05:24]: Executing command: 'C:\Tomcat\temp\___1655843086080428423\cli-wrapper.exe D:\TMC-Data\system\pluginData\psexec\psexec.exe /accepteula \\### -e -h -u administrator -p ********** cmd.exe /C ver'
[12:05:24]: Remote agent installation failed: Command 'C:\Tomcat\temp\___1655843086080428423\cli-wrapper.exe D:\TMC-Data\system\pluginData\psexec\psexec.exe /accepteula \\### -e -h -u administrator -p ********** cmd.exe /C ver' was executed with error message(s): Execution error. Return code=1

Any ideas what might cause this?

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
Castrohenge
  • 8,525
  • 5
  • 39
  • 66

1 Answers1

1

This was caused by not escaping the ampersand character in the "Credentials to push agent" password.

In the above case I used the password P&ssw0rd. When the command

C:\Tomcat\temp\___1655843086080428423\cli-wrapper.exe D:\TMC-Data\system\pluginData\psexec\psexec.exe /accepteula \\### -e -h -u administrator -p ********** cmd.exe /C ver

is executed & is used to run multiple commands on the same line and requires escaping.

After escaping the & with ^ and changing the password to P^&ssw0rd the agent push ran successfully.

Castrohenge
  • 8,525
  • 5
  • 39
  • 66