Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSFT_xSQLServerSetup failed to execute Set-TargetResource #551

Closed
sujitks opened this issue May 12, 2017 · 10 comments
Closed

MSFT_xSQLServerSetup failed to execute Set-TargetResource #551

sujitks opened this issue May 12, 2017 · 10 comments
Labels
question The issue is a question.

Comments

@sujitks
Copy link

sujitks commented May 12, 2017

Trying to install Sql Server 2016 using xSqlServer which keeps failing

xSqlServerSetup ($Node.NodeName)
         {
             SourcePath = $Node.SourcePath
             SetupCredential = $AdminCred
             InstanceName = $Node.InstanceName
             Features = $Node.Features
             SQLSysAdminAccounts = $Node.SQLSysAdminAccounts
             SQLSvcAccount = $AdminCred
             InstallSharedDir = "e:\Program Files\Microsoft SQL Server"
             InstallSharedWOWDir = "e:\Program Files (x86)\Microsoft SQL Server"
             InstanceDir = "e:\Program Files\Microsoft SQL Server"
             InstallSQLDataDir = "e:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data"
             SQLUserDBDir = "e:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data"
             SQLUserDBLogDir = "F:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data"
             SQLTempDBDir = "T:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data"
             SQLTempDBLogDir = "F:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data"
             SQLBackupDir = "e:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\Data"        
             
             
         }:

Windows server 2016 data centre edition, SQL Server 2016 and PS 5.1 the DSC Target Node is running:

I am trying to install sql server using the xSqlServer version 7 from the psgallery

Version of the DSC module xSqlServer 7 from Powershell Gallery

@johlju
Copy link
Member

johlju commented May 12, 2017

@sujitks Thanks for submitting this issue. Could you provide a verbose log and the the error message you are getting?

@johlju johlju added the question The issue is a question. label May 12, 2017
@sujitks
Copy link
Author

sujitks commented May 12, 2017

Hi @johlju following is the error message I have got

{
    "Exception":  {
                      "Message":  "PowerShell DSC resource MSFT_xSQLServerSetup  failed to execute Set-TargetResource functionality with error message: Test-TargetResource returned false after calling set. ",
                      "Data":  {

                               },
                      "InnerException":  {
                                             "ErrorRecord":  "Test-TargetResource returned false after calling set.",
                                             "WasThrownFromThrowStatement":  true,
                                             "Message":  "Test-TargetResource returned false after calling set.",
                                             "Data":  "System.Collections.ListDictionaryInternal",
                                             "InnerException":  "System.Exception: Test-TargetResource returned false after calling set.",
                                             "TargetSite":  "System.Collections.ObjectModel.Collection`1[System.Management.Automation.PSObject] Invoke(System.Collections.IEnumerable)",
                                             "StackTrace":  "   at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)\r\n   at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)\r\n   at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)\r\n   at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)\r\n   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)\r\n   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)\r\n   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.ResourceProviderAdapter.ExecuteCommand(PowerShell powerShell, ResourceModuleInfo resInfo, String operationCmd, List`1 acceptedProperties, CimInstance nonResourcePropeties, CimInstance resourceConfiguration, LCMDebugMode debugMode, PSInvocationSettings pSInvocationSettings, UInt32\u0026 resultStatusHandle, Collection`1\u0026 result, ErrorRecord\u0026 errorRecord, PSModuleInfo localRunSpaceModuleInfo)",
                                             "HelpLink":  null,
                                             "Source":  "System.Management.Automation",
                                             "HResult":  -2146233087
                                         },
                      "TargetSite":  null,
                      "StackTrace":  null,
                      "HelpLink":  null,
                      "Source":  null,
                      "HResult":  -2146233079
                  },
    "TargetObject":  null,
    "CategoryInfo":  {
                         "Category":  7,
                         "Activity":  "",
                         "Reason":  "InvalidOperationException",
                         "TargetName":  "",
                         "TargetType":  ""
                     },
    "FullyQualifiedErrorId":  "ProviderOperationExecutionFailure",
    "ErrorDetails":  null,
    "InvocationInfo":  null,
    "ScriptStackTrace":  null,
    "PipelineIterationInfo":  [
                              ]
}

I am using Azure Automation for the dsc, If you want I can send you configuration file as well if that helps.

@johlju
Copy link
Member

johlju commented May 12, 2017

That error message usually happens when setup.exe fails for some reason and Test-method cannot verify that the features are installed.

Please send the configuration, maybe I can use it to build a lab to test this.

Also if you got the summary log in C:\Program Files\Microsoft SQL Server\130\Setup Bootstrap\Log? See if there is more information in that file what went wrong.

@sujitks
Copy link
Author

sujitks commented May 12, 2017

Thanks for the heads up @johlju, I saw it was complaining for the features supplied in the argument. SQLENGINE is no longer a valid feature in sql 2016.

I have corrected that but now it is failing for a System Administrator account with following error:

Missing system administrator account. To continue, provide at least one Windows account to provision as a SQL Server system administrator.
Does this account needs to be local windows account or a domain account?

@johlju
Copy link
Member

johlju commented May 12, 2017

What do you mean by that SQLENGINE is not a valid feature? It should be. Or am I miss understanding you?
https://docs.microsoft.com/en-us/sql/database-engine/install-windows/install-sql-server-2016-from-the-command-prompt#Feature

About the error message you are getting. It should be the user set in SQLSysAdminAccounts that is used. Also the user in SetupCredential will always be used as the first administrator user.

I don't know why you are getting that error to be honest.
Could you post your configuration as it looks now?

@johlju
Copy link
Member

johlju commented May 12, 2017

I always used a domain user. Never tried a local user. So if you are using a local user(s) then that might be the problem?

@sujitks
Copy link
Author

sujitks commented May 12, 2017

Hi @johlju, I

I had some success after providing the account information. Now it is failing and complaining that

No features were installed during the setup execution. The requested features may already be installed. Please review the summary.txt log for

I have attached the configuration here.
Configuration_Sql_Localhost.zip

@johlju
Copy link
Member

johlju commented May 13, 2017

I do see on problem. You got the following features list.

Features                    = "SQLENGINE,REPLICATION,AS,CONN,IS,TOOLS"

The parent feature parameter 'Tools' is currently not supported. Please use the (child) feature parameter (CONN, BC, etc). If you use 'Tools' the Test-method will report that is is missing a feature (and it will always try to install again on the next run).

The error you are getting seems to be an error from setup.exe. You should not have gotten that on a clean install. And if all features were detected, then setup.exe should not been started.
Did you get this error on a clean install (that is, target node did not have any SQL components installed prior of running the configuration)?

@sujitks
Copy link
Author

sujitks commented May 15, 2017

I have updated the features and re-provision everything, sql server setup seems to have gone ok now. It is faililng on xSqlMemory due to parameter validation. I am going to see what are the valid values.

I have followed one of the example from this repository, Looks like there is no example available yet for building a sql server 2016 cluster.

Thanks for your help

@johlju
Copy link
Member

johlju commented May 20, 2017

We are lacking good examples. It would be a good thing to have that, which has been discussed for example here #462.

I'm closing this issue. If you have a problem still with xSQLServerMemory please open a new issue. If there still a problem with installing using xSQLServerStup, then please reopen this issue, or submit a new issue.

Thanks!

@johlju johlju closed this as completed May 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question The issue is a question.
Projects
None yet
Development

No branches or pull requests

2 participants