Sourcetree newer than 3.4.7 can't fetch/pull with a fatal protocol error: bad line length character

2.1k Views Asked by At

I'm using Atlassian Sourcetree for Windows, and after a recent upgrade, it stopped working with some of my repositories.

The repositories are configured for passwordless access via SSH protocol (using public and private keys).

When I try to fetch or pull the repository, it shows the following error, where "xxxx" is the first 4 chars of my user name:

fatal: protocol error: bad line length character: xxxx
FATAL ERROR: Error reading from console: Error 109: The pipe has been ended.

Completed with errors, see above.

Before the upgrade, everything worked well.

I tested many versions (3.3.9, 3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.4.4, 3.4.5, 3.4.6, 3.4.7) and found that the last working version is 3.4.7, but more recent versions (3.4.8, 3.4.9, 3.4.10, 3.4.11, 3.4.12, 3.4.13 and 3.4.14) are broken in this respect.

What's wrong and how can I fix the error?

1

There are 1 best solutions below

2
Alexander Sorkin On

The problem component, in my case, was plink.exe (part of Putty), bundled with Sourcetree.

Sourcetree 3.4.7 has plink.exe version "0.70.2-sourcetree" compiled specially for the Sourcetree project, but more recent versions have common plink.exe from https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html.

The workaround is the following:

  • Download Sourcetree for Windows 3.4.7 from the https://www.sourcetreeapp.com/download-archives
  • Install it and copy file plink.exe from the program's directory: C:\Users{yourname}\AppData\Local\SourceTree\app-3.4.7\tools\putty\plink.exe to a temporary place, for example, C:\temp
  • Install the newest version of Sourcetree for Windows 3.4.14
  • Replace plink.exe with the saved version of plink.exe
  • Enjoy working latest Sourcetree

I hope the Sourcetree team will fix this bug in future releases.