none
SQL Server not Starting Up - Could not open error log file system error = 5(Access is denied.) RRS feed

  • Question

  • Hi guys,

     I am working on issue with SQL Server 2008 R2 .. we rebooted the server and after that all SQL services is not coming up. below is the error from eventlog...

    SQL Server running under NetworkService account and has full control on this files..

    from Config Manager ....

    The request failed or the service did not respond in a timely fashion....

    From Event log..

    initerrlog: Could not open error log file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG'. Operating system error = 5(Access is denied.).

    Any idea or workaround..?

    Thanks..


    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach


    • Edited by -kit Tuesday, July 29, 2014 5:02 PM
    Tuesday, July 29, 2014 3:52 PM

Answers

  • Finally I found solution and was able to bring back online the SQL Services...

    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.  -This was culprit

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

    http://www.experts-exchange.com/Database/MS-SQL-Server/Q_23951723.html

    Thanks everyone for your kind replies and time...



    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

    • Marked as answer by -kit Tuesday, July 29, 2014 6:30 PM
    Tuesday, July 29, 2014 6:30 PM
  • Hello,

    The SQL Server service account should have full control access or read/write  to that path.

    Hope this helps.

    Regards,

    Alberto Morillo
    SQLCoffee.com

    • Marked as answer by -kit Tuesday, July 29, 2014 6:30 PM
    Tuesday, July 29, 2014 4:01 PM
    Moderator

  • initerrlog: Could not open error log file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG'. Operating system error = 5(Access is denied.).

    Any idea or workaround..?

    Thanks..


    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach


    If you want immediate solution change service account as NT Authority\Local system this would bring services online. But this is not a good solution neither running with Netwoek Service account you should run SQL Server service with low privileged account. Below link would help

    http://msdn.microsoft.com/en-gb/library/ms143504.aspx

    As others have pointed Access denied error means SQL Server service account is lacking permission on folder where Errorlog, data and log file is kept


    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.

    My TechNet Wiki Articles

    • Marked as answer by -kit Tuesday, July 29, 2014 6:31 PM
    Tuesday, July 29, 2014 5:22 PM
    Moderator

