Link to home
Start Free TrialLog in
Avatar of irfantak
irfantak

asked on

SQL Server Error 17058

I have SQL Server Std. running on a Win 2003 server. Everything has been fine except for the past few days the Default Instance/Service does not launch anymore. I have uninstalled and reinstalled it but to no good. I do login as Administrator on the server. I did the installed in Mixed Mode authentication so the Service should launch as a System account. Here is the error I get.

-----------
The SQL Server (MSSQLSERVER) service terminated with service-specific error 17058 (0x42A2).
------------------
Please help! I don't want to reformat the hard drive!
Avatar of appari
appari
Flag of India image


can you check the event viewer and are there any errors reported?
Avatar of irfantak
irfantak

ASKER

Yes, the above error is from the Event Viewer. Also, same error shows up when I try to use the Service Control panel.
Thanks.
Go to a command prompt and navigate to the directory where the sqlservr.exe is for this instance
Execute sqlservr.exe -c

What happens?
ok, let me try that....
There are actually 2 of these sqlserv.exe in that machine. Running the 2nd one (in C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Binn) did produce the following output in the Command window:

--------------------


Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

C:\Documents and Settings\Administrator>cd C:\Program Files\Microsoft SQL Server
\MSSQL.1\MSSQL\Binn

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn>sqlserv.exe -c
'sqlserv.exe' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn>execute sqlservr.exe -c

'execute' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn>execute sqlservr.exe -c

'execute' is not recognized as an internal or external command,
operable program or batch file.

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn>sqlservr.exe -c

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn>cd C:\Program Files\Mic
rosoft SQL Server\MSSQL.2\MSSQL\Binn

C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Binn>sqlservr.exe -c
2007-02-28 09:38:10.90 Server      Authentication mode is MIXED.
2007-02-28 09:38:21.23 Server      Error: 17049, Severity: 16, State: 1.
2007-02-28 09:38:21.23 Server      Unable to cycle error log file from 'C:\Progr
am Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG' to 'C:\Program Files\M
icrosoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG.1' due to OS error '32(The proces
s cannot access the file because it is being used by another process.)'. A proce
ss outside of SQL Server may be preventing SQL Server from reading the files. As
 a result, errorlog entries may be lost and it may not be possible to view some
SQL Server errorlogs. Make sure no other processes have locked the file with wri
te-only access."
2007-02-28 09:38:21.25 Server      Error: 17058, Severity: 16, State: 1.
2007-02-28 09:38:21.25 Server      initerrlog: Could not open error log file 'C:
\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'. Operating syste
m error = 32(The process cannot access the file because it is being used by anot
her process.).
2007-02-28 09:38:21.56 Server      Error: 17058, Severity: 16, State: 1.
2007-02-28 09:38:21.56 Server      initerrlog: Could not open error log file 'C:
\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'. Operating syste
m error = 32(The process cannot access the file because it is being used by anot
her process.).
2007-02-28 09:38:21.87 Server      Error: 17058, Severity: 16, State: 1.
2007-02-28 09:38:21.87 Server      initerrlog: Could not open error log file 'C:
\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'. Operating syste
m error = 32(The process cannot access the file because it is being used by anot
her process.).
2007-02-28 09:38:22.18 Server      Error: 17058, Severity: 16, State: 1.
2007-02-28 09:38:22.18 Server      initerrlog: Could not open error log file 'C:
\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'. Operating syste
m error = 32(The process cannot access the file because it is being used by anot
her process.).
2007-02-28 09:38:22.50 Server      Error: 17058, Severity: 16, State: 1.
2007-02-28 09:38:22.50 Server      initerrlog: Could not open error log file 'C:
\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'. Operating syste
m error = 32(The process cannot access the file because it is being used by anot
her process.).
2007-02-28 09:38:22.81 Server      Error: 17058, Severity: 16, State: 1.
2007-02-28 09:38:22.81 Server      initerrlog: Could not open error log file 'C:
\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'. Operating syste
m error = 32(The process cannot access the file because it is being used by anot
her process.).
2007-02-28 09:38:23.12 Server      Error: 17058, Severity: 16, State: 1.
2007-02-28 09:38:23.12 Server      initerrlog: Could not open error log file 'C:
\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'. Operating syste
m error = 32(The process cannot access the file because it is being used by anot
her process.).
2007-02-28 09:38:23.43 Server      Error: 17058, Severity: 16, State: 1.
2007-02-28 09:38:23.43 Server      initerrlog: Could not open error log file 'C:
\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'. Operating syste
m error = 32(The process cannot access the file because it is being used by anot
her process.).
2007-02-28 09:38:23.75 Server      Error: 17058, Severity: 16, State: 1.
2007-02-28 09:38:23.75 Server      initerrlog: Could not open error log file 'C:
\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'. Operating syste
m error = 32(The process cannot access the file because it is being used by anot
her process.).
2007-02-28 09:38:24.06 Server      Error: 17058, Severity: 16, State: 1.
2007-02-28 09:38:24.06 Server      initerrlog: Could not open error log file 'C:
\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'. Operating syste
m error = 32(The process cannot access the file because it is being used by anot
her process.).

