"Error: System.ComponentModel.Win32Exception: Access is denied" error in Sourcetree
Asked by Thiyagu Palanisamy Mudali:

Hello,

Some of the users from our organization are getting the below error while trying to clone the repository using sourcetree. Can you please help me to resolve this issue ?  

Error Message:  
=========================================

Command: git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks ls-remote [https://bitbucket.collaboration.agilent.com/scm/TT/TT.git](https://sparksource.collaboration.agilent.com/scm/itp/points.git)

Output:

Error: System.ComponentModel.Win32Exception: Access is denied  
=========================================  


Answers:
author: Andrew Dev
body: Deleted


author: Nic Brough -Adaptavist-
body: This usually means that the account running your application does not have the necessary permissions to run the software. That's something set up in the operating system, it's not a software fault.

Is your user allowed to run git on your system? Try running the command on the command line, outside Sourcetree - do you get the same error?

comments: author: Thiyagu Palanisamy Mudali
body: Thanks for your response. Do you know how to enable the access in OS level ?

We requested user to install Git bash and clone any one of the repository to see if it is working. I am waiting for the user to come back to me.


author: Andrew Dev
body: (Meant this as a reply)

I am also seeing this issue in SourceTree.

* Tried clearing out all user settings, uninstalling and reinstalling.
* The same command works in Terminal
* git works in Visual Studio
* git commands in Terminal work
* Other GIT apps work (but I prefer to use SourceTree)
* Same issue with GitHub and Azure Devops Repo
* All git related buttons functionality doesn't work
  * History doesn't show
  * Cannot Pull
* Running the latest ver 3.4.10
* I do notice that the Certificate on the exe expired on 11/27/2022
  * Can this be updated in an installer?


author: Jason Brinkmann
body: We are also having the same issue.

I have tried all of the same things Andrew listed.

* If the user does a run-as administrator on SourceTree it will work as expected, but they should not need to do that every time they run the application.
* We installed 3.3.9 and it worked for a day, but then stopped working again.
* We tried switching to the Embedded Git, restarted and then went back to the system Git.
* Tried removing the .NET updates that were installed around the time it broke.
* Tried moving the local repository to another folder.

Not able to get anything to work so far. Any help would be great!


author: Andrew Dev
body: Hi, I found this other discussion about the certificate for the SourceTree.exe.

<https://community.atlassian.com/t5/Sourcetree-questions/Digital-signature-certificate-has-expired/qaq-p/2211112>

There is a planned release with the new certificate in 3.4.11


author: Jason Brinkmann
body: The cert expiration and the date the app stopped working is the same. Hopefully the new version will be out soon. Thanks for sharing!


author: Andrew Dev
body: Link to Bug: <https://jira.atlassian.com/browse/SRCTREEWIN-13956>


Tags: atl-gruland