Git SSH push timeout on large changes

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

Git push error:

'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

      ########################################################################################################################
      # 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/config file (if it doesn't exist yet)
    2. Add SSH ServerAliveInterval ServerAliveCountMax settings into the file, eg:

      Host *
           ServerAliveInterval 86400
           ServerAliveCountMax 4
Last modified on Mar 30, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.