Re: fatal: protocol error: bad line length character

122 views
Skip to first unread message

Thomas Ferris Nicolaisen

unread,
Jun 10, 2014, 5:47:41 PM6/10/14
to git-...@googlegroups.com, msy...@googlegroups.com
On Monday, June 9, 2014 9:52:44 PM UTC+2, Clinton Parham wrote:
Hello git users,

I'm trying to run a git server on my Windows 7 workstation. I've downloaded the Windows installer from http://git-scm.com/downloads and I'm able to clone other repositories.

Now I want to allow others to clone my repositories. But when testing my setup, I get these errors (both client and server are on the same box):

Client side:
F:\git>git clone git://localhost:9419/test.git test2
Cloning into 'test2'...
fatal: unable to access 'https://localhost:9419/test.git/': Unknown SSL protocol error in connection to localhost:9419



It strikes me as odd that it appears to clone over HTTPS, when you specified a git:// url..  To the best of my knowledge, cloning over git:// (the Git protocol) has nothing to do with HTTPS, and by extension, should not involve SSL.

Could it be that you are somehow running a HTTPS service on port 9419, and Git is falling back to use this as protocol? Check what process is using the port, kill the service, restart the daemon and try again.
 
Yup, I agree that SSL being involved is odd.

A 'netstat -ano' doesn't list any process on 9419. Also, when I down the git daemon, a telnet to localhost:9419 fails so I don't believe anything else is listening on that port. A similar telnet works of course when the git daemon is running.

Also interesting is that the same clone works when I run it under cygwin!

You mean when running the git clone command on cygwin, or running the daemon on cygwin, or both?

In any case, I'm lost. Perhaps someone on the msysgit list can answer (on cc now).

Erik Faye-Lund

unread,
Jun 10, 2014, 6:07:11 PM6/10/14
to Thomas Ferris Nicolaisen, git-...@googlegroups.com, msysGit
Just let me state one obvious thing: Git for Windows and Cygwin does
not mix well. I would not be surprised if the existence of Cygwin on
the system was the culprit.

Thomas Ferris Nicolaisen

unread,
Jun 10, 2014, 6:18:27 PM6/10/14
to git-...@googlegroups.com, msy...@googlegroups.com, Erik Faye-Lund
On Tuesday, June 10, 2014 11:47:38 PM UTC+2, Thomas Ferris Nicolaisen wrote:

In any case, I'm lost. Perhaps someone on the msysgit list can answer (on cc now).


Unfortunately, Google Groups blocks replies on that CC who are not also members on this list, so here's a link to the thread in that other group:


There's a reply/idea already. I'd recommend you follow up over there, Clinton. 

redp...@gmail.com

unread,
Jun 10, 2014, 7:29:38 PM6/10/14
to msy...@googlegroups.com
Actually, my testing showed that a git clone under cygwin worked but a clone from Windows command line didn't.

The git daemon was running under Windows both times. So mixing them actually worked.

I wasn't planning to use cygwin but since the clone failed from windows command line, I decided to give it a try.

I would rather not mix them but I get a weird error when I don't - see first post.

Thanks

redp...@gmail.com

unread,
Jun 10, 2014, 7:31:36 PM6/10/14
to msy...@googlegroups.com
I ran only the git clone under cygwin.

Thanks.

Thomas Ferris Nicolaisen

unread,
Jun 11, 2014, 2:21:09 AM6/11/14
to msy...@googlegroups.com, git-...@googlegroups.com
Just occurred to me that I left some relevant pieces out in my quoting. Here's the whole original message (also available at [1]):

On Monday, June 9, 2014 9:52:44 PM UTC+2, Clinton Parham wrote:
Hello git users,

I'm trying to run a git server on my Windows 7 workstation. I've downloaded the Windows installer from http://git-scm.com/downloads and I'm able to clone other repositories.

