Quantcast
Channel: Web Deployment Tool (MS Deploy)
Viewing all articles
Browse latest Browse all 663

msdeploy postsync / runCommand unable to access SQL LocalDb automatic instance

$
0
0

I am using msdeploy to deploy some NUnit tests and the NUnit framework to a remote computer, then I am executing the tests using the nunit-console runner. The tests do database integration tests using SQL Express 2012 LocalDB.

The problem is the tests fail to run with an error:

Warning: Start of LocalDB instance "v11.0" failed because of the following error: Error occurred during LocalDB instance startup: SQL Server process failed to start.

On the remote server Event Viewer I get:

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.
Reported at line: 3621.

If I remote desktop to the server and run the same script by hand (with same credentials) it works just fine. I can stop and start LocalDB etc no problems.

I have googled LocalDB requirements and one thing that catches my eye is the need for the User Profile to be loaded. Does MSDeploy load the user profile for the user that it impersonates when it runs the commands? Is there a way to tell MSDeploy to do so?

Any clues on this?

UPDATE:

I have confirmed by running a combination of the WHOAMI and SET commands in my postsync script that msdeploy agent is definitely running using the right login credentials, but it is using the environment of the LocalSystem account (e.g. USERDOMAIN=NT AUTHORITY USERNAME=LOCAL SERVICE USERPROFILE=C:\Windows\ServiceProfiles\LocalService). Which I suspect LocalDb doesn't like.

I need to find a way to force it to load the user profile for the local user.


Viewing all articles
Browse latest Browse all 663


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>