Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Sourcetree crashing with no error popup upon opening

Rob B December 18, 2022

I have been a user of Windows Sourcetree for a number of years now. As of late, whenever I try to open Sourcetree, or run the installer, I get the application splash screen for a few seconds, and then it closes itself with no displayed error messages.

 

The last action I remember taking in Sourcetree before the problem occurred was attempting to clone a repo that had git LFS enabled, which failed (with a popup about lack of LFS support) after which Sourcetree continued working as normal until a presumably unrelated laptop failure to recover from sleep mode.

I was running 3.4.5.0 when the problem occured, but it still occurs with 3.4.10.0 (latest).

Here is the contents of the `%localappdata%\Atlassian\SourceTree\sourcetree.log` log file: https://pastebin.com/frQzGRjC

Here's the start of that log file:

[SourceTree.App] [Log] - Failed to start
System.Management.ManagementException: Invalid class
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
at System.Management.ManagementObjectCollection.ManagementObjectEnumerator.MoveNext()
at SourceTree.UI.Theme.Wpf.Utilities.NativeHelper.GetWindowsVersion()
at SourceTree.UI.Theme.Wpf.Controls.PerMonitorDpiWindow.OnSourceInitialized(EventArgs e)
at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
at System.Windows.Window.ShowHelper(Object booleanBox)
at System.Windows.Window.ShowDialog()
at SourceTree.UI.WelcomeWizardManager.Run()
at SourceTree.UI.OnboardingManager.Run()
at SourceTree.AppRoot.Onboard()
at SourceTree.AppRoot.OnboardIfRequired()
at SourceTree.AppRoot.<OnStartup>d__24.MoveNext()

I have already reviewed these posts:

 

I have already tried these fixes:

  • Restarting my computer
  • Installing a newer version of sourcetree (3.4.5.0 -> 3.4.10.0). The installer similarly brings up a splash screen and then does nothing, but it does install a copy of sourcetree (that then fails to open when launched)
  • Deleting the user-specific configuration files mentioned here: https://confluence.atlassian.com/sourcetreekb/how-to-wipe-sourcetree-preferences-412484640.html
  • Completely deleting the `%localappdata%\Atlassian` folder
  • Completely deleting the `%localappdata%\Sourcetree` folder

1 answer

1 accepted

1 vote
Answer accepted
Rob B December 19, 2022

What a troublesome issue... I think the true cause was something going wrong on Windows' side of things during an update or unexpected shutdown. No changes were required to any Sourcetree related files to fix this issue.

By googling the error message:

Invalid class at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)

I was able to track down the following articles:

My WMI was indeed broken and the local control properties were displaying as "Invalid Class". 

In order to fix this, I downloaded the WMIDiag tool. Most of the downloads I could find were a version that did not support Windows 10, but I found 2.1 which did support Windows 10 here: https://www.softpedia.com/get/Tweak/System-Tweak/WMIDiag.shtml#download

This confirmed the issue was due to MOF Registration errors.

Then I ran a modified version of the command from the virtuallyboring article linked above.

In an admin command prompt:

  1. cd C:\Windows\System32\wbem
  2. dir /b *.mof *.mfl | findstr /v /i uninstall > moflist.txt & for /F %s in (moflist.txt) do mofcomp %s

This went through and reinstalled all of the MOF packages that were broken according to the WMI log. I checked the WMI control panel and it no longer displayed Invalid Class, and Sourcetree was able to open again. No computer restart needed.

Nathanieljla December 19, 2022
Like Steffen Opel _Utoolity_ likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events