7

On one of my servers, when I'm try to pull/ls-remote fresh-created repo on gitlab, I'm getting these error:

git ls-remote git@gitlab.com:mas-vem/dinnerdelivery.git
fatal: protocol error: bad line length character: Depl

If I'm trying to ls-remote one of earliest created repositories, all is fine.

When I'm run this command:

ssh git@gitlab.com git-receive-pack mas-vem/dinnerdelivery.git

I'm getting this error:

Deploy key not allowed to push

But I doesn't want to push =/

What it could be? Does it is gitlab issue or error on my side?

Drakmail
  • 682
  • 2
  • 7
  • 22
  • possible duplicate of [Git Remote: Error: fatal: protocol error: bad line length character: Unab](http://stackoverflow.com/questions/8170436/git-remote-error-fatal-protocol-error-bad-line-length-character-unab) – Edward Thomson Feb 24 '15 at 16:25

4 Answers4

10

Found what is was problem: I just forgot to add deploy key to repo =/ After that issue was solved.

Drakmail
  • 682
  • 2
  • 7
  • 22
10

Just for other users reference:

fatal: protocol error: bad line length character: no s

can be a truncated answer for "No such project".

As in my case, this kind of error can be fixed by adding user (even yourself) to the project in gitlab:

https://gitlab.com/username/your_project/project_members

also, ensure your public key is set in your user "Profile settings" > SSH Key or in Project > Settings > Deploy Keys

1

To verify that your remote URL is correct use following command:

git remote -v 

Make sure your "origin" remote URL is correct, because if git is unable to connect to remote then you would see these errors.

Fix the remote using following command:

 git remote set-url <your-remote-name> <your-remote-url> 

That should fix this issue.

Marco Bonelli
  • 63,369
  • 21
  • 118
  • 128
Sandeep
  • 11
  • 1
1

I would like to add an aditional fix to this problem, if you are part of a Group, and you can pull the project, but get the error when you push, not having write privledges will give you this error! Make sure you are in the Group that owns the project.

Cyberience
  • 972
  • 10
  • 15