Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

ssh-agent error every time I close settings page.

David
July 24, 2023

Every time I close the Settings page, I get the following error:

'ssh-agent' failed with code -1:
System.NullReferenceException: Object reference not set to an instance of an object. 0

git-error.png

Pretty sure that's because I use the native built-in windows SSH Agent.

1 answer

0 votes
Martin Runge
Community Champion
August 6, 2026

Hi @David

You are right that it comes from the SSH agent handling. This is a known Sourcetree for Windows bug. With Tools > Options > General > SSH Client set to OpenSSH, Sourcetree still tries to spawn and query its own ssh-agent on top of the native Windows OpenSSH Authentication Agent, and it throws that null reference when it cannot get a valid handle back. It is tracked as SRCTREEWIN-8375.

The reassuring part is that it is usually cosmetic. Your clone, fetch, and push through the Windows agent keep working; the message just fires every time you close settings or start the app.

If you do not specifically need OpenSSH, I would switch the SSH Client to PuTTY / Plink. That path does not trigger the error and has been the recommended client on Windows for a long time.

Cheers, Martin

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events