Sourcetree crashes on startup on MAC
Asked by dabeed:

Updated to the latest version today and crashed on first open. Had been working fine before that. Tried redownloading, but still crashes on startup. Displays for about half a second then crashes.

Any ideas?


Answers:
author: rittersmann
body: Something bad in \~/Library/Application\\ Support/SourceTree/ moved the folder away and SourceTree.app doesn't crash (its also completely empty)

comments: author: BobWaterBit
body: Thanks Jason. I just posted about this in another thread (which somehow got deleted - bad day I guess). I deleted the support files and SourceTree 2.7.4 launches finally. For reference, I just updated to Mac OS 10.13.5 today. Not clear where the corruption originated.


author: BobWaterBit
body: Looks like a problem with the browser.plist file. Old one causes crash. A newly generated does not. The old one just has some additional \<key\> tags and path to my local repo. In any case, that's the culprit. I'll let someone else dig deeper.


author: mike6502
body: Thanks, this fix worked for me. Specifically, I deleted the following three files:

```
browser.plist
hgrc_sourcetree
openWindowList
```

Afterwards, Sourcetree started normally, and was empty. I simply re-added my local repos.

UPDATE: I found that I could add two or three "recent" repos successfully, but when I added a repo of an "older" project, the crash started happening again. I ended up nuking the whole Application Support/SourceTree directory, and manually re-added the repos again. So far so good...


author: bioagbob
body: Had the same problem after updating to Mac OS 10.13.5 today. However, I'm not sure 10.13.5 is the issue. I also saw it on my Mac running 10.11.6. Both were running SourceTree 2.7.3.

I narrowed it down to just browser.plist. Delete that and it works again on both machines. Thanks Jason!


author: Brooke Noble
body: Tried deleting browser.plist and it opened empty but crashed again as soon as I dragged in my local repo.


author: jhtep
body: Started getting crash on launch after update to 2.7.4 (175), on macOX 10.13.14.

Removed 3 files as suggested and fix issue.

```
browser.plist
hgrc_sourcetree
openWindowList
```


author: daniel_perlaky
body: Having removed those three files are you now able to launch Sourcetree multiple times after re-adding your repos? Because removing those three files for me enabled launch of Sourcetree just once for me and as soon as I cloned a repo it now crashes again immediately on start.


author: bioagbob
body: Maybe I'm lucky, but on both my machines (noted above), SourceTree works after only deleting the browser.plist. I didn't need to re-load repos either. Sorry it's still not working on your end. Have you tried the OP solution of deleting the entire support folder \~/Library/Application\\ Support/SourceTree/ ?


author: daniel_perlaky
body: yea thanks I've been going that full delete route and starting to have some success.


author: scott80109
body: I had to delete all contents from the directory. Worked after that, but had to add repos again.


author: Mark Mallia
body: Deleting the Folder / Separate files as mentioned above has worked for me. However when I add ++certain++ repo back, it starts crashing again.   

Note: only specific repos are making it crash for me.   

I have added all the repos that aren't causing it to crash (7 out of 9 Repos) and it seems to be stable.


author: jkosterlive
body: Yes Mark, same here. The solution of Mike above did solve it fully:  
"... I ended up nuking the **whole** Application Support/SourceTree directory, and manually re-added the repos again. So far so good..."

Other partial deletes did not work for all repos.


author: daniel_perlaky
body: Did anyone in this thread start making commits again? Because for me the deletion of entire folder worked fine to add repos back in without crashing but my first commit resulted in a crash and now it's crashing again on startup. The problem persists, awful.


author: Paul S
body: Yup. All good again.


author: mkoob
body: I am still having problems. I trashed the whole application supports folder which means I have to reconnect to the remote. It opens and I can see the remotes but once I add a local repo SourceTree immediately quits.

I will try cloning the remote to a new location to see if that will work.


author: daniel_perlaky
body: See my updates below -- might be helpful


author: mkoob
body: When I tried to clone the remote I get an error message at the bottom of the dialog.

This is not a valid source path / URL

If I click on this the errors shown are as follows.

Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

fatal: not a git repository (or any of the parent directories): .git

Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

This looks like maybe it fails when trying to contact the remote repository.

Have to check how the SSH keys are set up. It has been a while.


author: mkoob
body: Thanks Daniel. Opening the repo without creating the bookmarks in the repo browser does work for me too.


author: Thomas Schlegel
body: Have a look here:

<https://community.atlassian.com/t5/Sourcetree-questions/Sourcetree-crashes-on-start-after-adding-a-new-repository/qaq-p/814532>

The Atlassian Team is investigating this.

comments: author: daniel_perlaky
body: Thanks -- the problem they're describing doesn't quite seem to be what we're describing so I've cross-referenced our thread here with theirs so they can hopefully check into this at the same time.

I also have an open support ticket with them where I've been describing all the notes I've added here.


author: Paul S
body: I was already using system git.

I updated to 2.7.4 (175) and renamed the Library/Application Support/SourceTree folder (just so I have a copy) then restarted SourceTree.

Had it scan my local folders and all repos were re-added.

Seems to be working, for now.

Of course a PROPER fix would be better.

comments: author: pvickers
body: That didn't work for me. Even scanning the folders caused it to crash.


author: Paul S
body: Working ok, have done branches and commits.


