« Previous Next »

Thread: AppCMD "ERROR ( message:The WAS service is not available - try starting the service first.)"

Last post 04-02-2008 4:49 PM by mcdonaldnoland. 7 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (8 items)

Sort Posts:

  • 03-31-2008, 10:26 AM

    AppCMD "ERROR ( message:The WAS service is not available - try starting the service first.)"

    We just got a new Windows 2008 Server setup and are installing our ASP.NET application running under IIS 7.0.

    The install seems to work fine including our calls using AppCMD to change default settings. E.g. "AppCmd.exe set apppool /apppool.name:MyAppPool /processModel.identityType:NetworkService /enable32BitAppOnWin64:true /recycling.periodicRestart.time:00:00:00 /processModel.idleTimeout:00:00:00"

    However, we have some code at the end of our install script (a Power Shell script) that simply makes sure the AppPool and Site are started.

    AppCmd.exe start apppool /apppool.name:MyAppPool

    Trying to start the apppool gives us the error "ERROR ( message:The WAS service is not available - try starting the service first. )"

    We can start the apppool from the Server Manager UI just fine. I've also checked and the WAS service (i.e. Windows Process Activation Service) is running.

    We see a similar error when trying to start the site.

    AppCmd.exe start site /site.name:MySite

    This gives us the error "ERROR ( message:The W3SVC service is not available - try starting the service first. )"

    As with the pool, we can start the site from the Server Manager UI just fine. I've also checked and the W3SVC service (i.e. World Wide Web Publishing Service) is running.

    Also, when we list out the apppools or site, the state is Uknown. We're thinking this is also related.

    APPPOOL "DefaultAppPool" (MgdVersion:v2.0,MgdMode:Integrated,state:Unknown)

    APPPOOL "Classic .NET AppPool" (MgdVersion:v2.0,MgdMode:Classic,state:Unknown)

    APPPOOL "MyAppPool" (MgdVersion:v2.0,MgdMode:Integrated,state:Unknown)

    Any ideas why we are getting this behavior using AppCMD but not from the Server Manager UI?

  • 03-31-2008, 3:54 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: AppCMD "ERROR ( message:The WAS service is not available - try starting the service first.)"

    Have you made sure that WAS and w3svc are actually running - from an elevated command prompt, type "sc query was" and "sc query w3svc".  The UI task is not equivalent to the appcmd code - the UI task changes both the autoStart value and the current state of the site/app-pool, it probably just skips the second part if was/w3svc is not already started.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 04-01-2008, 9:22 AM In reply to

    Re: AppCMD "ERROR ( message:The WAS service is not available - try starting the service first.)"

    Hi Anilr.  Yes, both services are started.  See my output below from Power Shell.  Commands are in bold

     

    PS D:\deploy\CI> get-service WAS

    Status Name DisplayName

    ------ ---- -----------

    Running WAS Windows Process Activation Service

     

    PS D:\deploy\CI> get-service W3svc

    Status Name DisplayName

    ------ ---- -----------

    Running W3SVC World Wide Web Publishing Service

     

    PS D:\deploy\CI> C:\Windows\System32\inetsrv\appcmd.exe list apppools

    APPPOOL "DefaultAppPool" (MgdVersion:v2.0,MgdMode:Integrated,state:Unknown)

    APPPOOL "Classic .NET AppPool" (MgdVersion:v2.0,MgdMode:Classic,state:Unknown)

    APPPOOL "MyAppPool" (MgdVersion:v2.0,MgdMode:Integrated,state:Unknown)

    PS D:\deploy\CI> C:\Windows\System32\inetsrv\appcmd.exe start apppool MyAppPool

    ERROR ( message:The WAS service is not available - try starting the service first. )

  • 04-01-2008, 12:49 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: AppCMD "ERROR ( message:The WAS service is not available - try starting the service first.)"

    Are you running this elevated?

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 04-01-2008, 1:59 PM In reply to

    Re: AppCMD "ERROR ( message:The WAS service is not available - try starting the service first.)"

    Here is where I'll plead some ignorance; what does "elevated" mean?

  • 04-01-2008, 2:07 PM In reply to

    Re: AppCMD "ERROR ( message:The WAS service is not available - try starting the service first.)"

    Well a quick "Live" search fixed my lack of knowlege on what "elevated" means! 

     Works: If you Right Click on Power Shell (or command prompt) and say "Run as Administrator" then run the command "C:\Windows\System32\inetsrv\appcmd.exe start apppool DocumentAppPool" you are able to start the pools.

    However...

     Fails: If you start Power Shell (or command prompt) then run the command "C:\Windows\System32\inetsrv\appcmd.exe start apppool DocumentAppPool" you are unable to start the pools and get the following error "ERROR ( message:The WAS service is not available - try starting the service first. )"

    While I'm starting to understand what "elevated" means, does the AppCMD error "service is not available - try starting the service first" make sense for what turns out to be a permissions error?

  • 04-01-2008, 7:29 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 10:13 PM
    • Redmond, WA
    • Posts 2,343

    Re: AppCMD "ERROR ( message:The WAS service is not available - try starting the service first.)"

    There is no case I can think of where you would use appcmd unelevated - so, the error messages when running elevated are probably not the best possible - I will pass this feedback along.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 04-02-2008, 4:49 PM In reply to

    Re: AppCMD "ERROR ( message:The WAS service is not available - try starting the service first.)"

    Thanks.  I think you meant "the error messages when running unelevated are probably not the best possible"

Page 1 of 1 (8 items)
Microsoft Communities