Fatal: protocol error: invalid string length character: Unab

I have Windows Server 2008 Standard Edition. I installed FreeSSHd with Git. Windows Firewall has exceptions set for port 22. I have an SSH server configured to accept only SSH public keys. I can connect to the server using a terminal (i.e. ssh gregory@hostname ). When I go to use the git clone command (e.g. git clone ssh://gregory@hostname/path_to_my_repo ), I get this error:

fatal: protocol error: string length character: Unab

I have an absolute loss as to what causes this. I have Shell, SFTP, and Tunnel protocols enabled.

+8
git repository ssh
source share
4 answers

Forget freeSSHd. It cannot be configured to work with git.

You have two (as far as I managed to find) choices - go to the more complex SSH server for Windows, and then do the following: http://holyhoehle.wordpress.com/2011/01/26/setting-up-a-git -server-on-windows-server-2008-r2-using-msysgit-and-winsshd /

or go with OpenSSH (CopSSH)

http://java2cs2.blogspot.de/2010/03/setup-git-server-on-windows-machine.html

http://www.timdavis.com.au/git/setting-up-a-msysgit-server-with-copssh-on-windows/

Install Git Server with msysgit on Windows

http://code.google.com/p/tortoisegit/wiki/HOWTO_CentralServerWindowsXP

+4
source share

Git via SSH uses SSH pipe output verbatim. If this output contains any false data that is not related to git, then the git command cannot parse this and abort the message with an unclear error message. This can happen if you have a script user that displays data when connected, for example, or if something generates an error message not understood by git.

You will notice that "Unab" looks like the beginning of "Impossible", presumably an error message intended for a person, not git, really.

What happens with the next command?

 ssh gregory@hostname git-upload-pack '/path_to_your_repo' 

In theory, you should get an error message starting with "Impossible." For example, "Could not find git -upload-pack." In this case, the fix would be to add git -upload-pack to your path!

+2
source share

I had the same problem today at my work ... so I found this: Setting up a Git server on Windows Server 2008 R2

What you need to see below:

Git creation works on the server:

  • If this is not already done, install msysgit on your server (I would recommend installing it directly on C: \ Git, or at least on a path that has no spaces, because I had some strange problems with spaced paths)

  • Add C: \ Git \ bin to the PATH variable. It is very important!! sh.exe and other dependencies are in this folder

  • Now go to C: \ Git \ bin and add the following two files

gup.sh grp.sh 4. Open gup.sh in your favorite editor and paste

C:/Git/libexec/git-core/git-upload-pack.exe $* 5. Open grp.sh and paste

C: / Git / libexec / git -core / git -receive-pack.exe $ * Essentially $ * resets single quotes from the repository path argument, so a path in which there are spaces doesn't work here, I think

Basically, it was done now, and all Git operations from the client should work. For the clone you must enter

git clone -u 'sh gup.sh' ssh://username@server/path/to/myrepo.git or push will

git push --exec 'sh grp.sh' ssh://username@server/path/to/myrepo.git but it is not very elegant.

Cleaning:

  • First we want to get rid of the entire repo path by specifying a remote alias

git remote incremental source ssh: //username@server/path/to/myrepo.git Where "origin" will be the name of the alias

  • Then we set the configuration for git -upload-pack and git -receive-pack, so we don’t need to constantly refer to the shell script.

git config remote.origin.uploadpack 'sh gup.sh' and

git config remote.origin.receivepack 'sh grp.sh' This is it. Now we can use the usual Git commands without any additional parameters:

git clone initial git button initial basic git pull initial ...

0
source share

In my case, I had

 echo $HOSTNAME 

in my .bashrc and .bash_profile that I used to diagnose some connectivity issues. This gave me a message:

 fatal: protocol error: bad line length character: [VSR 

when i tried git pull from ssh repository. Removing echo statements makes everything work; " [VSR " is just the first 4 characters of echo .

0
source share

All Articles