C:\Program Files\Microsoft SQL Server\MSSQL.2\MSSQL\Binn>
I think it looks interesting from above that even though I run the Command in the MSSQL.2 folder it is trying to access the error log in MSSQL.1 folder; note, both have the sqlservr.exe in them.
Any idea? Also, I executed the commands using Remote Desktop but can do it by sitting on the machine if needed?
Also, the ERRORLOG file in the MSSQL.1 is HUGE: 289 mb! I wonder if the problem has something to do with that?

How many instances of SQL Server do you have installed?

Open Configuration Manager and look at the Services. This will tell you how many instances are installed.

Which instance are you trying to install when you get the error in your original post?
That should have been which instance are you trying to start when you get the error in your original post?
There are two instances. The 2ndOne, though got installed fine and ran fine as a Service, just didn't do what I needed so I have disabled.
Yes, the error I get is and as shown above in the original message is when tryign to launch the Default Instance (MSSQLServer).

I am seriously thinking about uninstalling SQL Server, manually deleting all files in the Program Files -> SQL Server's folders and cleaning up the registry. But please help me before that if you could!!
Open this file in notepad and see what the last time stamp is:

'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'

From the error you are getting it appears that SQL Server is actually running. I am curious to see when the last entry was written.
ERRORLOG is 289 mb!! I tried to open it before but it is too large for NotePad. The last time stamp, as per file Properties is 02/24/07: 4:26 pm--about the time when I first notice the problem/or took action on it. There are two other files with the same timestamp on that folder: log_137.trc and sqlagent.out.
Thanks!
I managed to open the ERRORLOG using Wordpad. Here are the entries from 02/24/07. May be someone trying to hack using the 'sa' account (I don't recognize the CLIENT's IP in this):

