I’m new to SQL Server and encountering an error when running sqlservr.exe
(Microsoft® SQL Server® 2008 R2 SP2 — Express Edition)
Error 17058, Severity: 16, State: 1.
initerrlog: Could not open error log file ».
Operating System Error = 3 (The system cannot find the path specified.).
Here are my startup parameters:
-dc:Program Files (x86)Microsoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLDATAmaster.mdf;
-ec:Program Files (x86)Microsoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLLogERRORLOG;
-lc:Program Files (x86)Microsoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLDATAmastlog.ldf
I’ve also made sure that all users have full control access and removed read-only permission from folders
Thanks!
asked Aug 29, 2015 at 7:44
0
I face the same problem after windows update on our server. Resolved with these steps.
- rename or delete ERRORLOG file found in below directory
c:Program Files (x86)Microsoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLLog
- start service
I think the file corrupted. When I change the name, it created a new file.
answered May 17, 2017 at 10:36
I faced this EXACT issue two weeks ago. The resolution I found myself was that when you goto CMD prompt do not just open it, right click and say RUN AS ADMINISTRATOR. Then start SQL Server as you state. It will work that way. Security on WIn2008 is tighter and you have to do the RUN AS ADMIN for it to work correctly.
answered Jun 20, 2017 at 5:46
Rylan08Rylan08
1061 silver badge5 bronze badges
1
I’m new to SQL Server and encountering an error when running sqlservr.exe
(Microsoft® SQL Server® 2008 R2 SP2 — Express Edition)
Error 17058, Severity: 16, State: 1.
initerrlog: Could not open error log file ».
Operating System Error = 3 (The system cannot find the path specified.).
Here are my startup parameters:
-dc:Program Files (x86)Microsoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLDATAmaster.mdf;
-ec:Program Files (x86)Microsoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLLogERRORLOG;
-lc:Program Files (x86)Microsoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLDATAmastlog.ldf
I’ve also made sure that all users have full control access and removed read-only permission from folders
Thanks!
asked Aug 29, 2015 at 7:44
0
I face the same problem after windows update on our server. Resolved with these steps.
- rename or delete ERRORLOG file found in below directory
c:Program Files (x86)Microsoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLLog
- start service
I think the file corrupted. When I change the name, it created a new file.
answered May 17, 2017 at 10:36
I faced this EXACT issue two weeks ago. The resolution I found myself was that when you goto CMD prompt do not just open it, right click and say RUN AS ADMINISTRATOR. Then start SQL Server as you state. It will work that way. Security on WIn2008 is tighter and you have to do the RUN AS ADMIN for it to work correctly.
answered Jun 20, 2017 at 5:46
Rylan08Rylan08
1061 silver badge5 bronze badges
1
WRITE FOR US
Scenario: Created a VPC using Oracle VM VirtualBox. Installed SQL Server 2008 using local user accounts. While installing AX 2012, it fails because VPC machine is not in domain. So I ran dcpromo to install domain controller, and created a domain. With this installation and configuration, restarted the machine and then logged on as domain administrator. Noticed that SQL Services (MSSQLServer) is stopped. SQL Server Agent is stopped. Surely because earlier these were installed using local service account user. And now since those users are now part of CORP domain so authentication permission is invalid. I changed the logon permission but still it was not starting. Consistently getting this error in the event log.
Error: initerrlog: Could not open error log file ”. Operating system error = 3(The system cannot find the path specified.).
Troubleshooting and Solution:
Looked to the error again with special attention, it is saying “Could not open error log file ”. ” Well… where is the error file, how will I know.
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’.
4. Click ‘Advanced’ tab.
5. Scroll down and copy the value stored for ‘Startup Parameters’. Paste these on notepate. It will be something like this (as I installed SQL Server on D: drive):
-dD:Program FilesMicrosoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLDATAmaster.mdf;-eD:Program FilesMicrosoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLLogERRORLOG;-lD:Program FilesMicrosoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLDATAmastlog.ldf
6. Notice the highlighted section. Browse to the location “D:Program FilesMicrosoft SQL ServerMSSQL10_50.MSSQLSERVERMSSQLLog“.
7. Right click to open ‘Log’ Properties and then to visit to ‘Security’ tab. Now there are couple of user and group names in the top panel. For example, CREATED OWNER, SYSTEM, SQLServerMSSQLUsers$<Machine>$<SQLInstance>(<Domain>SQLServerMSSQLUsers$<Machine>$<SQLInstance>) and so on.
This SQLServerMSSQLUsers$<Machine>$<SQLInstance> has permission on the folder. And we need to make sure that our service account which is CORPsvcsqluser is part of this group.
8. Click Start -> Administrative Tools -> Active Directory Users and Computers.
9. Search and open group SQLServerMSSQLUsers$<Machine>$<SQLInstance>. Browse to ‘Members’ tab, and add ‘CORPsvcsqluser’ account in there.
10. Go back to SQL Server Configuration Properties window, and right click and start the service. It will work.
Additionally, there are other SQLServer groups too, for example, SQLServerReportServerUser, SQLServerSQLAgentUser, SQLServerMSASUser and so on… add corresponding service account to each of these groups under ‘Member’ tab.
This solution is specific to the scenario I have given. It may or may not be right solution for other scenarios.
About Atul Shukla
Dynamics AX 365 for Operations based data migrations, synchronous and asynchronous integrations, extending data entities and customizing entities for data migrations and integrations. I am into Microsoft Dynamics AX 2012 data migration using SQL Server and DIXF framework. SharePoint is my part time passion where I get involved in designing of SharePoint Branding, Designing and challenging website issues where I then involve and brush up my troubleshooting skills using PowerShell. The blog has articles about the issues that I face randomly followed by the fixes. SharePoint 2010 works pretty differently when it integrates with Dynamics AX 2012/2009, BizTalk EDI Processes. Dynamics AX Reporting is also interesting so I do SSRS installation, configuration for Enterprise Portal and Role centers. Pretty interesting stuff — keeping me engaged all the time.
I am trying to start SQL Server(SQLEXPRESS) service from Sql Server Configuration Manager. I got following error:
The request failed or the service did not respond in a timely fashion. Consult the event log or other application error logs for details.
I checked out error logs. Here is the error:
initerrlog: Could not open error log file ‘C:Program FilesMicrosoft SQL ServerMSSQL10.SQLEXPRESSMSSQLLogERRORLOG’. Operating system error = 3
How can I achieve this?
marc_s
722k173 gold badges1320 silver badges1443 bronze badges
asked Aug 1, 2013 at 17:59
Umut DerbentoğluUmut Derbentoğlu
1,1165 gold badges18 silver badges39 bronze badges
0
You need to make sure that the account SQL Server is operating under has write permissions to 'C:Program FilesMicrosoft SQL ServerMSSQL10.SQLEXPRESSMSSQLLog
, after you’ve verified that the directory actually exists.
First go to Services (Control Panel/Administrative Tools/Services) and check which account SQL Server is running under. Probably NT ServiceMSSQL$SQLEXPRESS
Then go to ‘C:Program FilesMicrosoft SQL ServerMSSQL10.SQLEXPRESSMSSQL’ and right click on the «Log» folder and click properties. Then go to the Security Page. If MSSQL$SQLEXPRESS
is listed, ensure that it has «Full Control» if it doesn’t, click the «Edit» button and give it full control. If it’s not listed, click «Edit» and then on the «Permissions for Log» dialog click add and add MSSQL$SQLEXPRESS
.
answered Aug 1, 2013 at 18:06
3
Introduction
ALWAYS start SQL Server engine on Linux with the account mssql
.
mssql@vps$ sudo systemctl start|stop mssql-server
NEVER RUN directly the binary sqlservr
as root
, for example :
root@vps$ /opt/mssql/bin/sqlsrvr
Indeed, the engine can not then restart normally with the user mssql
.
mssql@vps$ sudo systemctl start mssql-server
● mssql-server.service - Microsoft SQL Server Database Engine Loaded: loaded (/lib/systemd/system/mssql-server.service; disabled; vendor preset: enabled) Active: failed (Result: exit-code) since Fri 2019-05-31 18:57:06 CEST; 4min 7s ago Docs: https://docs.microsoft.com/en-us/sql/linux Process: 15259 ExecStart=/opt/mssql/bin/sqlservr (code=exited, status=1/FAILURE)
Diagnosing and troubleshooting the issue
SQL Server creates hidden binary system files (*.hiv
) in the directory /var/opt/mssql/.system/system
. Their usage is not documented.
mssql@vps$ ls -lrt /var/opt/mssql/.system/system
-rw-r----- 1 mssql mssql 8192 May 31 18:44 licensing.hiv -rw-rw---- 1 mssql mssql 49152 May 31 15:40 security.hiv -rw-rw---- 1 mssql mssql 16384 May 31 15:40 lsa.hiv
When running inadvertently SQL Server as root
, permissions are modified for these files :
mssql@vps$ ls -lrt /var/opt/mssql/.system/system
-rw-r----- 1 mssql mssql 8192 Jun 6 18:44 licensing.hiv -rw-r----- 1 root root 49152 Jun 18 18:59 security.hiv -rw-r----- 1 root root 16384 Jun 18 18:59 lsa.hiv
That’s why, at the next startup, SQL Server engine does not start, the user mssql
is not allowed to read/write these *.hiv
files.
The information is available in the crash dump files generated :
Reason: 0x00000007
Status: 0xc0000218
Message: Cannot open or read the persistent registry: SystemRootsecurity.hiv.
By default crash dump files are located in the directory /var/opt/mssql/log/
, otherwise in the directory specified with
the directive defaultdumpdir
in the configuration file /var/opt/mssql/mssql.conf
.
mssql@vps$ /opt/mssql/bin/mssql-conf get filelocation defaultdumpdir
defaultdumpdir : /opt/mssql/dba/srvmssql/crashdump
So, as root
, reset the owner for these files to mssql
:
root@vps$ cd /var/opt/mssql/.system/system
root@vps$ chown mssql:mssql security.hiv
root@vps$ chown mssql:mssql lsa.hiv
Unfortunately, the service mssql-server
still does not start. Same issue than the one with the *.hiv
files,
ensure that the owner of the SQL Server and SQL Server agent log files is not root
(default directory /var/opt/mssql/log
) :
-rw-r----- 1 root root 14357 May 31 19:50 errorlog
-rw-r----- 1 root root 6694 May 31 19:50 sqlagent.log
When attempting to recycle error log files, the error «Access is denied» is encountered by the engine and the engine shutdowns. To check that’s the case, as mssql
:
mssql@vps$ /opt/mssql/bin/sqlservr
2019-05-31 21:04:22.58 Server Error: 17058, Severity: 16, State: 1. 2019-05-31 21:04:22.58 Server initerrlog: Could not open error log file '/opt/mssql/dba/srvmssql/log/errorlog'. Operating system error = 5(Access is denied.). 2019-05-31 21:04:22.88 Server Error: 17058, Severity: 16, State: 1. 2019-05-31 21:04:22.88 Server initerrlog: Could not open error log file '/opt/mssql/dba/srvmssql/log/errorlog'. Operating system error = 5(Access is denied.).
As root
, modify the owner of the impacted error log files to mssql
:
root@vps$ chown mssql:mssql errorlog
root@vps$ chown mssql:mssql sqlagent.log
Now the service mssql-server
starts successfully :
mssql@vps$ sudo systemctl start mssql-server mssql@vps$ systemctl status mssql-server
● mssql-server.service - Microsoft SQL Server Database Engine Loaded: loaded (/lib/systemd/system/mssql-server.service; disabled; vendor preset: enabled) Active: active (running) since Fri 2019-05-31 22:33:28 CEST; 1min 31s ago
Conclusion
Is there any need of a conclusion ? Obvious conclusion : use root
connections only when necessary and close these connections
as soon as they are not needed anymore.