Git SSH push timeout on large changes

Troubleshooting Git

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

症状

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'

原因

Pushing large changes require more time than the default timeout.

ソリューション

  1. Increase timeout from Stash server
    1. Create STASH_HOME/stash-config.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.stash-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.stash-scm-git.backend.timeout.execution=86400
    3. Restart Stash
  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

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.