Git SSH push timeout on large changes

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

Git push error:

1 2 3 'receive-pack' timed out on server.fatal: The remote end hung up unexpectedly error: pack-objects died of signal 13 error: failed to push some refs to 'ssh://git@xxx'

Cause

Pushing large changes require more time than the default timeout.

Resolution

  1. Increase timeout from Bitbucket Server instance

    1. Create BITBUCKET_HOME/bitbucket.properties file (if it doesn't exist yet)

    2. Add the following properties

      1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ######################################################################################################################## # SSH command execution ######################################################################################################################## # Controls timeouts for all SSH commands, such as those that service git and hg operations over SSH. The idle timeout # configures how long the command is allowed to run without writing any output to the client. For SCM commands, the # plugin.*.backend.timeout.idle properties defined above will be applied to the underlying process. The default value # is 1 day. # This values is in SECONDS. plugin.ssh.command.timeout.idle=86400 ######################################################################################################################## # Git Settings ######################################################################################################################## # Defines the idle timeout for push/pull processes, applying a limit to how long the operation is allowed to execute # without either producing output or consuming input. The default value is 30 minutes. # This value is in SECONDS. plugin.bitbucket-scm-git.backend.timeout.idle=1800 # Defines the execution timeout for push/pull processes, applying a hard limit to how long the operation is allowed to # run even if it is producing output or reading input. The default value is 1 day. # This value is in SECONDS. plugin.bitbucket-scm-git.backend.timeout.execution=86400
    3. Restart Bitbucket Server

  2. Increase the timeout in user machine

    1. Create ~/.ssh/configfile (if it doesn't exist yet)

    2. Add SSH ServerAliveInterval ServerAliveCountMax settings into the file, eg:

      1 2 3 Host * ServerAliveInterval 86400 ServerAliveCountMax 4
Updated on April 15, 2025

Still need help?

The Atlassian Community is here for you.