首页 > 解决方案 > gerrit 远程主机关闭连接

问题描述

我最近将 gerrit 版本从 2.15.17 升级到 3.3.0,现在在克隆 repo 时,它会挂起以下消息,当enter按下键盘上的按钮时,会发生克隆

 ****    Welcome to Gerrit Code Review    ****

  Hi user, you have successfully connected over SSH.

  Unfortunately, interactive shells are disabled.
  To clone a hosted Git repository, use:

  git clone ssh://user@reviews.example.com:29418/REPOSITORY_NAME.git

Connection to reviews.example.com closed by remote host.
Connection to reviews.example.com closed.
Cloning into 'bin_user'...


检查gerrit日志时会出现以下错误

[2021-05-24T10:40:46.918Z] [sshd-SshDaemon[1b079e81](port=22)-nio2-thread-6] WARN  org.apache.sshd.server.channel.ChannelSession : onExit(ChannelSession[id=0, recipient=0]-ServerSessionImpl[user@/xx.xxx.xxx.xxx:56108]) code=127 message='' SshChannelClosedException closing shell: flush(ChannelOutputStream[ChannelSession[id=0, recipient=0]-ServerSessionImpl[user@/xx.xxx.xxx.xxx:56108]] SSH_MSG_CHANNEL_DATA) length=0 - stream is already closed
[2021-05-24T10:40:58.922Z] [sshd-SshDaemon[1b079e81](port=22)-nio2-thread-1] WARN  org.apache.sshd.server.session.ServerSessionImpl : exceptionCaught(ServerSessionImpl[user@/xx.xxx.xxx.xxx:56108])[state=Opened] IOException: Pipe closed

我尝试了 gerrit.config 文件中的一些设置仍然没有运气

标签: gerrit

解决方案


您无法使用 29418 端口登录 Gerrit 服务器,您可以使用“ssh -p 29418”到 Gerrit 服务器来检查连接是否按预期工作。

要克隆存储库,您需要执行“git clone”命令,如下所示:

git clone ssh://USER@GERRIT-SERVER:29418/REPOSITORY

推荐阅读