SQL Server 2008: “Could not fix registry key” Issue and how to resolve


In SQL Server 2008, we added a tool to fix some registry keys to address some known issues.  We recently discovered this tool can fail on rare occasions when it does not have permissions to all required registry keys.

 

If a rule fails with the following message:

“The SQL Server registry keys from a prior installation cannot be modified. To continue, see SQL Server Setup documentation about how to fix.” you might be hitting this issue. See below to determine whether you are encountering this issue and how to address.

 

If you view the “SystemConfigurationCheck_Report.htm” that is located in %programfiles%\Microsoft SQL Server\100\Setup Bootstrap\Log\<latest session>, you will see this error, as shown below:

image

If you view the Summary*GlobalRules.txt, you will see:

image

If you view the Summary*GlobalRules.txt, you will see:

 

This error happens since some registry keys that need to be fixed do not have administrator access. In this log file, the Lpc key does not have administrator access:

2009-07-31 14:34:16 Slp: Could not fix registry key HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server\MICROSOFTBCM\MSSQLServer\SuperSocketNetLib\Lpc.
2009-07-31 14:34:16 Slp: System.UnauthorizedAccessException: Attempted to perform an unauthorized operation.

2009-07-31 14:34:16 Slp:    at Microsoft.SqlServer.Configuration.FixSqlRegistryKey.Program.OpenKey(String keyName)
2009-07-31 14:34:16 Slp:    at Microsoft.SqlServer.Configuration.FixSqlRegistryKey.Program.FixRegistryKey(String keyName)
2009-07-31 14:34:16 Slp:    at Microsoft.SqlServer.Configuration.FixSqlRegistryKey.Program.FixRegistryKeyAndSubKeys(RegistryKey key)

2009-07-31 14:34:17 Slp: Error: Action "RunStandaloneRules" threw an exception during execution.
2009-07-31 14:34:17 Slp: Microsoft.SqlServer.Setup.Chainer.Workflow.ActionExecutionException: The SQL Server registry keys from a prior installation cannot be modified. To continue, see SQL Server Setup documentation about how to fix registry keys. —> Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngineRuleFailureException: The SQL Server registry keys from a prior installation cannot be modified. To continue, see SQL Server Setup documentation about how to fix registry keys.
2009-07-31 14:34:17 Slp:    at Microsoft.SqlServer.Configuration.RulesEngineExtension.RunRulesAction.ExecuteAction(String actionId)
2009-07-31 14:34:17 Slp:    at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute(String actionId, TextWriter errorStream)
2009-07-31 14:34:17 Slp:    at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.InvokeAction(WorkflowObject metabase, TextWriter statusStream)
2009-07-31 14:34:17 Slp:    at Microsoft.SqlServer.Setup.Chainer.Workflow.PendingActions.InvokeActions(WorkflowObject metaDb, TextWriter loggingStream)
2009-07-31 14:34:17 Slp:    — End of inner exception stack trace —
2009-07-31 14:34:17 Slp:    at Microsoft.SqlServer.Setup.Chainer.Workflow.PendingActions.InvokeActions(WorkflowObject metaDb, TextWriter loggingStream)
2009-07-31 14:34:18 Slp: Received request to add the following file to Watson reporting: C:\Documents and Settings\hoffman\Local Settings\Temp\tmp346.tmp
2009-07-31 14:34:18 Slp: The following is an exception stack listing the exceptions in outermost to innermost order
2009-07-31 14:34:18 Slp: Inner exceptions are being indented
2009-07-31 14:34:18 Slp:
2009-07-31 14:34:18 Slp: Exception type: Microsoft.SqlServer.Configuration.RulesEngineExtension.RulesEngineRuleFailureException
2009-07-31 14:34:18 Slp:     Message:
2009-07-31 14:34:18 Slp:         The SQL Server registry keys from a prior installation cannot be modified. To continue, see SQL Server Setup documentation about how to fix registry keys.
2009-07-31 14:34:18 Slp:     Data:
2009-07-31 14:34:18 Slp:       DisableWatson = true
2009-07-31 14:34:18 Slp:     Stack:
2009-07-31 14:34:18 Slp:         at Microsoft.SqlServer.Configuration.RulesEngineExtension.RunRulesAction.ExecuteAction(String actionId)
2009-07-31 14:34:18 Slp:         at Microsoft.SqlServer.Chainer.Infrastructure.Action.Execute(String actionId, TextWriter errorStream)
2009-07-31 14:34:18 Slp:         at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.InvokeAction(WorkflowObject metabase, TextWriter statusStream)
2009-07-31 14:34:18 Slp:         at Microsoft.SqlServer.Setup.Chainer.Workflow.PendingActions.InvokeActions(WorkflowObject metaDb, TextWriter loggingStream)
2009-07-31 14:34:20 Slp:
2009-07-31 14:34:20 Slp: ———————————————————————-
2009-07-31 14:34:20 Slp:
2009-07-31 14:34:20 Slp: Error result: -2067922433
2009-07-31 14:34:20 Slp: Result facility code: 1214
2009-07-31 14:34:20 Slp: Result error code: 511

 

Workaround:

Open up the registry and navigate to the registry key with the issue can give the administrator access to the registry key. 

 

As always, use extreme caution when modifying the windows registry.


Comments (5)

  1. FD says:

    Thanks, it works now after giving permition to Key entry

  2. oompa_l says:

    I can't find the problematic key. which log file/where in the file should I be looking?

  3. Usman Shaheen says:

    @oompa_l

    please try this

    "I got this issue fixed by running SQL2008 Service Pack 1 prior to the Main Install.  SQL2008 Service Pack installed the latest intial files and corrected registry permission."

    social.msdn.microsoft.com/…/dineshkotian

    Thanks

    Usman Shaheen

    usmanshaheen.wordpress.com

  4. I just replaced following file

    "C:Program FilesMicrosoft SQL Server100Setup BootstrapReleasex86FixSqlRegistryKey_x86.exe"  with

    "%x86FixSqlRegistryKey_x86.exe".

    It worked for me.

  5. I've got the same 511 error code when trying to install 2008R2 SP1 on a Server Core 2008R2 box. To find out the problematic registry key, I started procmon.exe which surprisingly works on Server Core. It did not report any 'Access Denied' event sfor the FixSqlRegistryKey_*.exe processes.

    I had started setup.exe from a network share, after copying the whole SP1 folder over to a local drive, the install ran all the way through without any problems. So the error message is somehow misleading.