Now I want to allow others to clone my repositories. But when testing my setup, I get these errors (both client and server are on the same box):

Client side:
F:\git>git clone git://localhost:9419/test.git test2
Cloning into 'test2'...
fatal: unable to access 'https://localhost:9419/test.git/': Unknown SSL protocol error in connection to localhost:9419

Server side:
F:\git>git daemon --verbose --port=9419 --export-all --base-path=F:\git
[15452] Ready to rumble
[11552] Connection from [::1]:51952
fatal: protocol error: bad line length character: ▬♥☺

I setup the test.git repo like this:
F:\>git --version
git version 1.9.2.msysgit.0

F:\>cd git
F:\git>mkdir test.git
F:\git>cd test.git
F:\git\test.git>git init --bare
Initialized empty Git repository in F:/git/test.git/

F:\git\test.git>cd ..
F:\git>

Anyone had luck with this approach?



I also fired up a Windows VM to see if it works:

git version 1.7.10.msysgit.1

Server side:

C:\git>git daemon --verbose --port=9419 --export-all --base-path=C:\git
[10816] Ready to rumble
[8692] Connection from 127.0.0.1:3472
[8692] Extended attributes (21 bytes) exist <host=localhost:9419>
[8692] Request upload-pack for '/agnes.git'

Client side:

c:\git>git clone git://localhost:9419/agnes.git test2
Cloning into 'test2'...
remote: Counting objects: 852, done.
Receiving objects: 100% (852/852), 114.14 KiB, done. objects:  86% (733/852)
Resolving deltas: 100% (461/461), done.458)   esolving deltas: 100% (461/461)
remote: Compressing objects: 100% (458/458), done.
remote: Total 852 (delta 461), reused 666 (delta 318)

After upgrading to git version 1.9.2.msysgit.0, I get the same behavior on the server side as before, but oddly enough this on the client side:

c:\git>git clone git://localhost:9419/agnes.git test3
Cloning into 'test3'...
remote: Counting objects: 852, done.
remote: Compressing objects: 100% (458/458), done.
fatal: read error: Invalid argument
fatal: early EOF
fatal: index-pack failed

So, I seem to be running into another issue, reported a couple of weeks ago [2].

Clinton, can you share which version of Git you have installed? (git --version, without cygwin please, just in normal Git for Windows). You wrote that you downloaded and installed from the homepage, but not when.

Would be great if someone else could quickly check if this is working for their local versions.

Clinton Parham

unread,
Jun 11, 2014, 1:30:25 PM6/11/14
to msy...@googlegroups.com, git-...@googlegroups.com
F:\git>git --version
git version 1.9.2.msysgit.0

Thanks.

Thomas Braun

unread,
Jun 12, 2014, 11:42:34 AM6/12/14
to Clinton Parham, msy...@googlegroups.com, git-...@googlegroups.com
Am 11.06.2014 19:30, schrieb Clinton Parham:
> F:\git>git --version
> git version 1.9.2.msysgit.0
>
> Thanks.
>
> On Wednesday, June 11, 2014 2:21:09 AM UTC-4, Thomas Ferris Nicolaisen
> wrote:
>
> Just occurred to me that I left some relevant pieces out in my
> quoting. Here's the whole original message (also available at [1]):
>
> On Monday, June 9, 2014 9:52:44 PM UTC+2, Clinton Parham wrote:
>
> Hello git users,
>
> I'm trying to run a git server on my Windows 7 workstation. I've
> downloaded the Windows installer
> from http://git-scm.com/downloads
> <http://git-scm.com/downloads> and I'm able to clone other
> repositories.
>
> Now I want to allow others to clone my repositories. But when
> testing my setup, I get these errors (both client and server are
> on the same box):
>
> _Client side:_
>
> F:\git>git clone git://localhost:9419/test.git test2
> Cloning into 'test2'...
> fatal: unable to access 'https://localhost:9419/test.git/
> <https://localhost:9419/test.git/>': Unknown SSL protocol
> error in connection to localhost:9419
>
> _Server side:_
>
> F:\git>git daemon --verbose --port=9419 --export-all
> --base-path=F:\git
> [15452] Ready to rumble
> [11552] Connection from [::1]:51952
> fatal: protocol error: bad line length character: ▬♥☺
>
>
> _I setup the test.git repo like this:_
>
> F:\>git --version
> git version 1.9.2.msysgit.0
>
>
> F:\>cd git
> F:\git>mkdir test.git
> F:\git>cd test.git
> F:\git\test.git>git init --bare
> Initialized empty Git repository in F:/git/test.git/
>
> F:\git\test.git>cd ..
> F:\git>
>
>
> Anyone had luck with this approach?
>
>
>
> I also fired up a Windows VM to see if it works:
>
> git version 1.7.10.msysgit.1
>
> Server side:
>
> C:\git>git daemon --verbose --port=9419 --export-all --base-path=C:\git
> [10816] Ready to rumble
> [8692] Connection from 127.0.0.1:3472 <http://127.0.0.1:3472>
> <https://groups.google.com/d/msg/msysgit/B2HgjzhdobI/nStjWxumwUIJ>

