Wednesday, March 28, 2012

More installation woes

We have releases a shrink wrapped winforms application that uses SQL Express as its backend. The product has a fairly large take up, and consequently it is being installed on a large numbre of different machines and configurations. We seem to be having quite a common problem with the installation of SQL Express, we launch the installation from our own installation package with the following command line

SQLEXPR.EXE /qb ADDLOCAL=ALL SQLAUTOSTART=1 INSTANCENAME="OURInstanceName" SQLCOLLATION="Latin1_General_BIN"

We are seeing time after time that the install fails with the message "The SQL Server service failed to start."

Summary.txt points to

SQLSetupNNNN_COMPUTERNAME_SQL.log

and this in turn looks like this

<snipped>

PerfTime Start: Do_sqlScript : Mon Apr 10 14:06:07 2006
Service MSSQL$OURINSTANCENAME with parameters '-m SqlSetup -Q -qLatin1_General_BIN -T4022 -T3659 -T3610 -T4010' is being started at Mon Apr 10 14:06:07 2006
Service failed unexpectedly (1067)
Error Code: 0x8007042b (1067)
Windows Error Text: The process terminated unexpectedly.
Source File Name: sqlsetuplib\service.cpp
Compiler Timestamp: Fri Sep 16 13:20:12 2005
Function Name: sqls::Service::Start
Source Line Number: 301


</snipped>

The ERRORLOG looks something like this

2006-04-10 13:55:47.07 Server Microsoft SQL Server 2005 - 9.00.1399.06 (Intel X86)
Oct 14 2005 00:33:37
Copyright (c) 1988-2005 Microsoft Corporation
Express Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

2006-04-10 13:55:47.07 Server (c) 2005 Microsoft Corporation.
2006-04-10 13:55:47.07 Server All rights reserved.
2006-04-10 13:55:47.07 Server Server process ID is 1732.
2006-04-10 13:55:47.07 Server Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'.
2006-04-10 13:55:47.07 Server Registry startup parameters:
2006-04-10 13:55:47.07 Server -d C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf
2006-04-10 13:55:47.07 Server -e C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG
2006-04-10 13:55:47.07 Server -l C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf
2006-04-10 13:55:47.07 Server Command Line Startup Parameters:
2006-04-10 13:55:47.07 Server -m SqlSetup
2006-04-10 13:55:47.07 Server SqlSetup
2006-04-10 13:55:47.07 Server -Q
2006-04-10 13:55:47.07 Server -q Latin1_General_BIN
2006-04-10 13:55:47.07 Server -T 4022
2006-04-10 13:55:47.07 Server -T 3659
2006-04-10 13:55:47.07 Server -T 3610
2006-04-10 13:55:47.07 Server -T 4010
2006-04-10 13:55:47.08 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2006-04-10 13:55:47.08 Server Detected 2 CPUs. This is an informational message; no user action is required.
2006-04-10 13:55:47.24 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
2006-04-10 13:55:47.26 Server Database Mirroring Transport is disabled in the endpoint configuration.
2006-04-10 13:55:47.27 spid5s Warning ******************
2006-04-10 13:55:47.27 spid5s SQL Server started in single-user mode. This an informational message only. No user action is required.
2006-04-10 13:55:47.27 spid5s Starting up database 'master'.
2006-04-10 13:55:47.36 spid5s Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
2006-04-10 13:55:47.49 spid5s SQL Trace ID 1 was started by login "sa".
2006-04-10 13:55:47.54 spid5s Starting up database 'mssqlsystemresource'.
2006-04-10 13:55:47.76 spid5s Error: 15209, Severity: 16, State: 1.
2006-04-10 13:55:47.76 spid5s An error occurred during encryption.
2006-04-10 13:55:47.76 spid5s SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.

I can't quite understand what the problem is, has anybody got an idea?

Thanks

We've seen some cases of this. Here's the workaround:

The solution in those cases seemed to be to grant the Network Service FULL CONTROL on C:\Documents and Settings\NetworkService\Application Data\Microsoft\Protect

Hope this helps.

-Jeffrey

|||I am having the same problem installing SQL Server Express.

Here's the error message:
--
Machine : ANSEL
Product : SQL Server Database Services
Error : The SQL Server service failed to start. For more information, see the SQL Server Books Online topics, "How to: View SQL Server 2005 Setup Log Files" and "Starting SQL Server Manually."
--
Machine : ANSEL
Product : Microsoft SQL Server 2005 Express Edition
Product Version : 9.1.2047.00
Install : Failed
Log File : C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap\LOG\Files\SQLSetup0008_ANSEL_SQL.log
Last Action : InstallFinalize
Error String : The SQL Server service failed to start. For more information, see the SQL Server Books Online topics, "How to: View SQL Server 2005 Setup Log Files" and "Starting SQL Server Manually."
The error is (1067) The process terminated unexpectedly.
Error Number : 29503
--

And the ERRORLOG:

