Category Archives: SQL Server

A computer restart is required. You must restart this computer before installing SQL Server

Anyone who installs SQL Server frequently must get this all the time.

Shutting down an in use server is rarely an easy option.

I’ve been doing the following hack to get round this since SQL 2008 came out with its new installer, but I never told anyone as I thought bad things could happen and I didn’t want to be responsible. Then the other day I called Microsoft Support about a bug in SQL Server and the MS technician told me to do it to avoid a reboot. Well if it’s good enough for them to tell customers then it good enough for me.

During the SQL install it checks the following registry locations to see if a reboot is required.

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired

PendingFileRenameOperations is a registry value and RebootRequired is a registry key. You can just rename them both to something else. Then after it passes the SQL install check you can put them back.

I’ve done this literally hundreds of times and never had an issue.  I even wrote a simple tool to do it which I keep with my SQL install set to speed up the process. It’s probably rare to install SQL as much as me so just change the registry manually.



SQL Server 2008 R2 Setup hangs at SqlEngineConfigAction_install_confignonrc_Cpu64

The short version:

If you get SqlEngineConfigAction_install_confignonrc_Cpu64 error while installing SQL Server 2008 R2 and the detail log says that the last successful command was mofcomp.exe then try restarting the server, uninstall the partially installed sql server and then reinstall.

More detail:

  • Check the log at C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\<datetime>\detail.txt
  • If the last line in the log is something to do with mofcomp.exe then the steps below may help, otherwise unfortunately it’s probably something else.
  • Open an Administrator command prompt and cd to “C:\Program Files\Microsoft SQL Server\MSSQL10_50.<InstanceName>\MSSQL\Binn”
  • run “mofcomp.exe blah.mof” for each mof file in that folder
  • If one of them fails then you know where the SQL Setup is failing.
  • Try rebooting the server and rerunning the mof command that failed.
  • If successfull then uninstall sql server and then reinstall, problem solved.
  • If not successfuly then at least you know you have a WMI issue, google how to repair the WMI and try that until you can get the mof settings stored in the repository. There is no point trying to install SQL again until you have got this working.

The full story on how I found and solved this issue:

I ran across a problem installing SQL Server 2008 R2 Express with Advanced Services on a customers server this week. The server was a Windows Small Business Server 2008 SP2 with all windows updates applied.

I’d actually started to do the install at 11:00pm at night as I do this pretty much every day and have everything setup to install from a batch file with a sqlconfigurationfile, this way I could get straight to work in the morning (haha little did I know this day would be a write off) I kicked it off and went to bed only to wake up to find it still installing, stuck at SqlEngineConfigAction_install_confignonrc_Cpu64. I’m glad I did this overnight otherwise I would have most likely spent a couple of hours looking at this installing… wondering why it was taking so long.

I had no choice but to kill the install and check out the logs. Now killing it was trickier than you’d think. Killing setup100.exe did nothing… I ended up downloading processes explorer from sysinternals and finding setup100.exe had started running mofcomp.exe, killing mofcomp.exe then allowed setup100.exe to fail.

SQL Setup gave the following error:

TITLE: Microsoft SQL Server 2008 R2 Setup
The following error has occurred:
The MOF compiler could not connect with the WMI server. This is either because of a semantic error such as an incompatibility with the existing WMI repository or an actual error such as the failure of the WMI server to start.
For help, click:


That web page as of today says sorry we don’t know what the issue it.

Unfortunately as it had hung the logs didn’t actually say what it had failed on specifically. All I could see was the last thing in the install that had worked. The last few line of the detail.txt log are below:

2011-06-09 23:29:41 Slp: PerfCounter calling lodctr: 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008\MSSQL\Binn\perf-MSSQL$SQL2008sqlctr.ini'
2011-06-09 23:29:41 SQLEngine: : Checking Engine checkpoint 'XEventMofFile'
2011-06-09 23:29:41 Slp: Sco: Attempting to set file full path to 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008\MSSQL\Binn\xesqlpkg.mof'
2011-06-09 23:29:41 Slp: Sco: Attempting to normalize directory path 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008\MSSQL\Binn\xesqlpkg.mof'
2011-06-09 23:29:41 Slp: Sco: Attempting to check if file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008\MSSQL\Binn\xesqlpkg.mof' exists
2011-06-09 23:29:41 SQLEngine: : Checking Engine checkpoint 'XEventCompileMofFile'
2011-06-09 23:29:41 SQLEngine: --XEventSetup: Compling MOF file: C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008\MSSQL\Binn\xesqlpkg.mof
2011-06-09 23:29:41 Slp: Sco: Attempting to install MOF file
2011-06-09 23:29:41 Slp: Running: C:\Windows\system32\WBEM\mofcomp.exe "C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008\MSSQL\Binn\xesqlpkg.mof"
2011-06-09 23:29:41 Slp: Microsoft (R) MOF Compiler Version 6.0.6000.16386
2011-06-09 23:29:41 Slp: Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.
2011-06-09 23:29:41 Slp: Parsing MOF file: C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008\MSSQL\Binn\xesqlpkg.mof
2011-06-09 23:29:42 Slp: MOF file has been successfully parsed
2011-06-09 23:29:42 Slp: Storing data in the repository...

Through a lot of googling I found out that mofcomp.exe deals with WMI and specifically is used to add security groups for SQL Server. Everytime mofcomp is mentioned with SQL Server on google it seems the problem is WMI is corrupt, there are a few commands you can run to check it and you can also run wmidiag to check it is all working. All these tests I ran said it was fine. Despite this solutions kept saying stop the service, delete the WMI repository folder and restore it. I didn’t particularly want to go down the route of repairing this as it’s a customers server and their IT should really do this, especially if it has the chance to go wrong, which this definitely sounded like it did.

Lets dig deeper…

I decided to run process monitor on the install filtering on mofcomp.exe.

But first to perform the install again I first had to go to add remove programs and uninstall all the bits that had failed to install (everything except management studio). Only then can you reinstall, repair didn’t work I tried that first.

Process monitor showed that mofcomp.exe trying to run this command:

mofcomp.exe xesospkg.mof

I opened an Administrator Command Prompt at:

C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQL2008\MSSQL\Binn

and ran:

mofcomp.exe xesospkg.mof

This resulted in it hanging. Excellent, I now had a way to check if I’d fixed the issue without unsinstalling sql server and then rerunning through the full install which can take an hour or so.

I tried running lots of fixes to WMI found via google, but none of them worked. I tried one which suggested stop and restart the WMI service. I gave it a go, but this resulted in the service getting stuck in the “stopping” state. Fantastic… The only solution now is to restart the service. Well as this was a small business server restarting the server would stop the office from working, so I left this till after hours to restart. It turned out this was a blessing, as restarting the server fixed the issue immediately. I reran the mofcomp.exe command and it stored the data in the repository. I uninstalled and reinstalled and SQL installed perfectly.