You might also want to set
export GIT_TRACE_PACKET=1
export GIT_TRACE=1
as this outputs some more information.

Clinton Parham

unread,
Jun 12, 2014, 10:10:41 PM6/12/14
to msy...@googlegroups.com, redp...@gmail.com, git-...@googlegroups.com
Here's the output after setting those environment params...

Server side
F:\git>set GIT_TRACE_PACKET=1
F:\git>set GIT_TRACE=1
F:\git>git daemon --verbose --port=9419 --export-all --base-path=F:\git
trace: exec: 'git-daemon' '--verbose' '--port=9419' '--export-all' '--base-path=F:\git'
trace: run_command: 'git-daemon' '--verbose' '--port=9419' '--export-all' '--base-path=F:\git'
[11200] Ready to rumble
trace: run_command: 'C:\Git\libexec\git-core\git-daemon.exe' '--serve' '--verbose' '--port=9419' '--export-all' '--base-path=F:\git'
[19100] Connection from [::1]:52256
fatal: protocol error: bad line length character: ▬♥☺

Client side
F:\git>set GIT_TRACE_PACKET=1
F:\git>set GIT_TRACE=1
F:\git>git clone git://localhost:9419/test.git test2
trace: built-in: git 'clone' 'git://localhost:9419/test.git' 'test2'
Cloning into 'test2'...
trace: run_command: 'git-remote-https' 'origin' 'https://localhost:9419/test.git'
fatal: unable to access 'https://localhost:9419/test.git/': Unknown SSL protocol error in connection to localhost:9419

Clinton Parham

unread,
Jun 12, 2014, 11:46:11 PM6/12/14
to msy...@googlegroups.com, git-...@googlegroups.com
Ok. this has been solved.

It seems that a global setting was in the .gitconfig file and it was forcing the protocol to switch to https:
url."https://".insteadOf git://

Once this was removed, there is progress but now another error: 

fatal: read error: Invalid argument
fatal: early EOFs:  98% (9531/9725)
fatal: index-pack failed

Thomas Ferris Nicolaisen

unread,
Jun 13, 2014, 2:43:29 AM6/13/14
to msy...@googlegroups.com, git-...@googlegroups.com
On Friday, June 13, 2014 5:46:11 AM UTC+2, Clinton Parham wrote:
Ok. this has been solved.

It seems that a global setting was in the .gitconfig file and it was forcing the protocol to switch to https:
url."https://".insteadOf git://

What setting was this?

Please start a new thread about the new error. I reckon it's the same one I got earlier, and I'm suspecting it's quite prevalent. Please include the trace options as well. 

 
Reply all
Reply to author
Forward
0 new messages