We have a UDP that executes a script containing a Harvest "hco" command. When running this UDP from Workbench we get an error message:
Execution of process - Test Checkout UDP - has failed.
Please see the output log.
Reason:
E03020516: Execution of server UDP program C:\UDP\example_udp.bat "example-broker" "SampleProject" "Development" "\SampleRepository" "C:\Temp" "harvest.dfo" "C:\Program Files\CA\SCM\log\hco.log" has failed. Exit code: 1.
Workbench's Output Log shows:
---------- Begin <Test Checkout UDP> Process ---------------
I00020133: C:\Windows\system32>hco -b "example-broker" -en "SampleProject" -st "Development" -vp "\SampleRepository" -cp "C:\Temp" -br -replace all -s "*" -op pc -eh "harvest.dfo" -o "C:\Program Files\CA\SCM\log\hco.log" .
E03020516: Execution of server UDP program C:\UDP\example_udp.bat "example-broker" "SampleProject" "Development" "\SampleRepository" "C:\Temp" "harvest.dfo" "C:\Program Files\CA\SCM\log\hco.log" has failed. Exit code: 1.
---------- End <Test Checkout UDP> Process ---------------
However if we run the same hco command from a command prompt window on the broker machine it succeeds.
Harvest Software Change Manager v12.x and higher
We found that the script was failing because Windows was not able to find the Harvest command "hco" as an executable on the server. Notice in the error message that the command is running with the "C:\Windows\system32" folder as the current working directory:
I00020133: C:\Windows\system32>hco -b "example-broker" -en "SampleProject" -st "Development" -vp "\SampleRepository" -cp "C:\Temp" -br -replace all -s "*" -op pc -eh "harvest.dfo" -o "C:\Program Files\CA\SCM\log\hco.log" .
E03020516: Execution of server UDP program C:\UDP\example_udp.bat "example-broker" "SampleProject" "Development" "\SampleRepository" "C:\Temp" "harvest.dfo" "C:\Program Files\CA\SCM\log\hco.log" has failed. Exit code: 1.
In checking the system "PATH" environment variable on the broker machine, we found the following folders were missing:
C:\Program Files\CA\SCM
C:\Program Files\CA\SCM\x86
With those folders missing, the script was not able to locate the "hco.exe" executable in order to execute it.
Adding those two folders to the front of the system PATH environment variable on the broker machine resolved the problem.