Update 2.3.1 broke my setup. Error: failed to import extension sourcetree_auth Edited

I just allowed SourceTree to upgrade to 2.3.1 and my team's BitBucket repository immediately stopped working for me. I get this error as soon as I click Pull (Fetch is disabled):
*** failed to import extension sourcetree_auth from C:\Users\...\AppData\Local\SourceTree\app-2.3.1\extras\hget\sourctree_hg_auth.py: [Errno 2] No such file or directory: ...
abort: http authorization required for https://bitbucket.org/...
Just to see, I tried copying that .py file over from app-2.1.11\extras\hgext (both with and without its .pyc file) and that yielded a different, very uninformative error:
abort: authorization failed
SIDE NOTE: Please note that Ctrl+C does not work with SourceTree's messageboxes, so I had to either use Alt+PrtScr here or manually retype the whole message. This could make it harder for others to find information online about errors they encounter. (To avoid this issue, I've done both.)
SIDE NOTE 2: Pasting screenshots into your image uploader worked fine on my screen, but when I clicked Publish, I got many repeat copies of my first screenshot, and everything after it got blown away. (Fortunately, I had used Ctrl +A Ctrl+C to "back up" to clipboard first.) I tried editing the post, saving my screenshots to disk first, then using the visible controls on the image uploader. That didn't work either, so I moved the images into separate replies.
WORKAROUND: Fortunately, your website still had 2.1.11 as the downloadable version, so I uninstalled SourceTree and then reinstalled that older version. I'm back up and running now, but afraid to update.

5 answers

I solve it after reading the Release Notes: https://www.sourcetreeapp.com/update/windows/ga/ReleaseNotes_2.3.1.html


There is this note you need to follow:


Additional steps to Upgrade after installation.
  • In order to activate the new Mercurial Credential Manager extension it is necessary to switch to using embedded Mercurial and update to v4.3.1 in the Tools/Options/Mercurial tab

hope it helps.

forgot that also need to copy the python script from 2.1.11 (sourctree_hg_auth.py) referred in the first post, I did not copied the compiled one, just the source.

That fixed it.  Guess it pays to RTFM!  I had issues with the embedded version in launching kdiff previously.  Fingers crossed.

Maybe a warning could be added to inform users that they need to be using the embedded version.

After I tested it with the embebed I installed the full Mercurial 4.3.1 and worked fine too.

I was in the same boat.  Very frustrating for something that should be able to be considered commercial software.  I had to do the Update Embedded Mercurial which flashed download messages so quickly I did not have time to read them, then ponder where that got downloaded to when I did the Use Embedded Mercurial to select the hg.exe file.  If you don't automatically know, and are taken to the last folder Sourcetree opened, (for Win10 users) you can navigate to:


to select the hg.exe.

of course the AppData folder is hidden by default.

I already was using Embedded Mercurial.  I ran the update.
I still got the error.  I tried to follow Kelly's instruction to find the hg.exe file but could not find hg.exe  However when I exited source tree and then reloaded I was able to pull my code successfully.

same applies to me, work come to a halt. cannot pull changesets. it can see the repo though and show history 

updating the embedded Mercurial and making sure it was chosen worked for me - but only after exiting and restarting Sourcetree. And it didn't even want to start from any of teh shortcuts - only from the actual .exe inside C:\Users\[username]\AppData\Local\SourceTree\app-2.3.1

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,970 views 1 5
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you