Skip to content

Pure SSH connection is forcibly shut down after 1 minute #6060

@Glandos

Description

@Glandos

Describe the bug
I use git-lfs on a slow connection. If objects are large, connection is shut down before finish, and it fails.

To Reproduce

Expected behavior
It should just download file without errors.

System environment

NAME="SLES"
VERSION="15-SP6"
VERSION_ID="15.6"
PRETTY_NAME="SUSE Linux Enterprise Server 15 SP6"

Current environment:

echo $GIT_SSH_COMMAND 
ssh -F none -i /etc/gls/git-configs/25050754/git_ssh_id.pub -o IdentitiesOnly=yes -p10022

And there is a remote SSH tunnel from localhost:10022 to the git host.

Output of git lfs env

> git lfs env
git-lfs/3.6.1 (GitHub; linux amd64; go 1.24.2)
git version 2.43.0

Endpoint=https://localhost/depots/webapps.git/info/lfs (auth=none)
  SSH=git@localhost:depots/webapps.git
LocalWorkingDir=/tmp/master
LocalGitDir=/tmp/master/.git
LocalGitStorageDir=/tmp/master/.git
LocalMediaDir=/tmp/master/.git/lfs/objects
LocalReferenceDirs=
TempDir=/tmp/master/.git/lfs/tmp
ConcurrentTransfers=1
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneVerifyUnreachableAlways=false
PruneRemoteName=origin
LfsStorageDir=/tmp/master/.git/lfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic,lfs-standalone-file,ssh
UploadTransfers=basic,lfs-standalone-file,ssh
GIT_CONFIG_GLOBAL=/etc/gls/git-configs/25050754/gitconfig
GIT_EXEC_PATH=/usr/lib/git
GIT_SSH_COMMAND=ssh -F none -i /etc/gls/git-configs/25050754/git_ssh_id.pub -o IdentitiesOnly=yes -p10022
git config filter.lfs.process = "git-lfs filter-process"
git config filter.lfs.smudge = "git-lfs smudge -- %f"
git config filter.lfs.clean = "git-lfs clean -- %f"

Additional context
I've adapted the configuration to pin point the issue with:

  git config lfs.concurrenttransfers 1
  git config lfs.dialtimeout 600
  git config lfs.tlstimeout 600
  git config lfs.activitytimeout 600
  git config lfs.keepalive 10

(I know that some of them doesn't imply SSH, but still…)

> git switch tools 
12:04:50.261540 git.c:463               trace: built-in: git switch tools
12:04:50.263058 run-command.c:659       trace: run_command: 'git-lfs filter-process'
12:04:50.278851 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' '--git-dir' '--show-toplevel'
12:04:50.281204 trace git-lfs: exec: git 'rev-parse' '--is-bare-repository'
12:04:50.283985 trace git-lfs: exec: git 'config' '--includes' '--local' 'lfs.repositoryformatversion'
12:04:50.286223 trace git-lfs: exec: git 'config' '--includes' '-l'
12:04:50.288839 trace git-lfs: exec: git 'rev-parse' '--is-bare-repository'
12:04:50.290970 trace git-lfs: exec: git 'config' '--includes' '-l' '--blob' ':.lfsconfig'
12:04:50.293965 trace git-lfs: exec: git 'config' '--includes' '-l' '--blob' 'HEAD:.lfsconfig'
12:04:50.296636 trace git-lfs: Install hook: pre-push, force=false, path=/tmp/master/.git/hooks/pre-push, upgrading...
12:04:50.296699 trace git-lfs: Install hook: post-checkout, force=false, path=/tmp/master/.git/hooks/post-checkout, upgrading...
12:04:50.296747 trace git-lfs: Install hook: post-commit, force=false, path=/tmp/master/.git/hooks/post-commit, upgrading...
12:04:50.296790 trace git-lfs: Install hook: post-merge, force=false, path=/tmp/master/.git/hooks/post-merge, upgrading...
12:04:50.296836 trace git-lfs: Initialize filter-process
12:04:50.297037 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' 'HEAD' '--symbolic-full-name' 'HEAD'
12:04:50.299637 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' '--git-dir'
12:04:50.302182 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'remote'
12:04:50.304841 trace git-lfs: tq: running as batched queue, batch size of 100
12:04:50.304950 trace git-lfs: filepathfilter: accepting "bun"
12:04:50.305051 trace git-lfs: attempting pure SSH protocol connection (download, origin)
12:04:50.305061 trace git-lfs: spawning pure SSH connection (#0)
12:04:50.305121 trace git-lfs: run_command: sh -c ssh -F none -i /etc/gls/git-configs/25050754/git_ssh_id.pub -o IdentitiesOnly=yes -p10022 '-oControlMaster=yes' '-oControlPath=/run/user/473/sock-2216781884/lfs.sock' git@localhost 'git-lfs-transfer depots/webapps.git download'
12:04:50.305192 trace git-lfs: exec: sh '-c' 'ssh -F none -i /etc/gls/git-configs/25050754/git_ssh_id.pub -o IdentitiesOnly=yes -p10022 '-oControlMaster=yes' '-oControlPath=/run/user/473/sock-2216781884/lfs.sock' git@localhost 'git-lfs-transfer depots/webapps.git download''
12:04:51.773392 trace git-lfs: pure SSH connection successful (#0)
12:04:51.779437 trace git-lfs: filepathfilter: accepting "yarnpkg/yarn-4.8.1.cjs"
Mise à jour des fichiers: 100% (56/56), fait.
12:04:51.790998 trace git-lfs: tq: sending batch of size 1
12:04:51.791023 trace git-lfs: api: batch 1 files
12:04:51.893755 trace git-lfs: tq: starting transfer adapter "ssh"
12:05:53.161913 trace git-lfs: shutting down pure SSH connections
12:05:53.161949 trace git-lfs: terminating pure SSH connection (#0) (resetting total from 1 to 0)
12:05:53.162134 trace git-lfs: tq: running as batched queue, batch size of 100
12:05:53.162237 trace git-lfs: filepathfilter: accepting "bun"
Downloading bun (100 MB)
12:05:53.162285 trace git-lfs: tq: running as batched queue, batch size of 100
12:05:53.162314 trace git-lfs: tq: sending batch of size 1
12:05:53.162327 trace git-lfs: api: batch 1 files
Error downloading object: bun (96d3f4d): Smudge error: Error downloading bun (96d3f4df4b74c2f0cd02a8a9916da877cd9c2d82bb55ba3d60ea0370b387f45f): could not get connection for batch request: pure SSH connection unavailable (#0)
12:05:53.275877 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'rev-parse' '--git-dir'
12:05:53.278372 trace git-lfs: exec: git '-c' 'filter.lfs.smudge=' '-c' 'filter.lfs.clean=' '-c' 'filter.lfs.process=' '-c' 'filter.lfs.required=false' 'remote'

Errors logged to '/tmp/master/.git/lfs/logs/20250605T120553.275505382.log'.
Use `git lfs logs last` to view the log.
erreur : le filtre externe 'git-lfs filter-process' a échoué
fatal : bun : le filtre smudge 'lfs' a échoué

I've tried it successfully on my client with the same git-lfs version (albeit a different SSH), and I've also tried to scp from that remote host a large file (>100MB) that was stored on the git server without issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateserver-implementationRelated to a specific server implementationsshRelated to SSH connections or the pure SSH object transfer protocol

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions