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:
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:
cd C:\Windows\System32\wbem
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.
Thanks for the lead. It looks like this was addressed elsewhere
https://community.atlassian.com/t5/Sourcetree-questions/SourceTree-crashes-on-launch/qaq-p/614185
Which lead to this (and worked for me)
https://community.spiceworks.com/how_to/21413-rebuilding-the-wmi-repository
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.