Monday, June 1, 2009

Team Deploy failure with PSExec

Our automated build recently stopped remotely installing our services from the build server to the system test application server.  It was able to stop and restart the service, and it thought it was installing the services, but the install was not actually running.

Here is a sample of one of our command lines: 

TeamDeploy.exe /CONFIG:EODService.xml

Because the services installed properly when running the MSI from the application server itself, and because TeamDeploy depends on PSTools for remote deployments, I started looking at thePSTools: specifically PSKill and PSExec.

First I verified that pskill was working remotely by opening notepad on the application server and killing it from the build server:

pskill \\applicationServer notepad.exe

 

PsKill v1.03 - local and remote process killer

Copyright (C) 2000 Mark Russinovich

http://www.sysinternals.com

 

Process notepad.exe killed on applicationServer.

 

Next, I tried to verify that psexec was working properly:

 

psexec \\applicationServer "c:\windows\system32\ipconfig.exe"

 

PsExec v1.31 - execute processes remotely

Copyright (C) 2001-2002 Mark Russinovich

www.sysinternals.com

 

Error communicating with PsExec service on applicationServer:

No process is on the other end of the pipe.

 

It returned an error indicating there was no process on the other end of the pipe.  This seemed to indicate a problem with psexesvc.

Since psexesvc installs automatically when running psexec, I removed psexesvc from the application server [1]:

sc \\applicationServer stop psexesvc

SERVICE_NAME: psexesvc

        TYPE               : 10  WIN32_OWN_PROCESS

        STATE              : 3  STOP_PENDING

                                (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN))

        WIN32_EXIT_CODE    : 0  (0x0)

        SERVICE_EXIT_CODE  : 0  (0x0)

        CHECKPOINT         : 0x2

        WAIT_HINT          : 0x0

 

sc \\applicationServer delete psexesvc

[SC] DeleteService SUCCESS

 

After cleaning up the psexesvc, I verified that psexec was working properly:

 

psexec \\applicationServer ipconfig

 

PsExec v1.31 - execute processes remotely

Copyright (C) 2001-2002 Mark Russinovich

www.sysinternals.com

 

 

 

Windows IP Configuration

 

 

Ethernet adapter Local Area Connection:

 

   Connection-specific DNS Suffix  . :

   Link-local IPv6 Address . . . . . : fe80::b5eb:e3

   IPv4 Address. . . . . . . . . . . : 10.2.15.171

   Subnet Mask . . . . . . . . . . . : 255.255.254.0

   Default Gateway . . . . . . . . . : 10.2.15.251

 

Tunnel adapter Local Area Connection* 8:

 

   Media State . . . . . . . . . . . : Media disconn

   Connection-specific DNS Suffix  . :

 

Tunnel adapter Local Area Connection* 9:

 

   Media State . . . . . . . . . . . : Media disconn

   Connection-specific DNS Suffix  . :

ipconfig exited on applicationServer with error code 0.

 

The final test of course was to run TeamDeploy.exe /CONFIG:EODService.xml from the build server, and it successfully installed our service remotely.  Our build is back in business!

 

 

[1]  http://forum.sysinternals.com/forum_posts.asp?TID=3935&PN=1&TPN=2#32755

No comments: