Gitlab - git push失败了

时间:2015-03-19 00:35:21

标签: gitlab

我已经在我的服务器上安装了Gitlab,但我无法推送到我创建的新存储库。

$ git remote -v
origin  gitlab@example.com:myusername/my-repository.git (fetch)
origin  gitlab@example.com:myusername/my-repository.git (push)
$ git push -u origin master

git push命令会挂起大约一分钟,然后显示错误消息:

fatal: protocol error: bad line length character: Fail

我认为我的问题可能与SSH有关:

$ ssh -v gitlab@example.com
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: /etc/ssh/ssh_config line 139: Applying options for example.com
debug1: /etc/ssh/ssh_config line 142: Applying options for example.com
debug1: Connecting to example.com [1.2.3.4] port 22.
debug1: Connection established.
debug1: identity file /home/myusername/.ssh/id_rsa.pub type 1
debug1: identity file /home/myusername/.ssh/id_rsa.pub-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2 pat OpenSSH_6.6.1* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5-etm@openssh.com none
debug1: kex: client->server aes128-ctr hmac-md5-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA 67:33:0b:d1:72:43:6b:f3:61:b1:9e:22:ef:d7:21:d8
debug1: Host 'example.com' is known and matches the ECDSA host key.
debug1: Found key in /home/myusername/.ssh/known_hosts:143
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/myusername/.ssh/id_rsa.pub
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to example.com ([1.2.3.4]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Sending environment.
debug1: Sending env LANG = en_GB.UTF-8
debug1: Sending env LC_CTYPE = en_GB.UTF-8
PTY allocation request failed on channel 0

请注意,身份验证似乎成功:

Authenticated to example.com ([1.2.3.4]:22).

我怀疑问题与:

有关
PTY allocation request failed on channel 0

任何线索?我花了几个小时搜索解决方案,但无法解决这个问题。

编辑: 我在gitlab-shell/gitlab-shell.log

中发现了这一点
W, [2015-03-19T01:41:10.865863 #24346]  WARN -- : Failed to connect to internal API <POST https://example.com/api/v3/internal/allowed>: #<Errno::ETIMEDOUT: Connection timed out - connect(2) for "example.com" port 443>

1 个答案:

答案 0 :(得分:0)

我不是这方面的专家,但快速搜索告诉我你应该卸载/ dev / pts,然后再次挂载/ dev / pts。

请参阅:https://serverfault.com/questions/351162/ssh-fails-pty-allocation-request-failed-on-channel-0