------------------
2007-02-24 00:00:03.49 spid17s     This instance of SQL Server has been using a process ID of 2796 since 1/26/2007 12:04:44 PM (local) 1/26/2007 5:04:44 PM (UTC). This is an informational message only; no user action is required.
2007-02-24 01:01:11.63 spid53      Setting database option SINGLE_USER to ON for database monkeyjoes.
2007-02-24 01:01:15.27 spid53      Starting up database 'monkeyjoes'.
2007-02-24 12:37:35.25 Logon       Error: 18456, Severity: 14, State: 8.
2007-02-24 12:37:35.25 Logon       Login failed for user 'sa'. [CLIENT: 90.13.254.228]
2007-02-24 12:37:35.78 Logon       Error: 18456, Severity: 14, State: 8.
2007-02-24 12:37:35.78 Logon       Login failed for user 'sa'. [CLIENT: 90.13.254.228]
2007-02-24 12:37:36.34 Logon       Error: 18456, Severity: 14, State: 8.
2007-02-24 12:37:36.34 Logon       Login failed for user 'sa'. [CLIENT: 90.13.254.228]
2007-02-24 12:37:36.92 Logon       Error: 18456, Severity: 14, State: 8.
2007-02-24 12:37:36.92 Logon       Login failed for user 'sa'. [CLIENT: 90.13.254.228]
2007-02-24 12:37:37.46 Logon       Error: 18456, Severity: 14, State: 8.
2007-02-24 12:37:37.46 Logon       Login failed for user 'sa'. [CLIENT: 90.13.254.228]
2007-02-24 12:37:38.31 Logon       Error: 18456, Severity: 14, State: 8.
2007-02-24 12:37:38.31 Logon       Login failed for user 'sa'. [CLIENT: 90.13.254.228]
2007-02-24 12:37:38.93 Logon       Error: 18456, Severity: 14, State: 8.
2007-02-24 12:37:38.93 Logon       Login failed for user 'sa'. [CLIENT: 90.13.254.228]
2007-02-24 12:37:39.50 Logon       Error: 18456, Severity: 14, State: 8.
2007-02-24 12:37:39.50 Logon       Login failed for user 'sa'. [CLIENT: 90.13.254.228]
2007-02-24 12:37:40.04 Logon       Error: 18456, Severity: 14, State: 8.
2007-02-24 12:37:40.04 Logon       Login failed for user 'sa'. [CLIENT: 90.13.254.228]
2007-02-24 12:37:40.59 Logon       Error: 18456, Severity: 14, State: 8.
2007-02-24 12:37:40.59 Logon       Login failed for user 'sa'. [CLIENT: 90.13.254.228]
2007-02-24 12:37:41.20 Logon       Error: 18456, Severity: 14, State: 8.
2007-02-24 12:37:41.20 Logon       Login failed for user 'sa'. [CLIENT: 90.13.254.228]
2007-02-24 12:37:41.84 Logon       Error: 18456, Severity: 14, State: 8.
2007-02-24 12:37:41.84 Logon       Login failed for user 'sa'. [CLIENT: 90.13.254.228]
2007-02-24 12:37:42.42 Logon       Error: 18456, Severity: 14, State: 8.
2007-02-24 12:37:42.42 Logon       Login failed for user 'sa'. [CLIENT: 90.13.254.228]
2007-02-24 12:37:43.06 Logon       Error: 18456, Severity: 14, State: 5.
2007-02-24 12:37:43.06 Logon       Login failed for user 'admin'. [CLIENT: 90.13.254.228]
2007-02-24 12:37:43.57 Logon       Error: 18456, Severity: 14, State: 5.
2007-02-24 12:37:43.57 Logon       Login failed for user 'admin'. [CLIENT: 90.13.254.228]
2007-02-24 12:37:43.98 Logon       Error: 18456, Severity: 14, State: 5.
2007-02-24 12:37:43.98 Logon       Login failed for user 'admin'. [CLIENT: 90.13.254.228]
2007-02-24 12:40:35.09 Logon       Error: 18456, Severity: 14, State: 5.
2007-02-24 12:40:35.09 Logon       Login failed for user 'admin'. [CLIENT: 90.13.254.228]
2007-02-24 12:40:35.74 Logon       Error: 18456, Severity: 14, State: 5.
2007-02-24 12:40:35.74 Logon       Login failed for user 'admin'. [CLIENT: 90.13.254.228]
2007-02-24 12:40:36.34 Logon       Error: 18456, Severity: 14, State: 5.
2007-02-24 12:40:36.34 Logon       Login failed for user 'admin'. [CLIENT: 90.13.254.228]
2007-02-24 16:26:12.03 Server      SQL Server is terminating because of a system shutdown. This is an informational message only. No user action is required.
2007-02-24 16:26:27.57 Server      The connection has been lost with Microsoft Distributed Transaction Coordinator (MS DTC). Recovery of any in-doubt distributed transactions involving Microsoft Distributed Transaction Coordinator (MS DTC) will begin once the connection is re-established. This is an informational message only. No user action is required.
2007-02-24 16:26:27.73 Server      Error: 17054, Severity: 16, State: 1.
2007-02-24 16:26:27.73 Server      The current event was not reported to the Windows Events log. Operating system error = 31(A device attached to the system is not functioning.). You may need to clear the Windows Events log if it is full.
2007-02-24 16:26:29.03 spid12s     The Database Mirroring protocol transport has stopped listening for connections.
2007-02-24 16:26:29.23 spid12s     Service Broker manager has shut down.
2007-02-24 16:26:43.07 spid4s      SQL Trace was stopped due to server shutdown. Trace ID = '1'. This is an informational message only; no user action is required.
ASKER CERTIFIED SOLUTION
Avatar of rboyd56
rboyd56

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ok...
Exact error as above even after manually setting the start of Service ("...cannot access Errorlog....). Ahh, I guess I am going to uninstall the whole SQL Server, delete files, cleanup registry and try again..
Apparantly, even after deleting the SQL Server's folder/files from the Program Files folder and clearing up -a few- Registry entries, I still can't install: Toward the end of the Installation I get a message: Default Instance is already installed and then the Setup quits!
How can I either COMPLETELY remove all references to SQL Server without reformating or make any new named instance as the default instance? The programming model I use needs Default instance (basically, because I don't know enough about SQL Server).
Any ideas?
Thanks.
It all seems to be working fine: I manually deleted several Registry entries, removed the entire SQL Server folder from the Program Files and then managed to install from CD with the Default instance.

While answers did not lead to the solution they did make me learn a few things I did not know before. Thanks for your help.
I had a very similar issue with the following error (event log):

Description:
The SQL Server (MSSQLSERVER) service terminated with service-specific error 17058 (0x42A2).

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.


Event Type:      Error
Event Source:      MSSQLSERVER
Event Category:      (2)
Event ID:      17058
Date:            19/05/2012
Time:            10:20:14
User:            N/A
Computer:      NSQLXX
Description:
initerrlog: Could not open error log file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'. Operating system error = 5(error not found).
------------------------------------------------------------

In this case the ERRORLOG file had been marked as read only. This was following a scheduled automated boot.

MSSQL wouldn't not start until this file had been changed.