Search code examples
gerrit

connection closed by remote host by gerrit


I have recently upgraded gerrit version from 2.15.17 to 3.3.0 and now when cloning the repo it hangs with the following message and when enter button in the keyboard is pressed the cloning happens

 ****    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'...


When checking the gerrit logs it gives the following error

[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

I tried with some settings in gerrit.config file still no luck


Solution

  • You can't log in to the Gerrit server using the 29418 port, you can use the "ssh -p 29418" to the Gerrit server just to check if the connection is working as expected.

    To clone a repository you need to execute a "git clone" command like this:

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