1. Bitbucket
  2. Public Issue Tracker
  3. master
  4. Issues


Issue #9685 duplicate

SSH hanging up unexpectedly

Brian Feaver
created an issue

We're occasionally getting:

ssh_exchange_identification: Connection closed by remote host
fatal: The remote end hung up unexpectedly

Started sometime yesterday and we get them a few times every hour. Doesn't seem to be any particular repo, but they're always our own private repos.

Comments (13)

  1. Ethan Kaminski

    This seems to be a recurrence of issue #6331 - several people have complained about it in the past day or so.

    I've seen this twice in manually-triggered script runs this week. We have a test server that's maintained using scripts, and those scripts have generated error messages about ssh_exchange_identification. I've not seen the issue (yet) when working locally.

  2. Per Hallgren

    We are experiencing the same issue on our cronjobs for a couple of days. Manually running the script which pulls all repositories gives the same error, for seemingly random repositories. In #6331, some people hinted that it may be only caused if run by cron, but this does not seem to be the case.

    cat /proc/version

    Linux version 2.6.32-5-amd64 (Debian 2.6.32-48squeeze1) (dannf@debian.org) (gcc version 4.3.5 (Debian 4.3.5-4) ) #1 SMP Mon Feb 25 00:26:11 UTC 2013

    ssh -V

    OpenSSH_5.5p1 Debian-6+squeeze3, OpenSSL 0.9.8o 01 Jun 2010

    git --version

    git version

  3. Karthi Mohan

    I have a Jenkins job which fails randomly with the same error. I have been facing this issue in the last couple of days.

    stderr: ssh_exchange_identification: Connection closed by remote host fatal: The remote end hung up unexpectedly

  4. jsashi

    It's happening for us as well for the past few days. Atlassian, please fix this soon. Any chance this is happening due to the upgrade to the latest OpenSSL?

  5. Markus Stefanko

    it's happening constantly here, and adding to unexpected behaviour

    is there a proposed work-around to automatically handle ssh_exchange_identification errors? E.g. a setting to automatically retry such?

    It seems as if ConnectionAttempts and ConnectTimeout settings in ssh_config do not have any influence on it

  6. Mark Alexander

    Given the number of comments here and on issue #331, has anyone reviewed the MaxSessions and MaxStartups SSHD options? The defaults are pretty low. I see only 2 IPs for bitbucket.org and I suspect they get a lot of short connections.

  7. ericatienza

    my CI checkouts several repos, and it almost always get at least one repo in error, so my CI has been down for weeks now...

    FYI, here is the "workaround" I've put in place: I replaced all "git pull"s with "git pull || (sleep 10s && git pull)"

    kind of sleep for 10s and then retry. Now, with the few statistics I've conducted, the error still happen of course, but almost never twice in a row, so my CI is up and running again


  8. Marcus Bertrand staff

    Everyone following or commenting on this issue, please come to #6331 and help add information to that issue. We are having trouble reproducing this and we need your help to understand exactly what it takes to make this happen.

    We are marking this issue as closed and a duplicate of the already existing #6331

  9. Log in to comment