SQL SERVER – Event 17058 – initerrlog: Could not Open Error Log File

If you have ever interacted with me or taken my services, you would notice that I always ask for ERRORLOG in almost all of my contact with my client. Once of my friend contacted me and when I asked for ERRORLOG, he informed that there is no ERRORLOG file and SQL is not getting started.  I suggested him that we should analyze event log for further details, after interestingly, we found the following details in the event 17058 about initerrlog: Could not Open Error Log File.

Log Name: Application
Source: MSSQLSERVER
Event ID: 17058
Task Category: Server
Level: Error
Description:
initerrlog: Could not open error log file ”. Operating system error = 3(The system cannot find the path specified.).

We finally found that the error occurs due to the insufficient privilege of SQL Server Service Account in the Log directory: E:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Log

Here is the fix of the issue.

  1. Start SQL Server Configuration manager.
  2. Click to select ‘SQL Server Services’ from the left menu options.
  3. On the right panel, right click on ‘SQL Server (MSSQLSERVER)’ and click ‘Properties’. You may want to choose correct service.
  4. Click ‘Startup Parameters’ tab.
    SQL SERVER - Event 17058 - initerrlog: Could not Open Error Log File initerrlog-01
  1. Note the location after -e parameter.
  2. Browse the Log location ” E:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER \MSSQL\Log”.
  3. Right click on the folder “Log” and click Properties and then to visit to “Security” tab. Now, check SQL Server service account permission on this folder and give proper access to this folder.
  4. Now, Restart the SQL Server service. If you face the same error again, try to change highly privileged service account like “Local System”.

After giving permission, we were able to start the SQL Service. Have you faced a similar error?

Reference: Pinal Dave (https://blog.sqlauthority.com)

SQL Error Messages, SQL Server, SQL Server Management Studio, Starting SQL
Previous Post
SQL SERVER – DMVs to Detect Performance Problems in SQL Server – Notes from the Field #135
Next Post
SQL SERVER – Error: 14258 – Cannot perform this operation while SQLServerAgent is starting. Try again later

Related Posts

11 Comments. Leave new

  • Pinal, I have seen similar errors, although the actual error number may be different, when the server event log is full and the SQL agent cannot write to that log. If that happens, SQL will not start.

    Reply
  • Just yesterday I found this same error while trying to start the server in minimal configuration using the cmd console without having opened it as an administrator.

    Reply
    • Ideally you should use NET START to start SQL service via command prompt. I try avoiding sqlservr.exe because it runs under the context of logged in account not service account.

      Reply
  • An other solution…
    Log on the service on local system…

    Reply
  • Helped me! Thank you!!

    Reply
  • Vaibhav Hantodkar
    March 4, 2019 1:41 am

    There is very simple way to resolve this issue – Just renamed the Log folder and create new one. It should work.

    Reply
  • Michael Munkhof
    June 30, 2020 5:06 am

    I’ve got this issue when attempting to start a cluster node it fails, in effort to troubleshoot I’ve attempted to launch the SQL service through a command prompt opened as the svc_user which normally runs the instans and get the following result:
    2020-06-30 01:15:22.90 Server initerrlog: Could not open error log file ”.
    Operating system error = 3(The system cannot find the path specified.).

    I’ve check the error log path is reachable from the node (cluster shared volumes, so its actually reachable from the secondary cluster node as well).

    I’ve attempted to re-create the log directory as Vaibhav above suggested, ensured the svc_user had full permissions, same result.

    I’ve even gone as far as give the svc_user local administrator and Domain Admin permissions, just to see if there was any difference – none of course.

    I can start the service, but not as a cluster role, using NET START MSSQLSERVER, which would be nice if it was a standalone SQL server and not part of a cluster :-/

    No cluster events related to why it wouldn’t start, I get a short pending, followed by failed.
    And no ERRORLOG at all updated, which fits fine with the initial error concerning not being able to open the error log file/cant find path..

    However when starting the service with NET START MSSQLSERVER, where it gets started by the same svc_user which fails from a command prompt, the ERRORLOG outputs fine and shows all the messages concerning it starting.

    The error started when upgrading a SQL 2016 from SP1 to SP2 CU13. I upgraded the mentioned default instans and a named instance MSSQL, which for some odd reason works all fine and start up wonderfully with it’s cluster-role.

    Suggestions are very welcome!

    Reply
    • Julieta Gonzalez
      August 22, 2020 6:16 am

      I had excatly the same issue, and the fix for that was to add permissions on the registry on the node that is not runing,
      o HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11.\MSSQLServer
      Go to Parameters -> rigth click and select Permissions to grant permissions in there

      this worked for me hope it works also for you

      Reply
    • Thanks Julieta but this didn’t work for me. Michael- did you get a solution?Thankyou!

      Reply

Leave a Reply