2006-05-11 10:58:59.14 Server Microsoft SQL Server 2005 - 9.00.2047.00 (Intel X86)
Apr 14 2006 01:12:25
Copyright (c) 1988-2005 Microsoft Corporation
Express Edition on Windows NT 5.1 (Build 2600: Service Pack 2)

2006-05-11 10:58:59.14 Server (c) 2005 Microsoft Corporation.
2006-05-11 10:58:59.14 Server All rights reserved.
2006-05-11 10:58:59.14 Server Server process ID is 736.
2006-05-11 10:58:59.14 Server Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'.
2006-05-11 10:58:59.14 Server Registry startup parameters:
2006-05-11 10:58:59.14 Server -d C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\master.mdf
2006-05-11 10:58:59.14 Server -e C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG
2006-05-11 10:58:59.14 Server -l C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\DATA\mastlog.ldf
2006-05-11 10:58:59.14 Server Command Line Startup Parameters:
2006-05-11 10:58:59.14 Server -m SqlSetup
2006-05-11 10:58:59.14 Server SqlSetup
2006-05-11 10:58:59.14 Server -Q
2006-05-11 10:58:59.14 Server -q SQL_Latin1_General_CP1_CI_AS
2006-05-11 10:58:59.14 Server -T 4022
2006-05-11 10:58:59.14 Server -T 3659
2006-05-11 10:58:59.14 Server -T 3610
2006-05-11 10:58:59.14 Server -T 4010
2006-05-11 10:58:59.31 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2006-05-11 10:58:59.31 Server Detected 1 CPUs. This is an informational message; no user action is required.
2006-05-11 10:59:00.14 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
2006-05-11 10:59:00.18 Server Database Mirroring Transport is disabled in the endpoint configuration.
2006-05-11 10:59:00.18 spid5s Warning ******************
2006-05-11 10:59:00.18 spid5s SQL Server started in single-user mode. This an informational message only. No user action is required.
2006-05-11 10:59:00.18 spid5s Starting up database 'master'.
2006-05-11 10:59:00.49 spid5s Recovery is writing a checkpoint in database 'master' (1). This is an informational message only. No user action is required.
2006-05-11 10:59:00.68 spid5s SQL Trace ID 1 was started by login "sa".
2006-05-11 10:59:00.73 spid5s Starting up database 'mssqlsystemresource'.
2006-05-11 10:59:00.74 spid5s The resource database build version is 9.00.2047. This is an informational message only. No user action is required.
2006-05-11 10:59:01.01 spid5s Error: 15209, Severity: 16, State: 1.
2006-05-11 10:59:01.01 spid5s An error occurred during encryption.
2006-05-11 10:59:01.01 spid5s SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.

I do not have the directory C:\Documents and Settings\NetworkService\Application Data\Microsoft\Protect on my machine. I do have C:\Documents and Settings\[my username]Application Data\Microsoft\Protect so I set the permissions on that as indicated, but it didn't help.

Any other suggestions?

|||Yep, Set Local System to be the Service account for SQL Server. This seems to do the trick.|||

Grant Full rights to "NETWORK SERVICE" on the "C:\Documents and Settings\NetworkService" folder. Let the system take care of the rest.

(Running the "SQL Server (SQLEXPRESS)" service under the "Local System" account also works, but don't do this! The "Local System" account has virtually unlimited access to everything on your computer. "Network Service" has just enough rights to get the job done, without opening a security hole the size of the Grand Canyon.)

|||

Hi,

Sorry if this is a naive question, but what's wrong with using Local System?

We've been having problems with the reliability of the Network Service account when installing SSEE on user's machines. Sometimes the account doesn't exist, or modifying the "C:\Documents and Settings\NetworkService" just isn't enough.

So we had hoped that by using Local System the installation issues will be resolved.

Do you strongly recommend against this idea?

Thanks

Sam

|||Hi Sam_S, the post by T Hunsaker is correct (although perhaps exaggerated a little), Local System does have more privileges than Network Service. However, if you are running SSEE with no network connectivity, and/or using "user instances" to connect to your databases, this will isolate you from most of the potential security threats out there, and yes I have still seen issues with the suggested fix of granting NetworkService full rights on C:\Documents and Settings\NetworkService.|||

Hello Jalperin,

I am having exactly the same problem (also no directory C:\Documents and Settings\NetworkService\Application Data\Microsoft\Protect); did you find an ultimate solution?

Peter

|||

I am having the same issue "C:\Documents and Settings\NetworkService" has the correct permissions (prior to the various install attempts) and I do not have a ".../protect" folder.

...

2006-08-07 15:52:12.71 spid5s Starting up database 'mssqlsystemresource'.
2006-08-07 15:52:12.75 spid5s The resource database build version is 9.00.2047. This is an informational message only. No user action is required.
2006-08-07 15:52:13.41 spid5s Error: 15209, Severity: 16, State: 1.
2006-08-07 15:52:13.41 spid5s An error occurred during encryption.
2006-08-07 15:52:13.49 spid5s SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.

|||I am having the same issue, and I do not have a network service folder. i am running XP. I have given the network service group full privelages to my local system administrator account. Please advise.

No comments:

Post a Comment