Remote install failing " There was an error generating the XML document."

  • Hi

    I'm trying to install SQL 2008 from a powershell build script.

    The PowerShell invokes a batch file on the remote PC - Invoke-Command -Computername $virtualmachine -scriptblock {c:\temp\installSQL.bat -wait}

    and the batch file starts the install with a config file - c:\temp\SQL2008ENT_FULLSP3\Setup.exe /ConfigurationFile=c:\temp\SQL2008ENT_FULLSP3\ConfigurationFile.INI

    If I just run the batch manually on the Server it's fine so the config file is ok.  If I run via the script I get the following summary.txt

    Any Ideas?

    Overall summary:
    Final result:      Failed: see details below
    Exit code (Decimal):    -2068774911
    Exit facility code:    1201
    Exit error code:     1
    Exit message:      There was an error generating the XML document.
    Start time:       2018-02-14 13:06:53
    End time:        2018-02-14 13:06:58
    Requested action:     RunRules

    Machine Properties:
    Machine name:      SQlServer1
    Machine processor count:   2
    OS version:       Windows Server 2008
    OS service pack:     Service Pack 2
    OS region:       United Kingdom
    OS language:       English (United States)
    OS architecture:     x64
    Process architecture:    64 Bit
    OS clustered:      No

    Package properties:
    Description:       SQL Server Database Services 2008
    SQLProductFamilyCode:    {628F8F38-600E-493D-9946-F4178F20A8A9}
    ProductName:       SQL2008
    Type:         RTM
    Version:        10
    Installation location:   c:\temp\SQL2008ENT_FULLSP3\x64\setup\
    Installation edition:    ENTERPRISE

    Slipstream:       True

    User Input Settings:
    ACTION:        RunRules
    CONFIGURATIONFILE:     c:\temp\SQL2008ENT_FULLSP3\ConfigurationFile.INI
    FEATURES:        SQLENGINE,REPLICATION,CONN,BC,SSMS,ADV_SSMS,SNAC_SDK
    HELP:         False
    INDICATEPROGRESS:     False
    INSTANCENAME:      MSSQLSERVER
    QUIET:         True
    QUIETSIMPLE:       False
    RULES:         GlobalRules
    X86:         False

    Configuration file:    C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20180214_130652\ConfigurationFile.ini

    Detailed results:

    Rules with failures:

    Global rules:

    There are no scenario-specific rules.

    Rules report file:     The rule result report file is not available.

    Exception summary:
    The following is an exception stack listing the exceptions in outermost to innermost order
    Inner exceptions are being indented

    Exception type: Microsoft.SqlServer.Chainer.Infrastructure.ChainerInfrastructureException
      Message:
       There was an error generating the XML document.
      Data:
      DisableWatson = true
      Stack:
       at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject(String rootPath, Object objectToSerialize, Boolean saveToCache)
       at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject(Object objectToSerialize)
       at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.SaveInputSettingValueToObject(InputSettingInfo inputSettingInfo, List`1 values)
       at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.SaveParsedArgumentsIntoInputSettingStore(InputSettingSource source, Dictionary`2 parsedArguments, Boolean chainerSetting, Boolean ignoreSettingsForNotAllowedScnearios)
       at Microsoft.SqlServer.Chainer.Infrastructure.InputSettingService.ProcessConfigFile(String configFileFullPath, Boolean chainerSetting, Boolean ignoreSettingsForNotAllowedScnearios)
       at Microsoft.SqlServer.Configuration.BootstrapExtension.ProcessConfigFileArguments.ExecuteAction(String actionId)
       at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute(String actionId, TextWriter errorStream)
       at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.InvokeAction(WorkflowObject metabase, TextWriter statusStream)
       at Microsoft.SqlServer.Setup.Chainer.Workflow.PendingActions.InvokeActions(WorkflowObject metaDb, TextWriter loggingStream)
      Inner exception type: System.InvalidOperationException
       Message:
          There was an error generating the XML document.
       Stack:
          at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
          at System.Xml.Serialization.XmlSerializer.Serialize(TextWriter textWriter, Object o, XmlSerializerNamespaces namespaces)
          at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject(String rootPath, Object objectToSerialize, Boolean saveToCache)
       Inner exception type: System.Security.Cryptography.CryptographicException
        Message:
            The requested operation cannot be completed. The computer must be trusted for delegation and the current user account must be configured to allow delegation.
            
        Stack:
            at System.Security.Cryptography.ProtectedData.Protect(Byte[] userData, Byte[] optionalEntropy, DataProtectionScope scope)
            at Microsoft.SqlServer.Common.SqlSecureString.WriteXml(XmlWriter writer)
            at System.Xml.Serialization.XmlSerializationWriter.WriteSerializable(IXmlSerializable serializable, String name, String ns, Boolean isNullable, Boolean wrapped)
            at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterSqlEngineSetupPublic.Write6_SqlEngineSetupPublic(String n, String ns, SqlEngineSetupPublic o, Boolean isNullable, Boolean needType)
            at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterSqlEngineSetupPublic.Write7_SqlEngineSetupPublic(Object o)

  • It's most likely a permissions error. If you go through the summary and exception, you can find the message:
    The computer must be trusted for delegation and the current user account must be configured to allow delegation.

    Try creating a local user, add the user to the local admins group and use those credentials.

    Sue

  • Thanks for the reply Sue.  I've already tried that approach and I get the same results

  • alex.palmer - Tuesday, February 20, 2018 12:20 AM

    Thanks for the reply Sue.  I've already tried that approach and I get the same results

    How did you run the script with the other account?

    Sue

  • If memory serves.......

    I created  a local admin account of the box I was deploying SQL to, Then in the PowerShell script I created a credential for that local account and specified it invoke-command with authentication of Credssp

    So


    Enable
    -WSManCredSSP Role Client DelegateComputer deployserver01 -Force

    on SQLserver01

    Enable-WSManCredSSP –Role Server -Force


    $credential = Get-Credential -Credential sqlserver01\installsql
    Invoke-Command -Computername $virtualmachine -scriptblock {c:\temp\installSQL.bat -wait} -credential $credential -Authentication Credssp

  • alex.palmer - Wednesday, February 21, 2018 1:12 AM

    If memory serves.......

    I created  a local admin account of the box I was deploying SQL to, Then in the PowerShell script I created a credential for that local account and specified it invoke-command with authentication of Credssp

    So


    Enable
    -WSManCredSSP –Role Client –DelegateComputer deployserver01 -Force

    on SQLserver01

    Enable-WSManCredSSP –Role Server -Force


    $credential = Get-Credential -Credential sqlserver01\installsql
    Invoke-Command -Computername $virtualmachine -scriptblock {c:\temp\installSQL.bat -wait} -credential $credential -Authentication Credssp

    I'm not sure that would work as it should be opening up another powershell windows (for the different security context) or create a new session using the alternate account. To do it with a new session, refer to:
    Powershell: Invoke command locally as different user

    The only way I got it to work before and most of the others I've seen use Start-Process to call powershell passing in the script and credentials.

    Sue

  • Thanks for your persistence Sue, that link set me off looking again.

    This looks like it will work

    First on the device I was running the script from I needed to run

    Set-Item wsman:\localhost\client\trustedhosts *

    Then the powershell goes

    $cred = credential 'sqlsever01\installsql'
     Invoke-Command -ComputerName sqlserver01 -Credential $cred -Authentication Negotiate -ScriptBlock  {cmd /c c:\temp\instalsql.bat}

    I've not tried a full install yet but it successfully executed an ipconfig /all under the local credentials.
    I'll try a full install later today and update if I have any issues.

  • Update

    I tried running as above. The setup exe's executed as the local admin account but it still bombed out with the same errors.

    I also tried running it using pssession again with the same results.

    Using the local credentials I was able to install other applications but SQL is stubbornly refusing to install

  • alex.palmer - Thursday, February 22, 2018 3:22 AM

    Update

    I tried running as above. The setup exe's executed as the local admin account but it still bombed out with the same errors.

    I also tried running it using pssession again with the same results.

    Using the local credentials I was able to install other applications but SQL is stubbornly refusing to install

    The only things I can think of that would do that is if it needed to be executed as Run As Administrator and then you get the UAC prompt.
    It could have something to do with the policies related to installing software...but not sure why the others would work so that's not as likely.
    I never did find a way to bypass UAC, only how to disable it which isn't a good idea. I don't think you can bypass it but at the time I looked anyway. If you wanted to mess around with it to see if it works with the prompt, I was using start-process with -verb runas

    Sue

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply