question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't stop instance

See original GitHub issue

I would like to delete and recreate my database before running tests.

var localDb = new SqlLocalDbApi();

const string InstanceName = "myDb";

var instance = localDb.GetInstanceInfo(InstanceName);

if (instance.Exists)
{
   if (instance.IsRunning)
   {
      instance.Manage().Stop(); << Exception here
   }

   localDb.DeleteInstance(InstanceName);
}

Message: MartinCostello.SqlLocalDb.SqlLocalDbException : Failed to stop SQL LocalDB instance ‘myDb’. ---- MartinCostello.SqlLocalDb.SqlLocalDbException : Unexpected error occurred inside a LocalDB instance API method call. See the Windows Application event log for error details.

Windows API call LogSqlDiagRec returned error code: 0. Windows system error message is: The operation completed successfully. Reported at line: 3900. [Microsoft][ODBC SQL Server Driver]Cannot initialize SSPI package

“stop” works from the command line.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
AndAShapecommented, Dec 13, 2018

Thanks for the response. It doesn’t matter because I’m only using LocalDb on a build server that is reset for every build.

0reactions
martincostellocommented, Dec 13, 2018

This appears to be an issue with the specific machine installation of SQL LocalDB itself, rather than this library.

I’m afraid I don’t know what’s wrong that’s making the native SQL LocalDB Instance API return an non-success status code, this library is just seeing that and throwing the exception up to the call site.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Stop and start your instance - Amazon Elastic Compute Cloud
Prerequisites for stopping an instance. You can stop an Amazon EBS-backed instance. Instances backed by an instance store volume do not support the...
Read more >
Why is my EC2 instance stuck in the stopping state?
Force stop the instance · Open the Amazon EC2 console. · Select Instances, and then select the stuck instance. · Select Instance state,...
Read more >
EC2 Instance will not stop or terminate after trying to create ...
Force detach the system volume. Then you will be able to stop instance. Re-attach volume and start instance. Viola! Share.
Read more >
Can't stop my AWS EC2 instance properly
You cannot stop EC2 instances that are part of an Auto Scaling group. The best you can do is to edit your Auto...
Read more >
EC2 instance stuck in the stopping state - How to fix
1. Firstly, we have to open the Amazon EC2 console (https://console.aws.amazon.com/ec2/). · 2. Then go to instances and select the stuck instance ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found