chocolatey / cChoco

Community resource to manage Chocolatey
Apache License 2.0
153 stars 99 forks source link

Error during installation of Sql Server #94

Closed fleed closed 7 years ago

fleed commented 7 years ago

While trying to install SqlServer through DSC/cChoco, I'm getting the following error:

The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID 
{D63B10C5-BB46-4990-A94F-E40B9D520160}
 and APPID 
{9CA88EE3-ACB7-47C8-AFC4-AB702511C276}
 to the user NT AUTHORITY\SYSTEM SID (S-1-5-18) from address LocalHost (Using LRPC) running in the application container Unavailable SID (Unavailable). This security permission can be modified using the Component Services administrative tool.

This is the configuration:

configuration OnPremisesFull {
    Import-DscResource -ModuleName cChoco

    Node onpremises-test
    {
        Service MongoDBUninstall {
            Name   = "MongoDB"
            Ensure = "Absent"
        }

        File DataDirectory {
            Ensure          = "Present"
            Type            = "Directory"
            DestinationPath = "C:\data\db"
        }

        File LogsDirectory {
            Ensure          = "Present"
            Type            = "Directory"
            DestinationPath = "C:\data\logs"
        }

        cChocoInstaller installChoco {
            InstallDir = "C:\choco"
        }

        WindowsFeature IIS {
            Ensure = 'Absent'
            Name   = 'Web-Server'
        }

        cChocoPackageInstaller mongodb {
            Name      = "mongodb"
            Version   = "3.4.7"
            DependsOn = "[Service]MongoDBUninstall", "[cChocoInstaller]installChoco", "[File]DataDirectory"
        }

        cChocoPackageInstaller sqlserver {
            Name      = "mssqlserver2014express"
            Version   = "12.2.5000.20170905"
            DependsOn = "[cChocoPackageInstaller]mongodb"
        }

        cChocoPackageInstaller sqlservermanagementstudio {
            Name      = "mssqlservermanagementstudio2014express"
            Version   = "12.2.5000.20170905"
            DependsOn = "[cChocoPackageInstaller]sqlserver"
        }
    }
}
ferventcoder commented 7 years ago

Since DSC can't be modified to run under a different user than LocalSystem, you have two options:

  1. Use the credentials meta parameter to run the install under a different administrative user.
  2. Follow the instructions in the error message: This security permission can be modified using the Component Services administrative tool.
ferventcoder commented 7 years ago

Hope this helps, there isn't much (maybe not anything) we can with cChoco DSC provider to alleviate this issue.

fleed commented 7 years ago

hi @ferventcoder Thank you for the explanation and the possible solutions. I'll find out which one is more appropriate for my specific context.

fleed commented 7 years ago

@ferventcoder can you provide an example of passing the PSCredential object as meta parameter?