SQL Server LocalDB instance fails to start (automatically)

Multi tool use
Multi tool use


SQL Server LocalDB instance fails to start (automatically)



I have a WPF application which is connecting to the SQL Server 2014 Express LocalDB (i.e. a local .mdf database file).


.mdf



The application uses the Entity Framework Core library version 7.0.0-rc1-final.



This is the connection string that I am using:


data source=(LocalDb)InstanceLocalDB; Initial Catalog = MyAppDB; Integrated Security=True; MultipleActiveResultSets=True; Connection Timeout = 10



I do the installation of the SQL Server LocalDB during the application's setup. The same goes for the creation and starting of the SqlLocalDB Instance, which is performed with this command:


SqlLocalDB


SqlLocalDB.exe create "SqlLocalDBInstance"
SqlLocalDB.exe start "SqlLocalDBInstance"



The app runs successfully on approximately 50 PCs, but fails on two as follows:



At first, the application successfully communicates with the database, but after awhile, if there is no activity, the instance is stopping automatically (after about 10 minutes), and from then it fails to reconnect again, which result in these following error:



Your SQL Server installation is either corrupt or has been tampered with (unknown package id).



On starting the LocalDB instance manually using the same command line mentioned above:


SqlLocalDB.exe start "SqlLocalDBInstance"



the application successfully communicates with the DB, until the next time the LocalDB instance is stopping, and so on.



Windows logs shows this following error:



Windows API call WaitForMultipleObjects returned error code: 575.
Windows system error message is: {Application Error} The application was unable to start correctly (0x%lx). Click OK to close the application.



SQL LocalDB log files provided this notification message:



The RANU instance is terminating in response to its internal time out. This is an informational message only. No user action is required.



I have installed and re-installed all over again (both Microsoft SQL Server 2014 Express as well as deleted the .mdf and .ldf files), and keep getting the same error.


.mdf


.ldf



I noticed that in both of problematic machines the UAC was turned off; so I tried to reproduce the issue on test machines with the UAC turned off - there wasn't any reproduction of the problem.



The 2 problematic machines runs under Windows 10 pro 64bit.



Finally, after further investigation, i found a workaround by renaming the application folder or by changing its location.



How I recognized the solution?



I have relocated the whole application folder (with all of its binaries) outside of the "C:Program Files (x86)"



directory into other directory within the "C:" path, and the problem has gone.



In the same manner, I moved the application folder back to its original location; only now I changed the



name of the application folder, and it worked again.



Maybe the issue is somehow related to the directory permissions.



Nevertheless, i did these steps below, but without any success:



Unchecked the 'Read-only' option for the folder's Attribute.



Enabled all 'Security' permissions for the application folder.



Note: I'm working in an organization domain with all kinds of custom policies...



My next move is to use some utility tool to extract all the permissions of the application folder, and then to try to trace the root of the problem. Can you suggest me some tools for this?





You shouldn't use EF7, that was a very early version not better than an alpha. Get the current EF core version and try again.
– Gert Arnold
Jun 24 at 19:43





Yes, i'm aware of this. The thing is, as i mentioned before, the application runs flawlessly on about 50 machines (with different platforms) for a considerable period of time and there are no issues with the SQL LocalDB there. The error occurs only on those 2 PC's, that i have detected so far. I think if it was an EF7 version problem, the error should have been much more consistent.
– Oleg
Jun 27 at 8:55





2 Answers
2



I had a similar problem regarding permissions of system folders. I used AccessEnum from SysInternals for this task.



See here: https://docs.microsoft.com/en-us/sysinternals/downloads/accessenum



At last I Found the root of the problem.



The issue was with the Compatibility mode of the application's executable file, that was set to "Run this program in compatibility mode for: Windows 8" (under the 'Compatibility' tab within the file's Properties).



Once I removed (unchecked) this option, the error has gone, and the issue was finally closed for me.






By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

3pLW1 FzY,FZTof7O kpXd,Tt2uYW12J,9msE8Yi3csjh,QaT 87,0U,lku MoYbD bFHFEivKNY7Fjy1pOUgj2sT
i5KrYDEDsiE3B4I Kot,xkieL,5erxLOJzwD1n YiT3VpA7KGZV5urt SGH4lMKE5PqVSAvgV

Popular posts from this blog

PHP contact form sending but not receiving emails

Do graphics cards have individual ID by which single devices can be distinguished?

Create weekly swift ios local notifications