Git推送结果致命:协议错误:坏行长度字符:这 [英] Git push results in fatal: protocol error: bad line length character: This

查看:1655
本文介绍了Git推送结果致命:协议错误:坏行长度字符:这的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让GitLab在我的服务器上运行(运行CentOS 6.5)。我遵循 gitlab-receipe 到该行,但我可以让它工作。我能够访问Web界面,创建新项目,但推送到主分支返回以下错误:

 致命:协议error:bad line length character:This 

我对生产环境进行了检查,结果如下:

 正在检查环境... 

为Git用户配置了Git吗? ...是

检查环境...完成

检查GitLab Shell ...

GitLab Shell版本> = 1.7.9? ...好(1.8.0)
回购基地目录是否存在? ...是
回购基地目录是一个符号链接? ... no
由git:git拥有的回购基地? ...是
回购基地访问是drwxrws ---? ...是
更新挂钩最新? ...
更新仓库中的钩子是链接:...
ASC / Wiki ...仓库为空
运行/ home / git / gitlab-shell / bin / check
检查GitLab API访问:OK
检查目录和文件:
/ home / git / repositories:OK
/home/git/.ssh/authorized_keys:OK
测试redis -cli可执行文件:redis-cli 2.4.10
发送ping到redis服务器:PONG
gitlab-shell自检成功

检查GitLab Shell ...完成

检查Sidekiq ...

运行? ...是
Sidekiq进程的数量... 1

检查Sidekiq ...完成

检查LDAP ...

在config / gitlab.yml中禁用LDAP

检查LDAP ...已完成

检查GitLab ...

数据库配置是否存在? ...是
数据库是SQLite ...否
所有迁移都是? ...是
GitLab配置存在吗? ...是
GitLab配置已过时? ... no
日志目录可写? ...是
Tmp目录是否可写? ...是
初始化脚本是否存在? ...是
初始化脚本是最新的? ... no
尝试修复它:
重新下载初始化脚本
有关更多信息,请参阅:
doc / install / installation.mdInstall Init Script部分
请修复上述错误并重新运行检查。
项目有命名空间:...
ASC / Wiki ...是
项目有卫星? ...
ASC / Wiki ...无法创建,存储库为空
Redis版本> = 2.0.0? ...是
您的git bin路径是/ usr / bin / git
Git版本> = 1.7.10? ...是(1.8.3)

检查GitLab ...已完成

对于初始化脚本错误,收据显示


如果您确定已经下载了$ b $, b最新的


因为我已经下载了最新版本,所以我对此没有太多的了解。 / p>

过去一周,我一直在抨击我的头,并且无法弄清楚为什么会出现这种错误,任何帮助都不会感激!!

$ b $如果其他人有这个问题,解决方法是将用户'git'(或者你的用户被称为)的登录shell改为 /斌/庆典。这可以通过以下命令完成: usermod -s / bin / bash git 链接)。更改登录shell的原因是因为git用户的默认shell是 / sbin / nologin (或者类似的,取决于环境),这会阻止git应用程序记录作为git服务器上的git用户。


I am trying to get GitLab working on my server (running CentOS 6.5). I followed the gitlab-receipe to the line, but I just can't get it working. I am able to access the web interface, create new projects but pushing to the master branch returns the following error :

fatal: protocol error: bad line length character: This

I have done checks on the production environment, here are the results :

Checking Environment ...

Git configured for git user? ... yes

Checking Environment ... Finished

Checking GitLab Shell ...

GitLab Shell version >= 1.7.9 ? ... OK (1.8.0)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
update hook up-to-date? ... yes
update hooks in repos are links: ... 
ASC / Wiki ... repository is empty
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files: 
    /home/git/repositories: OK
    /home/git/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.4.10
Send ping to redis server: PONG
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... no
  Try fixing it:
  Redownload the init script
  For more information see:
  doc/install/installation.md in section "Install Init Script"
  Please fix the error above and rerun the checks.
projects have namespace: ... 
ASC / Wiki ... yes
Projects have satellites? ... 
ASC / Wiki ... can't create, repository is empty
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (1.8.3)

Checking GitLab ... Finished

For the init script error, the receipt says

Do not mind about that error if you are sure that you have downloaded the up-to-date

so as I have downloaded the latest one, I can't really do much about it.

I've been banging my head for the past week, and can not figure out why this error is occurring, any help would appreciated!!

解决方案

If anyone else has this problem, the solution is to change the login shell of the user 'git' (or whatever your user is called) to /bin/bash. This can be done via the command : usermod -s /bin/bash git (Link). The reason for changing the login shell is because the default shell for the git user is /sbin/nologin (or similar, depending on environment), which prevents the git application from logging in as the git user on the git server.

这篇关于Git推送结果致命:协议错误:坏行长度字符:这的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