Git-LFS auto-merge fails with BAMBOO-SSH-PROXY: [User session has timed out idling after 120000 ms.] and/or lfs.locksverify error
Problem
When working with Bitbucket server and Bamboo, the automerging and push process will fail if git lfs is enabled.
Diagnosis
Environment
Bamboo (any current version, tested in 6.1).
Bitbucket server (tested on 5.2.2)
Git lfs client v2.1.1
Diagnostic Steps
After configuring auto merging with one of the 2 options in Bamboo (Branch Auto Updater or Gatekeeper), git lfs will try to cal auto-merge and conclude with a push, failing with the following error:
Warning: Permanently added '[127.0.0.1]:55529' (RSA) to the list of known hosts.
BAMBOO-SSH-PROXY: [User session has timed out idling after 120000 ms.]
Remote "ssh://09bebce1-32dd-4553-b215-1836bfe809ea@127.0.0.1:55529/repo/repo.git" does not support the LFS locking API. Consider disabling it with:
$ git config 'lfs.https://127.0.0.1/repo/repo.git/info/lfs.locksverify' false
Error scanning for Git LFS files in "3fb9ec8950a9e0c03e293203185a9542008d5895"
fork/exec /usr/lib/git-core/git: cannot allocate memory
Cause
Two errors are presented here:
git config 'lfs.https://127.0.0.1/repo/repo.git/info/lfs.locksverify' false
This is caused by a Bitbucket limitation explained here: https://jira.atlassian.com/browse/BSERV-9623. The link (and the description of the error) explains how to work around this issue.
BAMBOO-SSH-PROXY: [User session has timed out idling after 120000 ms.]
This error happens due to a bug in the GIT LFS client version, which is v2.1.1.
Resolution
Update git lfs to version 2.2.0+ to fix this issue.