Repository navigation
Description
NOTE: In the following description I have changed some paths, project names,
and other identifying information, but left everything else intact.
NOTE 2: I would be happy to help implement a solution but I don't have a lot
of time. I will try to provide a fix myself but any tips/advice to get me started
would be very much appreciated.
I am having an issue where LFS fails to download large files when I use a specific SSH
key implicitly via the SSH config file. None of the following issues arise if I
use my default SSH key located at ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub; that is,
if I don't specify an SSH key and just clone from, say,
[email protected]:orgname/projectname.git, LFS works just fine. This leads
me to believe that the following issue has to do with a bug in LFS, rather than
my configuration.
In order to seamlessly integrate multiple SSH keys into my Git workflow,
I keep track of server/key associations using my ~/.ssh/config file.
For example:
Host bitbucket-personal
HostName bitbucket.org
User git
IdentityFile ~/.ssh/id_rsa.personal
IdentitiesOnly yes
Host bitbucket-work
HostName bitbucket.org
User git
IdentityFile ~/.ssh/id_rsa.work
IdentitiesOnly yes
Then, I have the following key pairs in my ~/.ssh directory:
$ ls id_* -la | awk '{print $9}'
id_rsa.work
id_rsa.work.pub
id_rsa.personal
id_rsa.personal.pub
This allows me to use different keys for different repositories:
git clone bitbucket-work:orgname/work-project.git # clones a work-related repo using my work key
git clone bitbucket-personal:jake/personal-project.git # clones a personal project repo using my personal key
Unfortunately, this causes problems when the cloned repository has files commited with LFS.
Below you will find the command line output followed by the full error log.
Command Line Output
$ git clone bitbucket-work:orgname/work-project.git
Cloning into 'work-project'...
remote: Counting objects: 7101, done.
remote: Compressing objects: 100% (2792/2792), done.
remote: Total 7101 (delta 5103), reused 6151 (delta 4228)
Receiving objects: 100% (7101/7101), 11.59 MiB | 1.44 MiB/s, done.
Resolving deltas: 100% (5103/5103), done.
Checking out files: 100% (1153/1153), done.
Downloading packages/PackageName/PackageLibrary.dll (478 KB)
Error downloading object: packages/PackageName/PackageLibrary.dll (deadbeef) : Smudge error: Error downloading packages/Atlas.DBLib/Interop.ATLAS_DBLib.dll ( c7dc4024b6c32eb53765a3cfb35c98d7fd28a6aaa8c03260d95e928275734d36): batch request : missing protocol: "bitbucket-echo:echots/biv-braces.git/info/lfs"
Errors logged to C:\Code\orgname\work-project\.git\lfs\objects\logs\ 20180125T160052.6710708.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: packages/PackageName/PackageLibrary.dll: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'
Error Log
git-lfs/2.3.4 (GitHub; windows amd64; go 1.8.3; git d2f6752f)
git version 2.16.1.windows.1
$ git-lfs.exe filter-process
Error downloading object: disable-restarts/disable-restart-task.pdf (a25f38e): Smudge error: Error downloading disable-restarts/disable-restart-task.pdf (a25f38e585dc2358b52c76684b419681a26e2b1d11de62f3688ac69892a4e1a0): batch request: missing protocol: "bitbucket-work:orgname/work-project.git/info/lfs"
missing protocol: "bitbucket-work:orgname/work-project.git/info/lfs"
batch request
github.com/git-lfs/git-lfs/errors.newWrappedError
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/errors/types.go:170
github.com/git-lfs/git-lfs/errors.Wrap
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/errors/errors.go:74
github.com/git-lfs/git-lfs/tq.(*tqClient).Batch
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/tq/api.go:55
github.com/git-lfs/git-lfs/tq.Batch
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/tq/api.go:37
github.com/git-lfs/git-lfs/tq.(*TransferQueue).enqueueAndCollectRetriesFor
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/tq/transfer_queue.go:426
github.com/git-lfs/git-lfs/tq.(*TransferQueue).collectBatches.func1
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/tq/transfer_queue.go:348
runtime.goexit
C:/Go/src/runtime/asm_amd64.s:2197
Error downloading disable-restarts/disable-restart-task.pdf (a25f38e585dc2358b52c76684b419681a26e2b1d11de62f3688ac69892a4e1a0)
github.com/git-lfs/git-lfs/errors.newWrappedError
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/errors/types.go:170
github.com/git-lfs/git-lfs/errors.Wrapf
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/errors/errors.go:85
github.com/git-lfs/git-lfs/lfs.downloadFile
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/lfs/pointer_smudge.go:96
github.com/git-lfs/git-lfs/lfs.PointerSmudge
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/lfs/pointer_smudge.go:61
github.com/git-lfs/git-lfs/lfs.(*Pointer).Smudge
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/lfs/pointer.go:64
github.com/git-lfs/git-lfs/commands.smudge
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/commands/command_smudge.go:128
github.com/git-lfs/git-lfs/commands.filterCommand
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/commands/command_filter_process.go:116
github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra.(*Command).execute
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra/command.go:477
github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra.(*Command).Execute
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra/command.go:551
github.com/git-lfs/git-lfs/commands.Run
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/commands/run.go:68
main.main
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/git-lfs.go:35
runtime.main
C:/Go/src/runtime/proc.go:185
runtime.goexit
C:/Go/src/runtime/asm_amd64.s:2197
Smudge error
github.com/git-lfs/git-lfs/errors.newWrappedError
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/errors/types.go:170
github.com/git-lfs/git-lfs/errors.NewSmudgeError
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/errors/types.go:256
github.com/git-lfs/git-lfs/lfs.PointerSmudge
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/lfs/pointer_smudge.go:70
github.com/git-lfs/git-lfs/lfs.(*Pointer).Smudge
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/lfs/pointer.go:64
github.com/git-lfs/git-lfs/commands.smudge
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/commands/command_smudge.go:128
github.com/git-lfs/git-lfs/commands.filterCommand
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/commands/command_filter_process.go:116
github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra.(*Command).execute
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra/command.go:477
github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra.(*Command).Execute
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra/command.go:551
github.com/git-lfs/git-lfs/commands.Run
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/commands/run.go:68
main.main
C:/Users/techn/go/src/github.com/git-lfs/git-lfs/git-lfs.go:35
runtime.main
C:/Go/src/runtime/proc.go:185
runtime.goexit
C:/Go/src/runtime/asm_amd64.s:2197
Current time in UTC:
2018-01-26 00:23:06
ENV:
LocalWorkingDir=C:\Code\orgname\work-project
LocalGitDir=C:\Code\orgname\work-project\.git
LocalGitStorageDir=C:\Code\orgname\work-project\.git
LocalMediaDir=C:\Code\orgname\work-project\.git\lfs\objects
LocalReferenceDir=
TempDir=C:\Code\orgname\work-project\.git\lfs\tmp
ConcurrentTransfers=3
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneRemoteName=origin
LfsStorageDir=C:\Code\orgname\work-project\.git\lfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic
UploadTransfers=basic
GIT_DIR=.git
GIT_LFS_PATH=C:\Program Files\Git LFS
Activity
ttaylorr commentedon Feb 7, 2018
Hi @jmenashe, sorry that this issue has grown stale -- I'm not sure how I missed it! Most immediately, I think the issue is related to the repository URL (which Git accepts, but LFS does not). Can you prefix it with
git@to indicate to Git LFS that it is a SSH remote?jmenashe commentedon Feb 13, 2018
@ttaylorr Adding
git@before the SSH alias seems to have worked. I had assumed that this would conflict with the preset user in~/.ssh/config, but it seems to not have been an issue.For anyone else wondering, I changed this:
to this:
ttaylorr commentedon Feb 14, 2018
Glad that it works! Thanks again.
sudoforge commentedon Feb 18, 2018
@ttaylorr While the workaround mentioned above works, would you consider support for better determination of the remote something that could make it into the development pipeline? If, using the original example,
bitbucket-workis indeed a valid SSH host, I would assume that git-lfs should be able to clone from it successfully, without having to inconvenience the user by requiring the prefix of a username.I haven't looked at the project code myself, but would be happy to set some time aside in the near future and see if I can't get it working.
To reiterate the issue, it appears that
git-lfshas poor support for determining ssh hosts, requiring theuser@hostnamestring to be in the remote. If someone has the following ssh configuration:~/.ssh/config
...It would be assumed that they clone their repositories using
git clone gh:user/repo.git. Unfortunately,git-lfsdoesn't recognizeghas a ssh host, because it is missing the user prefixed to the host - e.g.git@gh:user/repo.git(which works).ttaylorr commentedon Feb 21, 2018
Absolutely, but this isn't something that I have the bandwidth to take on myself for now. I've tentatively milestoned this into the next release, but I am not sure that I will be able to address it.
mathstuf commentedon Feb 21, 2018
This is probably related to #2433.
docwhomc commentedon Nov 12, 2026
I just ran into this issue with git-lfs v. 3.8.1. Like jmenashe (author), I use multiple SSH keys (which I specify via SSH aliases).
Note
Like jmenashe, I have altered paths (by replacing my username with
USERNAME) for privacy reasons.The workaround of prefixing the alias with a user (going from
git clone DocW-GitHub:K0lb3/UnityPy.gittogit clone git@DocW-GitHub:K0lb3/UnityPy.git) worked for me.Version Info
~/.ssh/configFileKey Pairs in
~/.sshDirectoryCommand Line Input and Output
Error Log