IIS Failes to start on the build VM

James Skimming's Avatar

James Skimming

12 Feb, 2015 04:27 PM

I've just started deploying to the Local build server as part of the build process to execute integration tests.

I added the following to our appveyor.yml

services:
  - iis

But when the build runs, we receive the following error:

Starting Internet Information Services (IIS)
Start-Service : Service 'World Wide Web Publishing Service (w3svc)' cannot be started due to the following error: Cannot start service w3svc on computer '.'.
At line:1 char:1
+ Start-Service 'w3svc'
+ ~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OpenError: (System.ServiceProcess.ServiceController:ServiceController) [Start-Service], ServiceCommandException
    + FullyQualifiedErrorId : CouldNotStartService,Microsoft.PowerShell.Commands.StartServiceCommand
  1. Support Staff 1 Posted by Feodor Fitsner on 12 Feb, 2015 04:34 PM

    Feodor Fitsner's Avatar

    Will take a look.

    -Feodor

  2. 2 Posted by James Skimming on 12 Feb, 2015 04:41 PM

    James Skimming's Avatar

    I've tried starting it manually with the following:

    before_build: net start W3SVC
    

    But I get the following error:

    net start W3SVC
    System error 1068 has occurred.
     
    The dependency service or group failed to start.
     
    Command exited with code 2
    

    I then tried:

    before_build: |
      IISReset.exe
      net start W3SVC
    

    But had similar results, but the error may help:

    IISReset.exe
     
    Attempting stop...
    Internet services successfully stopped
    Attempting start...
    Restart attempt failed.
    The IIS Admin Service or the World Wide Web Publishing Service, or a service dependent on them failed to start.  The service, or dependent services, may had an error during its startup or may be disabled.
    Command exited with code 1062
    
  3. Support Staff 3 Posted by Feodor Fitsner on 12 Feb, 2015 04:53 PM

    Feodor Fitsner's Avatar

    Yeah, that's it. Could you try enabling "iisadmin" service with Set-Service cmdlet?

    -Feodor

  4. 4 Posted by James Skimming on 12 Feb, 2015 05:13 PM

    James Skimming's Avatar

    No luck, it looks like iisadmin was disabled (a prior attempt showed this), but it still didn't fix it.

    The following in yml:

    before_build:
      - ps: Set-Service -Name iisadmin -StartupType Manual
      - ps: Set-Service -Name W3SVC -StartupType Manual
      - net start iisadmin
      - net start W3SVC
    

    Results in the following:

    Set-Service -Name iisadmin -StartupType Manual
    Set-Service -Name W3SVC -StartupType Manual
    net start iisadmin
    The IIS Admin Service service is starting. 
    The IIS Admin Service service was started successfully.
     
    net start W3SVC
    System error 1068 has occurred.
     
    The dependency service or group failed to start.
     
    Command exited with code 2
    
  5. Support Staff 5 Posted by Feodor Fitsner on 12 Feb, 2015 05:34 PM

    Feodor Fitsner's Avatar

    This works:

    Set-Service IISADMIN -StartupType Manual
    Set-Service NetMsmqActivator -StartupType Manual
    Set-Service NetPipeActivator -StartupType Manual
    Set-Service NetTcpActivator -StartupType Manual
    Set-Service NetTcpPortSharing -StartupType Manual
    Set-Service WAS -StartupType Manual
    Start-Service W3SVC
    

    Seems while installing additional IIS components we disabled some services too tight.

  6. Support Staff 6 Posted by Feodor Fitsner on 12 Feb, 2015 07:54 PM

    Feodor Fitsner's Avatar

    It's been fixed.

  7. 7 Posted by James Skimming on 12 Feb, 2015 09:10 PM

    James Skimming's Avatar

    Thanks, all working now.

    I think your approach of the locking down the services is correct, they should just be enabled when choosing IIS.

  8. James Skimming closed this discussion on 12 Feb, 2015 09:10 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac