Unable to Open Sourcetree After Windows 10 Upgrade
Asked by gbrandel:

After upgrading from Windows 7 to Windows 10 I am unable to Open Sourcetree.

I currently have version 2.3.5.0 installed (have tried others).

I have tried:

- uninstalling/reinstalling

- removing all Sourcetree related directories (with reinstall)

- downgrading to earlier 2.x releases

None of these actions resolve the problem. The same error message continues to be reported in the log file. This error message is different than what is included with most of the other Windows 10 related Sourcetree issues that have been common as of late.

This is what's being logged each time I attempt to open the application:

ERROR \[2017-11-02 08:47:50,267\] \[1\] \[SourceTree.App\] \[.ctor\] - finish EnsureSquirrelExecutionStubIsCopied  
ERROR \[2017-11-02 08:47:50,392\] \[1\] \[SourceTree.App\] \[OnStartup\] - Failed to start  
System.Windows.Markup.XamlParseException: Add value to collection of type 'System.Windows.Controls.UIElementCollection' threw an exception. ---\> System.Runtime.InteropServices.COMException: UCEERR_RENDERTHREADFAILURE (Exception from HRESULT: 0x88980406)  
at System.Windows.Media.Composition.DUCE.Channel.SyncFlush()  
at System.Windows.Media.MediaContext.CompleteRender()  
at System.Windows.Media.MediaContext.CreateChannels()  
at System.Windows.Media.MediaSystem.ConnectChannels(MediaContext mc)  
at System.Windows.Media.MediaContext..ctor(Dispatcher dispatcher)  
at System.Windows.Media.MediaContext.From(Dispatcher dispatcher)  
at System.Windows.Media.Visual.VerifyAPIReadWrite()  
at System.Windows.Media.VisualCollection.Add(Visual visual)  
at System.Windows.Controls.UIElementCollection.AddInternal(UIElement element)  
at MS.Internal.Xaml.Runtime.ClrObjectRuntime.Add(Object collection, XamlType collectionType, Object value, XamlType valueXamlType)  
--- End of inner exception stack trace ---  
at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri)  
at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)  
at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)  
at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)  
at SourceTree.Utils.GeneralHelper.DownloadFile(String url, String destLocation, IInteractionsManager interactionsManager, IWebManager webManager, IDispatcher dispatcher, IRepoProcessFactory repoProcessFactory, INotificationsManager notificationsManager, String extractLocation)  
at SourceTree.Download.DefaultDownloadManager.DownloadFile(String url, String downloadDestination, String extractionDestination)  
at SourceTree.AppRoot.RunPreFlightChecks()  
at SourceTree.AppRoot.OnStartup(StartupEventArgs e)  
at SourceTree.App.OnStartup(StartupEventArgs e)

Any ideas about what's causing this and how to fix?

Thanks,

Griffith


Answers:
author: minnsey
body: Hi  
From the error it looks like .NET is failing the render the WPF XAML.  

I bit of googling for "System.Runtime.InteropServices.COMException: UCEERR_RENDERTHREADFAILURE (Exception from HRESULT: 0x88980406)" seems to suggest it might be something to do with HiDPI support and/or differences between hardware or software rendering.  

Do either of those options ring any bells with you?

comments: author: minnsey
body: see also <https://blogs.msdn.microsoft.com/dsui_team/2013/11/18/wpf-render-thread-failures/>


author: Mike Corsaro
body: To add to this: the error you're getting indicates an error when wpf renders using directx. Try and update your video card drivers. You can find them on the website of your device manufacturer, or sometimes from Windows Update.


author: gbrandel
body: Hi, thank you for the suggestions.

I updated my video card driver to the latest available from the NVIDIA website as of today:

NVIDIA Graphics Driver 388.31

23.21.13.8831

11/14/2017

I'm still getting same error as initially reported. I did another complete uninstall/reinstall of the application including manual removal of all associated application and settings folders before reinstall.

Reinstalled version 2.3.5 with fresh download from Atlassian website.

The reinstall behavior was the same: the installer shows small splash screen window for a couple seconds then it disappears and nothing else happens. But, as far as I can tell, the application appears to be fully installed.

When I run the application from start menu the pointer changes from arrow to spinning wheel for a couple seconds and then back to arrow and then nothing. No splash screen and no application window appear at all. Same log file entry with same error with every attempted application start.

The application was working fine under Windows 7. My computer was upgraded to Windows 10 on 10/31/17 and I have not been able to launch the application under Windows 10 since the upgrade.

I have no idea what else to look for at this point.


author: minnsey
body: I'm sorry I don't have a specific solution for this issue. I can only suggest further googling of UCEERR_RENDERTHREADFAILURE errors within the .NET framework.  

The only other suggestion would be to try re-installing the .NET framework.


author: gbrandel
body: I updated .NET framework to latest version (4.7.1 as of this post) from version 4.6.2 and the Sourcetree application now loads and runs normally.

Since this issue seems to be an isolated case, I'm guessing the problem might have been related to the specific combination of framework version 4.6.2 and graphics driver. Updating both .NET and graphics driver to latest available versions has resolved the issue. Just posting this follow up quick in the event that any of this information might be helpful to others.

Thank you for your help.


author: Ana Retamal
body: Hi Griffith, you can find the solution to that error in this other [Community thread](https://community.atlassian.com/t5/Sourcetree-questions/SourceTree-failed-to-start/qaq-p/642445), it's the answer proposed by Mike Corsaro:
> Please navigate to the config file location (C:\\Users\\{USERNAME}\\AppData\\Local\\Atlassian\\SourceTree.exe_{RANDOM_GUID}\\2.3.1.0\\user.config) and find the following line:
>
> \<setting name="AutomaticallyCleanUpDictionaryFiles" serializeAs="String"\>
>
> \<value\>True\</value\>
>
> \</setting\>
>
> Make sure that value is set to ***True***

Let us know if it worked for you!

Cheers,

comments: author: gbrandel
body: Hi Ana,

Thank you for the quick reply. I did find a number of other threads referencing Sourcetree startup and/or install issues within the past couple of months. Including the thread that you reference above. Unfortunately, the "AutomacticallyCleanUpDictionaryFiles" did not work for me. I continue to see the same error message (same as my original post) reported each time I attempt to start the application. The error message that I am seeing in my log file is completely different than the error message in the referenced thread.

I have tried some Google searching on components of the error message that I am seeing without much luck. This is really unfortunate as the Sourcetree application has become an important part of my workflow. I've been using the command line git client exclusively as a backup but a graphical client really is nice for some operations. I don't have much time to spend troubleshooting this issue and so, like others, I've started looking for a new graphical client. I recognize that Sourcetree is a free offering from Atlassian and, as such, this does not entitle end users to any particular expectations of service or support. That said, this experience has been frustrating and really disappointing.

Regards,

Griffith