Avoid Forced Reboots Using Unattended Upgrades in SQL Server 2014

sql serverupgrade

Upgrading seven instances from SQL Server 2008R2 to 2014 via the ADMINISTRATOR command line using a configuration file. The upgrade runs fine but when I move on to upgrading the next instance I get the following error.

From : C:\Program Files\Microsoft SQL Server\120\Setup Bootstrap\Log\20150105_152519\Summary.txt

Error result: -2067919934
Result facility code: 1214
Result error code: 3010

Exception type: Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngineRuleFailureException
    Message: 
        A computer restart is required. You must restart this computer before installing SQL Server.
    HResult : 0x84be0bc2
        FacilityCode : 1214 (4be)
        ErrorCode : 3010 (0bc2)
    Data: 
      SQL.Setup.FailureCategory = RuleViolationFailure
      DisableWatson = true
    Stack: 
        at Microsoft.SqlServer.Configuration.RulesEngineExtension.RunRulesAction.ExecuteAction(String actionId)
        at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute(String actionId, TextWriter errorStream)
        at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.<>c__DisplayClasse.<ExecuteActionWithRetryHelper>b__b()
        at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.ExecuteActionHelper(ActionWorker workerDelegate)

I am able to continue after restarting, but something is very wrong if I have to restart after every upgrade. Can someone help me figure out, why I have to restart after upgrading every instance?

Here is the configuration file I'm using

INSTANCENAME="SOME_INSTANCE"
SQMREPORTING="False"
INSTANCEID="SOME_INSTANCE"
IACCEPTSQLSERVERLICENSETERMS="True"
ACTION="Upgrade"
ENU="True"
QUIET="True"
UpdateEnabled="True"
ERRORREPORTING="False"
USEMICROSOFTUPDATE="False"
UpdateSource="MU"
HELP="False"
INDICATEPROGRESS="False"
X86="False"
FAILOVERCLUSTERROLLOWNERSHIP="2"

Here is the command being used to upgrade :

setup.exe  /ConfigurationFile="Confguration_Upgrade.ini"

Update

More information from detail.txt

# (01) 2015-01-05 15:45:00 Slp: File operations are pending for "SQLCTR100.DLL"
# (01) 2015-01-05 15:45:00 Slp: File operations are pending for "SQLAGENTCTR100.DLL"
# (01) 2015-01-05 15:45:00 Slp: Rule 'RebootRequiredCheck' results: IsRebootNotRequired=False
# (01) 2015-01-05 15:45:00 Slp: Evaluating rule : RebootRequiredCheck
# (01) 2015-01-05 15:45:00 Slp: Rule running on machine: G06SQL001
# (01) 2015-01-05 15:45:00 Slp: Rule evaluation done : Failed
# (01) 2015-01-05 15:45:00 Slp: Rule evaluation message: A computer restart is required. You must restart this computer before installing SQL Server.

Best Answer


Hi Craig,

I may have a solution for you.
You should go to the registry and delete the registry key below: HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations

I've created PS scripts for upgrading SQL Server Instances.

Here an example:


# Select the source path and the Instance name. # Launch the script on a PowerShell console as Administrator. $SourcePath = "\\MYNAS\Sources\SQL Server 2014" $InstanceName = "MYINSTANCE1" Set-Location $SourcePath $exists = Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" -Name "PendingFileRenameOperations" -ErrorAction SilentlyContinue If (($exists -ne $null) -and ($exists.Length -ne 0)) { Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" -Name "PendingFileRenameOperations" } .\setup.exe /ACTION="Upgrade" /Q /INDICATEPROGRESS="True" /INSTANCENAME=$InstanceName /IACCEPTSQLSERVERLICENSETERMS $InstanceName = "MYINSTANCE2" Set-Location $SourcePath $exists = Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" -Name "PendingFileRenameOperations" -ErrorAction SilentlyContinue If (($exists -ne $null) -and ($exists.Length -ne 0)) { Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" -Name "PendingFileRenameOperations" } .\setup.exe /ACTION="Upgrade" /Q /INDICATEPROGRESS="True" /INSTANCENAME=$InstanceName /IACCEPTSQLSERVERLICENSETERMS

I hope this will help.

Max.