All replies

  • Hello,

    The SQL Server service account should have full control access or read/write  to that path.

    Hope this helps.

    Regards,

    Alberto Morillo
    SQLCoffee.com

    • Marked as answer by -kit Tuesday, July 29, 2014 6:30 PM
    Tuesday, July 29, 2014 4:01 PM
    Moderator
  • Your sql server service account should have full permissions on this file/folder.

    Also make sure that it is excluded from any anti virus scanning.

    Did you change the service account by any chance recently?


    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

    Tuesday, July 29, 2014 4:03 PM
  • Nothing is changed recently... 

    SQL Service running under NT AUTHORITY\NetworkService account. and Network Service account has full access to that path..I believe  NT AUTHORITY\NetworkService  is same as Network Service or diff?


    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

    Tuesday, July 29, 2014 4:10 PM
  • Hello,

    Maybe you assigned permissions on that specific folder, but what about the parent folders? What about permissions inheritance? Please examine effective permissions as explained on the following article:

    http://technet.microsoft.com/en-us/library/cc771586.aspx

    Hope this helps.

    Regards,

    Alberto Morillo
    SQLCoffee.com

    Tuesday, July 29, 2014 5:16 PM
    Moderator

  • initerrlog: Could not open error log file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG'. Operating system error = 5(Access is denied.).

    Any idea or workaround..?

    Thanks..


    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach


    If you want immediate solution change service account as NT Authority\Local system this would bring services online. But this is not a good solution neither running with Netwoek Service account you should run SQL Server service with low privileged account. Below link would help

    http://msdn.microsoft.com/en-gb/library/ms143504.aspx

    As others have pointed Access denied error means SQL Server service account is lacking permission on folder where Errorlog, data and log file is kept


    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.

    My TechNet Wiki Articles

    • Marked as answer by -kit Tuesday, July 29, 2014 6:31 PM
    Tuesday, July 29, 2014 5:22 PM
    Moderator
  • Hi Shanky..

     I tried to start up SQL Services with local system and under specific service account. but 

    1) first it not allowing me to change the Service account it gives this error and window get refreshed and shows same service account which I was trying to put. 

    E.g. If I try to change NT AUTHORITY\NetworkService to Localsystem it will throws the below error and widow get refreshed and then it shows log on As LocalSystem

    wmi provider error call to wmi provider returned error code 0x800742a2

    2) when I start services under any account shows original posted error on config manager and event manager. besides all service account has full privilege to that path..


    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

    Tuesday, July 29, 2014 6:00 PM
  • Hello,

    Could you use the following utility to verify WMI is consistent?

    http://www.microsoft.com/en-us/download/details.aspx?id=7684

    Hope this helps.

    Regards,

    Alberto Morillo
    SQLCoffee.com

    Tuesday, July 29, 2014 6:18 PM
    Moderator
  • Finally I found solution and was able to bring back online the SQL Services...

    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.  -This was culprit

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

    http://www.experts-exchange.com/Database/MS-SQL-Server/Q_23951723.html

    Thanks everyone for your kind replies and time...



    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

    • Marked as answer by -kit Tuesday, July 29, 2014 6:30 PM
    Tuesday, July 29, 2014 6:30 PM
  • @LogicinsideCould you please tell me how you checked whether the ERRORLOG file was READ ONLY and how did you change it back to WRITE mode. I'm unable to access the link provided by you.

    Appreciate your help in advance.


    Tuesday, August 11, 2015 10:40 AM
  • If any of the files ERRORLOG to ERRORLOG.6 are read-only, right-click file in Explorer, select properties and uncheck the read-only attribute. Also check permissions in the Security tab. Keep in mind that it is the permissions for the service account for SQL Server you should check.

    Also keep in mind that you can get this error, if an application has any of these files open and locks it.

    Notice that it applies to files from ERRORLOG to ERRORLOG.6, since the last one is to be deleted, ERRORLOG.5 renamed to ERRORLOG.6 and so on.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    • Proposed as answer by MINISHOPAHOLIC Thursday, August 13, 2015 6:40 AM
    Tuesday, August 11, 2015 9:46 PM
  • What tool did you use to change the service account? You need to use the "SQL Server Configuration Manager" tool.

    Tibor Karaszi, SQL Server MVP | web | blog

    • Proposed as answer by MINISHOPAHOLIC Thursday, August 13, 2015 6:40 AM
    Wednesday, August 12, 2015 3:15 PM
    Moderator
  • If any of the files ERRORLOG to ERRORLOG.6 are read-only, right-click file in Explorer, select properties and uncheck the read-only attribute. Also check permissions in the Security tab. Keep in mind that it is the permissions for the service account for SQL Server you should check.

    Also keep in mind that you can get this error, if an application has any of these files open and locks it.

    Notice that it applies to files from ERRORLOG to ERRORLOG.6, since the last one is to be deleted, ERRORLOG.5 renamed to ERRORLOG.6 and so on.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

    Hi Erland, thanks for replying.

    I'll check whether the read only attribute is marked or not and also the security of service account.

    Thanks for suggesting this. I hadn't tried this yet.

    Also, I tried to change the service account to network service/ local service but got wmi error - WMI Provider Error [call to WMI Provider returned error code 0x800742a2]

    Any idea what's wrong?

    I used SQL server configuration manager to change the service account.

    Wednesday, August 12, 2015 6:00 PM
  • What tool did you use to change the service account? You need to use the "SQL Server Configuration Manager" tool.

    Tibor Karaszi, SQL Server MVP | web | blog

    Hi Tibor, thanks for replying.

    I used SQL server configuration manager only to change the service account. But it didn't let me change it and gave wmi error - WMI Provider Error [call to WMI Provider returned error code 0x800742a2] 

    Any idea what's wrong?


    Wednesday, August 12, 2015 6:04 PM
  • I would do a machine level backup at this stage, and then use SQL Server setup program to "Repair" the installation. Perhaps that will sort out the WMI issues...

    Tibor Karaszi, SQL Server MVP | web | blog

    Wednesday, August 12, 2015 7:51 PM
    Moderator
  • In addition to Tibor's post, all I can say is that the WMI errors are not any fun to sort out... Thankfully, I never encountered them myself.


    Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
    Wednesday, August 12, 2015 9:11 PM
  • Hi Tibor and Erland,

    The issue is resolved now. The ERRORLOG while was marked as READ-ONLY.  I unchecked it and then tried to start sql services from sql configuration manager and BINGO they were up like magic. :)

    Thank you very much for providing so many solutions. I learned a lot in the process. :)

    For anyone else who encounters this error -

    I would suggest you guys to check the ERRORLOG file's property first to ensure its not marked as read-only and then only move on to some other solution. :)

    • Proposed as answer by RamPratap Yadav Saturday, September 15, 2018 3:12 AM
    • Unproposed as answer by RamPratap Yadav Saturday, September 15, 2018 3:12 AM
    Thursday, August 13, 2015 6:45 AM
  • Hi All,

    I also faced same issue ,SQL Service was not starting .

    I have added my domain\userid and service account DomainName\ServiceAccount (used for sql server service) in Administrators Group and re tried to start MSSQLService, issue resolved .

    Thanks,

    RamPratap Yadav

    Saturday, September 15, 2018 3:17 AM