Sourcetree can't push: "fatal: protocol error: bad line length character: <!DO"

Aston French January 6, 2016

First time using Sourcetree (or any git), trying to push my contributions to a modding team's repo with no success. Error follows:

 

git -c diff.mnemonicprefix=false -c core.quotepath=false push -v --tags origin master:master
POST git-receive-pack (6332 bytes)

fatal: protocol error: bad line length character: &lt;!DO

fatal: The remote end hung up unexpectedly

fatal: The remote end hung up unexpectedly

Pushing to &lt;repo login, address etc&gt;

error: failed to push some refs to '&lt;repo login, address etc&gt;'

Completed with errors, see above.

(the repo address withheld, but was of the form http://myname:mypass@www.address.com/git/project.git)

 

I've dug about through google, and been completely unable to solve this. Sourcetree works fine for everyone else, so it's especially frustrating :/

 

Additional: when I first try to clone the repo, it all works fine but says "warning: templates not found C:\Users\MyName\AppData\Local\Atlassian\SourceTree\git_local\share\git-core\templates". Any suggestions?

4 answers

1 accepted

1 vote
Answer accepted
Aston French January 8, 2016

After a lot of buggering about, an innocent question from the project lead led to a workaround: I had the clone depth set to 20 to save myself disc space. Setting this to 0 (default) and it suddenly works just fine and I can push.

 

Obviously this still doesn't explain why I'm the only person on the project unable to use the clone depth feature, but hopefully it'll help anyone else who suffers a similar problem.

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 8, 2016

Yes, strange. The other thing I neglected to ask was whether you were able to push using the git command line client. That would identify whether SourceTree is part of the problem. However, since you've gotten past it, I'd understand if you want to just move on.

Aston French January 8, 2016

I had tried that, and it didn't work either - it seems to be git itself that dislikes my machine.

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 11, 2016

Well, if you decide to debug it further, you might take your question to stackoverflow or a git chat room. You'll be more likely to find someone who can help you do some low-level debugging of Git.

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 7, 2016
Aston French January 7, 2016

Not had any luck with that so far, and google fails to search for the seemingly critical "<!DO" fragment. I've managed to find this, but it sadly doesn't seem to relate to my 55kB push :/ http://stackoverflow.com/questions/7152285/issue-with-git-hosted-on-iis-with-bonobo

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 7, 2016

It looks to me like the remote end is trying to serve an HTML page instead of git data (which would start with <!DOCTYPE...). If that's what is happening, it's probably some sort of error page. Are others able to connect to the same server? Maybe you have bad credentials, or a typo in your repo path?

Aston French January 7, 2016

There are about a dozen others connecting to and using it without issue, and I've quadruple-checked my source URL against others and the "personal URL" generated by the repo page. As I can pull from the server just fine, it seems bizarre that I can't push :/

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 7, 2016

Strange. You might use some sort of network packet inspector to see if you can view the entire response instead of just the first three characters. Fiddler, for example.

Aston French January 7, 2016

I'm not familiar with the software. If you could provide a basic description of what I should do and what output would be helpful, I'll happily try it though!

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 7, 2016

Nevermind, fiddler doesn't seem to detect git traffic.

Deleted user June 29, 2016

This seems like reasonable explanation of the error. Has anyone found a solution to this yet?

I also experience the same problem under git in windows (both with cygwin and git-bash)

 

UPDATE
=======
Ok, so strangely enough I just updated my cygwin  through the provided package manager the the problem seems to be fixed. Among others I noticed that my bashrc also got updated which was also mentioned as a probable cause here: http://stackoverflow.com/questions/22314298/git-push-results-in-fatal-protocol-error-bad-line-length-character-this

0 votes
rrudnicki
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 7, 2016

Hi Aston, 

 

This might be related to some corruption during the installation. It would be possible you try to download ST again and try to re-install?

Also, have you changed the Git embedded for System Git? If so, can you undo this change for testing purposes. 

 

Regards, 

Renato Rudnicki

Aston French January 7, 2016

I've just done a fresh install (going from 1.6.2 to 1.7.0 I believe), still getting the same problem.

I presume system git is an externally installed version compared to embedded? If so, I haven't (knowingly) got a system git, and from the Options menu I believe that the embedded git is active and up to date: Tools->Options->Git has "use embedded git" greyed out, and I've run the update function.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events