author: Brooke Noble
body: 3 bugs were raised on SRCTREE Jira today for essentially the same issue. Suggest you chime in on [SRCTREE-5770](https://jira.atlassian.com/projects/SRCTREE/issues/SRCTREE-5770) with your crash log.

I've successfully reverted to version 2.3.2 - you may be able to do this without needing to re-clone your repos.

comments: author: mkoob
body: Bug report SRCTREE-5769 is a duplicate of this and it is now resolved. There is an update to 2.7.5 that appears to fix the issue.


author: mkoob
body: I put my original SourceTree folder that I had removed from Application Supports to try and resolve this and now SourceTree 2.7.5 opens without crashing and all of my bookmarks are back in the Repository Browser, Yay!


author: pvickers
body: Well, I spent too much time chasing my tail on this, when it turns out it was the icons that was causing the problem. Version 2.7.5 seems to have fixed it.


author: daniel_perlaky
body: I'm going to make a note outside replying to my own comment because it may be valuable enough for others to see.

For me there are crashes if bookmarks are created at all.

If I remove browser.plist then Sourcetree opens without crashing. I can then manually open a local repo from my drive and make commits without crashing.

If I then create bookmarks for the open repositories, Sourcetree immediately crashes.

So there's something going on with browser.plist

I've now done it multiple times with same result. Removing browser.plist keeps it from crashing as long as you don't let it create browser.plist again (by cancelling when it asks if you want to create a bookmark).


author: Paul S
body: If you're not running the latest version - 2.7.4 (175) - then if you \*do\* get it running again, the update notification will trash it.

Well, that's my guess, anyway.


author: pvickers
body: Hmmm, if I remove the hostingservices_new.plist file, then it works. But then I have no linked accounts. Sigh.


author: pvickers
body: Oh, for goodness sake, having been running for about 30 mins, it now crashes again on startup despite me **not having done anything with it!**This is v 2.6.3. This is now REALLY annoying.


author: pvickers
body: I'm having a nightmare with Sourcetree today. Updated to macOS 10.13.5 and now Sourcetree keeps crashing. I have rolled back as far as v 2.6.3 and it's still doing it. It seems to be related to browser.plist because it runs until I start adding local repos.

It is now completely unusable as it crashes every time it starts up unless I delete browser.plist.

**\[UPDATE\]**Not sure if it's a coincidence or not, but I switched from using the embedded git to system git, added my old browser.plist back and it seems to be working for now (2.6.3). Haven't tried putting the latest Sourcetree in place yet.

**\[UPDATE2\]** Removed 2.6.3 and put in 2.7.4c and it crashes on startup. Put 2.6.3 back and it seems to be working.

So, worth trying binning your Sourcetree 2.7, binning your \~/Library/Application Support/Sourcetree folder, putting 2.6.3a back, running it and then adding back your backed up browser.plist file and re-adding any connected accounts **and switching from embedded git to system git.**


author: daniel_perlaky
body: Same problem for me. Really frustrating.

I used Mike Perry's fix above but it's really annoying to now have to clone every repo all over again. I'm on High Sierra 10.13.4.

comments: author: daniel_perlaky
body: Actually the fix only helped launch Sourcetree once. As soon as I cloned a repo it now crashes again on startup.


author: daniel_perlaky
body: I had to trash the entire Library/Application Support/SourceTree folder, let Sourcetree try to create new files and then dragged my sourcetree.license folder back in there. Then relog into account and start cloning repos individually and so far it's working. What a pain.


author: scott80109
body: Same here. Ridiculous.


author: Sam Wang
body: Same here. Frustrating


author: daniel_perlaky
body: UPDATE: Trashing entire support folder worked long enough to let me manually add repos back in but my first commit to a repo crashed it immediately and now crashes on startup everytime like it did before. So infuriating and killing my workflow. No solution yet.


author: daniel_perlaky
body: **UPDATE**

I reverted to 2.6.3 and trashed the 3 files:

```
browser.plist
hgrc_sourcetree
openWindowList
```

It now allows for commit without crashing (so far). WTF.


author: daniel_perlaky
body: **Another update.**

If I remove browser.plist then Sourcetree opens without crashing. I can then manually open a local repo from my drive and make commits without crashing.

If I then create bookmarks for the open repositories, Sourcetree immediately crashes.

So there's something going on with browser.plist


author: daniel_perlaky
body: **UPDATE**

As mentioned I had reverted to 2.6.3 and noticed that trashing browser.plist and not creating bookmarks kept me stable enough to commit (and finally do my work).

I then decided to push my luck and test updating to 2.7.4 and I noticed that it automatically added the browser.plist file back into support folder. So I assumed I'd be crashing again. But it stayed open.

I've now committed without a crash.

I've closed and opened the application without a crash.

I am too nervous to create a bookmark and waste more time. So I'm opening repos manually and not saving bookmark.


author: mkoob
body: Thanks Daniel. This works for me too.


author: Brooke Noble
body: Also had this problem starting this morning.

MacOS 10.12.2. I notice just before it started happening I was getting a notification to upgrade Sourcetree


author: clevermuttchris
body: I have no fix for this - I have the same problem. Sourcetree auto-updated and then crashes within a half second or so of opening on a Mac, every time. Deleted the app (clean my mac uninstall), rebooted, re-installed fresh - same problem. Cannot use as it stands right now, is really frustrating unfortunately. Running Mac High Sierra 10.13.4.

comments: author: dabeed
body: Not sure if it helps, but I just noticed an instance of sourcetree still in my download folder. Deleted that and all other sourcetree downloaded zips files, emptied trash, re-downloaded latest version, and now it works.

So, problem solved for me. Hope that helps you in some way.


author: clevermuttchris
body: Thanks for the suggestion - unfortunately, I'd already done that a couple times and its made no difference for me. I'll keep poking around.


author: rittersmann
body: Dead in the water too ... same issue as described.