SSMS automatically restarts after I close it

irisoftirisoft Posts: 13 Bronze 2
edited January 19, 2024 3:00PM in SQL Source Control
Hello.
When I close SSMS (latest - 19.3) it automatically restarts instead of staying closed. In Windows Logs I see 3 errors: 

Warning 1 - SSMS Integration Pack 3

ngWrapper.LogManager
#1:Unhandled Exception: Object reference not set to an instance of an object..  IsTerminating : True
System.NullReferenceException: Object reference not set to an instance of an object.
   at RedGate.SQLSourceControl.Engine.LinkedDatabaseStore.TryGetLinkedDatabase(DatabaseId databaseId, ILinkedDatabase& linkedDatabase)
   at RedGate.SQLSourceControl.Engine.Diff.LinkedDatabaseConfigStore.TryGetLinkedDatabase(DatabaseId databaseId, ILinkedDatabase& linkedDatabase)
   at RedGate.SQLSourceControl.Engine.Diff.LinkedDatabaseConfigStore.TryGetLinkedDatabase(DatabaseId databaseId, ILinkedDatabaseDetails& linkedDatabase)
   at RedGate.SQLSourceControl.Engine.Diff.Controller.TryGetLinkedDatabase(DatabaseId databaseId, ILinkedDatabaseDetails& linkedDatabase)
   at RedGate.SQLSourceControl.CommonUI.DatabaseViewController.TryGetCurrentLinkedDatabase(ILinkedDatabaseDetails& linkedDatabase)
   at RedGate.SQLSourceControl.CommonUI.DatabaseViewController.get_IsFlywayProject()
   at RedGate.SQLSourceControl.CommonUI.ViewController.get_IsFlywayProject()
   at RedGate.SQLSourceControl.CommonUI.Controls.DatabaseAndBranchNameControl.UpdateFlywayWarningVisibility()
   at RedGate.SQLSourceControl.CommonUI.Controls.Commit.ToCommitTabControl.EnableControls(Boolean haveSelectedChanges)
   at RedGate.SQLSourceControl.CommonUI.Controls.Commit.ToCommitTabControl.OperationChanged(Object sender, EventArgs e)
   at RedGate.SQLSourceControl.CommonUI.Controls.ChangeSetViewerControl.RefreshChangeSet()
   at RedGate.SQLSourceControl.CommonUI.Controls.ChangeSetViewerControl.ManagedVisibleChanged(Object sender, EventArgs e)
   at System.EventHandler.Invoke(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnVisibleChanged(EventArgs e)
   at System.Windows.Forms.ScrollableControl.OnVisibleChanged(EventArgs e)
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

Error 2 - .NET Runtime

Application: Ssms.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
   at RedGate.SQLSourceControl.Engine.LinkedDatabaseStore.TryGetLinkedDatabase(RedGate.SQLSourceControl.Engine.Model.Comparison.DatabaseId, RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabase ByRef)
   at RedGate.SQLSourceControl.Engine.Diff.LinkedDatabaseConfigStore.TryGetLinkedDatabase(RedGate.SQLSourceControl.Engine.Model.Comparison.DatabaseId, RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabase ByRef)
   at RedGate.SQLSourceControl.Engine.Diff.LinkedDatabaseConfigStore.TryGetLinkedDatabase(RedGate.SQLSourceControl.Engine.Model.Comparison.DatabaseId, RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabaseDetails ByRef)
   at RedGate.SQLSourceControl.Engine.Diff.Controller.TryGetLinkedDatabase(RedGate.SQLSourceControl.Engine.Model.Comparison.DatabaseId, RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabaseDetails ByRef)
   at RedGate.SQLSourceControl.CommonUI.DatabaseViewController.TryGetCurrentLinkedDatabase(RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabaseDetails ByRef)
   at RedGate.SQLSourceControl.CommonUI.DatabaseViewController.get_IsFlywayProject()
   at RedGate.SQLSourceControl.CommonUI.ViewController.get_IsFlywayProject()
   at RedGate.SQLSourceControl.CommonUI.Controls.DatabaseAndBranchNameControl.UpdateFlywayWarningVisibility()
   at RedGate.SQLSourceControl.CommonUI.Controls.Commit.ToCommitTabControl.EnableControls(Boolean)
   at RedGate.SQLSourceControl.CommonUI.Controls.Commit.ToCommitTabControl.OperationChanged(System.Object, System.EventArgs)
   at RedGate.SQLSourceControl.CommonUI.Controls.ChangeSetViewerControl.RefreshChangeSet()
   at RedGate.SQLSourceControl.CommonUI.Controls.ChangeSetViewerControl.ManagedVisibleChanged(System.Object, System.EventArgs)
   at System.EventHandler.Invoke(System.Object, System.EventArgs)
   at System.Windows.Forms.Control.OnVisibleChanged(System.EventArgs)
   at System.Windows.Forms.ScrollableControl.OnVisibleChanged(System.EventArgs)
   at System.Windows.Forms.Control.WmShowWindow(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.ScrollableControl.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr, Int32, IntPtr, IntPtr)

Error 3 - Application Error

Faulting application name: Ssms.exe, version: 2024.190.3.4, time stamp: 0x659e4c7f
Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
Exception code: 0xc0000005
Fault offset: 0x3f23775f
Faulting process id: 0x0x5F08
Faulting application start time: 0x0x1DA4AE3A114B8A6
Faulting application path: C:\Program Files (x86)\Microsoft SQL Server Management Studio 19\Common7\IDE\Ssms.exe
Faulting module path: unknown
Report Id: 48740288-d50b-4570-b00a-61419766be6f
Faulting package full name: 
Faulting package-relative application ID: 


It appears to be linked to SQL Source Control. I have the latest version of it (SQLSourceControl_7.7.1.18312.exe). I also have the latest version of SQL Prompt. I uninstalled/reinstalled SQL Source Control.
The weird restart happens when I have at least 2 instances of SSMS opened and I close one of them that had a procedure (or any object) opened.
I always have multiple SSMS instances opened. If I close more instances all of them are restarting. It's very annoying.

Thank you.

Later edit: it happens even if I have only one instance of SSMS with a procedura opened even if I don't modify anything and that database is not under source control.
Tagged:
«1

Answers

  • Hi @irisoft

    Thanks for all of the information. 

    I've tried replicating this on a fresh install of SSMS 19.3 as well as installing SQL Prompt and SQL Source Control. I opened multiple stored procedures across the two instances I had open, but upon closing, nothing strange was occurring for me.

    I can't say exactly why you're having this issue, but it might be worth trying to cleanly uninstall SQL Source Control as well as SSMS. This can help ensure that all components are correctly removed. Afterwards, try restarting your machine and cleanly installing SSMS 19.3 and the Redgate products.

    Kind regards,

    Kurt McCormick
    Product Support Engineer, Redgate

    Need help? Take a look at our Help Center

  • irisoftirisoft Posts: 13 Bronze 2
    Hi @Kurt_M

    Thank you for your answer. I uninstalled all Redgate products and SSMS, restarted and installed everything back. The result is the same.

    I uninstalled SQL Source Control 7.7.1 and installed 7.6.34 - same error. I installed version 7.6.28 and it works. So, the error appeared somewhere between 7.6.28 and 7.6.34. I don't have all the versions in between (probably missed them in december).

    If you can check the changes between these versions related to the error in the first post (RedGate.SQLSourceControl.Engine.LinkedDatabaseStore.TryGetLinkedDatabase) maybe you can add a try-catch or a null check or something to prevent that exception.

    For now, I will stay on version 7.6.28 and I will try on a future version to see if the error disappears.

    Thank you.

  • TonyRMTTonyRMT Posts: 3 New member
    Is there a planned fix for this? It's very annoying and been happening for a few weeks now!
  • CHPCHP Posts: 6 Bronze 2
    edited March 18, 2024 4:12PM
    I am seeing this same error as well. I deleted some previously linked databases recently because I no longer needed to track them... could this be a problem?
  • SURSUR Posts: 2 Bronze 1
    I'm getting this as well. At the end of the day I want to get away but when I close SSMS, it restarts itself. It's super annoying, please fix!!
  • kalokalo Posts: 89 Bronze 5
    I have this issue as well. I'm in the habit of closing down my SSMS periodically and reopening to start afresh on a separate piece of work. Wondering why i've got 2 SSMS instances open. And it appears that the closure is prompting a delayed restart of SSMS.
  • MartinP_UKMartinP_UK Posts: 2 New member
    Also seeing this issue after installing SSMS 19.3 (uninstalled Redgate Toolkit and reinstalled to get the extensions in 19.3)
  • Mike_BMike_B Posts: 1 Bronze 1
    This started happening to me also a few weeks ago.  I close SSMS, and after a delay of a minute or two it restarts.  When I close it a second time it then stays down for the count.

    Windows 10 on an oldish computer.
    SSMS 17.9.1.
    SQL Prompt 10.14.10.7538, along with other Toolbelt utilities updated at the same time.

    And here's another observation that may mean something:  when I first start SSMS it starts up normally; but when it is restarting itself it is a resource hog and interferes with normal responsiveness of other programs.

    It's not the end of the world, but it is a bit annoying when it starts back up as I want to go home, or if I'm in a hurry for other programs to respond.
  • kalokalo Posts: 89 Bronze 5
    edited April 5, 2024 12:13PM
    So having moved off SSMS 18.12 to 19.3 prompted by this issue, I've updated SQL Prompt today and now introduced this issue into 19.3

    Ironically, because i'm now on 19.3 and having to uninstall and re-install redgate products to get them to show in the new version, I am prompted to close SSMS to allow the update, but after you close SSMS you actually see the second SSMS instance in the 'Quit applications' screen. And have to go and close that as well before being able to install.



    Is there a fix in the works for this issue raised at the start of this year?
  • AdievoAdievo Posts: 3 New member
    im getting a similar effect where ssms always restarts when closing and loses some of my history.  my log error is slightly different tho:

    Application: Ssms.exe
    Framework Version: v4.0.30319
    Description: The process was terminated due to an unhandled exception.
    Exception Info: System.NullReferenceException
       at RedGate.SQLSourceControl.Engine.LinkedDatabaseStore.TryGetLinkedDatabase(RedGate.SQLSourceControl.Engine.Model.Comparison.DatabaseId, RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabase ByRef)
       at RedGate.SQLSourceControl.Engine.Diff.LinkedDatabaseConfigStore.TryGetLinkedDatabase(RedGate.SQLSourceControl.Engine.Model.Comparison.DatabaseId, RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabase ByRef)
       at RedGate.SQLSourceControl.Engine.Diff.LinkedDatabaseConfigStore.TryGetLinkedDatabase(RedGate.SQLSourceControl.Engine.Model.Comparison.DatabaseId, RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabaseDetails ByRef)
       at RedGate.SQLSourceControl.Engine.Diff.Controller.TryGetLinkedDatabase(RedGate.SQLSourceControl.Engine.Model.Comparison.DatabaseId, RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabaseDetails ByRef)
       at RedGate.SQLSourceControl.CommonUI.DatabaseViewController.TryGetCurrentLinkedDatabase(RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabaseDetails ByRef)
       at RedGate.SQLSourceControl.CommonUI.DatabaseViewController.get_IsFlywayProject()
       at RedGate.SQLSourceControl.CommonUI.ViewController.get_IsFlywayProject()
       at RedGate.SQLSourceControl.CommonUI.Controls.DatabaseAndBranchNameControl.UpdateFlywayWarningVisibility()
       at RedGate.SQLSourceControl.CommonUI.Controls.Commit.ToCommitTabControl.EnableControls(Boolean)
       at RedGate.SQLSourceControl.CommonUI.Controls.Commit.ToCommitTabControl.OperationChanged(System.Object, System.EventArgs)
       at RedGate.SQLSourceControl.CommonUI.Controls.ChangeSetViewerControl.RefreshChangeSet()
       at RedGate.SQLSourceControl.CommonUI.Controls.ChangeSetViewerControl.ManagedVisibleChanged(System.Object, System.EventArgs)
       at System.EventHandler.Invoke(System.Object, System.EventArgs)
       at System.Windows.Forms.Control.OnVisibleChanged(System.EventArgs)
       at System.Windows.Forms.ScrollableControl.OnVisibleChanged(System.EventArgs)
       at System.Windows.Forms.Control.WmShowWindow(System.Windows.Forms.Message ByRef)
       at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
       at System.Windows.Forms.ScrollableControl.WndProc(System.Windows.Forms.Message ByRef)
       at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)

  • mikegalushamikegalusha Posts: 4 Bronze 1
    edited April 10, 2024 5:15PM
    This occurs 100% of the time on my machine as well, SSMS 19.3.4.0, SQL Prompt 10.14.12.7945, super annoying. Hmm, I didn't realize the thread was for source control. Will uninstall and test.
  • BowmanBowman Posts: 4 New member
    I'm seeing this as well:

    Windows 10
    SSMS 20.0.70.0
    SQL Source Control 7.7.9.18623
  • SeanBSeanB Posts: 2 Bronze 1
    I have been having this problem too for a few months.

    Today I upgraded from SSMS 19.3 to SSMS 20.1 (Windows 11 box). Although SSMS is supposed to import options and customisations, it definitely doesn't do them all - including toolbars. I like my toolbars to have my most used tools and not filled with stuff I don't want.

    So I modified the toolbars to the way I wanted, then exited out of SSMS. Unfortunately, SSMS automatically restarted (again) and the toolbars had all reverted (or, more specifically, nothing had been saved).

    After various fumbling about, I found a workaround how to stop this happening:
    • Disconnect from all servers before exiting SSMS. 

    The object explorer should be empty. This will stop SSMS restarting, and also allow you to save changes to toolbars (and perhaps other things).

    (Note that it seems to be OK if you didn't actually open any databases, but if you have opened a database, then disconnecting from the server, before exiting SSMS, allows you to exit without restarting).


  • mcookmcook Posts: 3 New member
    I'm having the same issues after upgrading to SSMS 20.1. Didn't happen with SSMS 19. Suuuuuper annoying. Can confirm that disconnecting from the server works.
  • shauntorresshauntorres Posts: 1 New member
    This is a consistent problem.
    Is there a plan to fix this?
    Is there any response from Redgate on this issue?
  • AngeloCecAngeloCec Posts: 1 New member
    Same issue here!

  • TonyRMTTonyRMT Posts: 3 New member
    Redgate is ignorant on this issue. No update whatsoever whether they are planning to fix it or not...
    Very annoying!
  • scollisscollis Posts: 32 Bronze 3
    Upgraded yesterday and this has started happening for me as well.
  • pmclcipmclci Posts: 1 New member
    Add me to the list.
  • jembreejembree Posts: 2 New member
    Add another one to the list here. Sean B's  work around of closing connections before closing program seems to work. 

    SeanB said:
    I have been having this problem too for a few months.

    Today I upgraded from SSMS 19.3 to SSMS 20.1 (Windows 11 box). Although SSMS is supposed to import options and customisations, it definitely doesn't do them all - including toolbars. I like my toolbars to have my most used tools and not filled with stuff I don't want.

    So I modified the toolbars to the way I wanted, then exited out of SSMS. Unfortunately, SSMS automatically restarted (again) and the toolbars had all reverted (or, more specifically, nothing had been saved).

    After various fumbling about, I found a workaround how to stop this happening:
    • Disconnect from all servers before exiting SSMS. 

    The object explorer should be empty. This will stop SSMS restarting, and also allow you to save changes to toolbars (and perhaps other things).

    (Note that it seems to be OK if you didn't actually open any databases, but if you have opened a database, then disconnecting from the server, before exiting SSMS, allows you to exit without restarting).


  • mmooremmoore Posts: 42 Bronze 4
    This is happening to me as well, even on servers that have no linked database so source control.  What sucks, is all the remembered tabs are closed as well.   
    Mark Moore
    Software Engineer
    NTS Data Services, LLC
  • mmooremmoore Posts: 42 Bronze 4
    so, is this a SSMS issue or a Red-Gate issue?
    jembree said:
    Add another one to the list here. Sean B's  work around of closing connections before closing program seems to work. 

    SeanB said:
    I have been having this problem too for a few months.

    Today I upgraded from SSMS 19.3 to SSMS 20.1 (Windows 11 box). Although SSMS is supposed to import options and customisations, it definitely doesn't do them all - including toolbars. I like my toolbars to have my most used tools and not filled with stuff I don't want.

    So I modified the toolbars to the way I wanted, then exited out of SSMS. Unfortunately, SSMS automatically restarted (again) and the toolbars had all reverted (or, more specifically, nothing had been saved).

    After various fumbling about, I found a workaround how to stop this happening:
    • Disconnect from all servers before exiting SSMS. 

    The object explorer should be empty. This will stop SSMS restarting, and also allow you to save changes to toolbars (and perhaps other things).

    (Note that it seems to be OK if you didn't actually open any databases, but if you have opened a database, then disconnecting from the server, before exiting SSMS, allows you to exit without restarting).



    Mark Moore
    Software Engineer
    NTS Data Services, LLC
  • mmooremmoore Posts: 42 Bronze 4
    Here is my Error log from Event Viewer.

    Application: Ssms.exe
    Framework Version: v4.0.30319
    Description: The process was terminated due to an unhandled exception.
    Exception Info: System.NullReferenceException
       at RedGate.SQLSourceControl.Engine.LinkedDatabaseStore.TryGetLinkedDatabase(RedGate.SQLSourceControl.Engine.Model.Comparison.DatabaseId, RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabase ByRef)
       at RedGate.SQLSourceControl.Engine.Diff.LinkedDatabaseConfigStore.TryGetLinkedDatabase(RedGate.SQLSourceControl.Engine.Model.Comparison.DatabaseId, RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabase ByRef)
       at RedGate.SQLSourceControl.Engine.Diff.LinkedDatabaseConfigStore.TryGetLinkedDatabase(RedGate.SQLSourceControl.Engine.Model.Comparison.DatabaseId, RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabaseDetails ByRef)
       at RedGate.SQLSourceControl.Engine.Diff.Controller.TryGetLinkedDatabase(RedGate.SQLSourceControl.Engine.Model.Comparison.DatabaseId, RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabaseDetails ByRef)
       at RedGate.SQLSourceControl.CommonUI.DatabaseViewController.TryGetCurrentLinkedDatabase(RedGate.SQLSourceControl.Engine.Interfaces.Comparison.ThreeDatabase.ILinkedDatabaseDetails ByRef)
       at RedGate.SQLSourceControl.CommonUI.DatabaseViewController.get_IsFlywayProject()
       at RedGate.SQLSourceControl.CommonUI.ViewController.get_IsFlywayProject()
       at RedGate.SQLSourceControl.CommonUI.Controls.DatabaseAndBranchNameControl.UpdateFlywayWarningVisibility()
       at RedGate.SQLSourceControl.CommonUI.Controls.Commit.ToCommitTabControl.EnableControls(Boolean)
       at RedGate.SQLSourceControl.CommonUI.Controls.Commit.ToCommitTabControl.OperationChanged(System.Object, System.EventArgs)
       at RedGate.SQLSourceControl.CommonUI.Controls.ChangeSetViewerControl.RefreshChangeSet()
       at RedGate.SQLSourceControl.CommonUI.Controls.ChangeSetViewerControl.ManagedVisibleChanged(System.Object, System.EventArgs)
       at System.EventHandler.Invoke(System.Object, System.EventArgs)
       at System.Windows.Forms.Control.OnVisibleChanged(System.EventArgs)
       at System.Windows.Forms.ScrollableControl.OnVisibleChanged(System.EventArgs)
       at System.Windows.Forms.Control.WmShowWindow(System.Windows.Forms.Message ByRef)
       at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
       at System.Windows.Forms.ScrollableControl.WndProc(System.Windows.Forms.Message ByRef)
       at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
       at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr, Int32, IntPtr, IntPtr)


    I have submitted a bug to Red-Gate with this same error.
    Mark Moore
    Software Engineer
    NTS Data Services, LLC
  • AdievoAdievo Posts: 3 New member
    is anyone trying to fix this?
  • mmooremmoore Posts: 42 Bronze 4
    edited July 22, 2024 5:32PM
    Adievo said:
    is anyone trying to fix this?
    I was told to update to the latest SQL Source Control version, which I am going to do later today to find out if this fixes the problem (7.7.17.19083).. What is funny though, when you do "Check for update" in Sql Source Control, it says there are no updates, and I am currently on (7.7.10.18663)
    Mark Moore
    Software Engineer
    NTS Data Services, LLC
  • Hi - I just wanted to let you know that we are looking at this problem, but we're currently unable to reproduce it. We'll update you as soon as we have any more information.
    Development Lead
    Redgate Software
  • JlynnJlynn Posts: 1 New member
    Contact me if you want to see it happen in real time.  It is very annoying.  It has been an issue on both my current and previous laptops.
  • Hi, we have now released the following version 7.7.18.19115 which should hopefully solve the restart after shutdown issue

    Please let us know if this helps! 

    Kind regards

    Dan Calver | Redgate Software
    Have you visited our 
    Help Center?

  • mmooremmoore Posts: 42 Bronze 4
    The first fix they gave me about a week ago did not solve the problem, but it seems to aggravate it even more.  I just downloaded the newest version now and will test it shortly.
    Mark Moore
    Software Engineer
    NTS Data Services, LLC
  • AdievoAdievo Posts: 3 New member
    7.7.18.19115 isnt in the latest sql toolbelt download.  how do i get it?
Sign In or Register to comment.