git clone git lfs 出现错误 fatal: : smudge filter lfs failed

时间:2025-01-23 06:59:20

git clone git lfs 出现错误 fatal: : smudge filter lfs failed
error: external filter ‘git-lfs filter-process’ failed
fatal: : smudge filter lfs failed。


Error downloading object: (66dec18): Smudge error: Error downloading (66dec18c9f1705b9387d62f8485f4e7d871ca388718786737ed3c72dbfaac9fb): batch response: Repository or object not found: /meta-llama//info/lfs/objects/batch
Check that it exists and that you have proper access to it

Errors logged to /root/meta-llama/Llama-2-7b-chat-hf/.git/lfs/logs/20240221T024656.481462682.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: model-00001-of-00002.safetensors: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

详细错误如下:

git-lfs/2.11.0 (GitHub; linux amd64; go 1.13.4)
git version 2.27.0

$ git-lfs filter-process
Error downloading object: (66dec18): Smudge error: Error downloading (66dec18c9f1705b9387d62f8485f4e7d871ca388718786737ed3c72dbfaac9fb): batch response: Repository or object not found: /meta-llama//info/lfs/objects/batch
Check that it exists and that you have proper access to it

Repository or object not found: /meta-llama//info/lfs/objects/batch
Check that it exists and that you have proper access to it
/git-lfs/git-lfs/
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/errors/:69
/git-lfs/git-lfs/
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/lfshttp/:128
/git-lfs/git-lfs/lfshttp.(*Client).handleResponse
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/lfshttp/:51
/git-lfs/git-lfs/lfshttp.(*Client).DoWithRedirect
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/lfshttp/:326
/git-lfs/git-lfs/lfsapi.(*Client).doWithCreds
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/lfsapi/:103
/git-lfs/git-lfs/lfsapi.(*Client).doWithAuth
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/lfsapi/:67
/git-lfs/git-lfs/lfsapi.(*Client).DoWithAuth
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/lfsapi/:25
/git-lfs/git-lfs/lfsapi.(*Client).DoAPIRequestWithAuth
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/lfsapi/:56
/git-lfs/git-lfs/tq.(*tqClient).Batch
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/tq/:74
/git-lfs/git-lfs/
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/tq/:40
/git-lfs/git-lfs/tq.(*TransferQueue).enqueueAndCollectRetriesFor
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/tq/transfer_queue.go:559
/git-lfs/git-lfs/tq.(*TransferQueue).collectBatches.func1
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/tq/transfer_queue.go:453

/usr/lib/golang/src/runtime/asm_amd64.s:1357
batch response
/git-lfs/git-lfs/
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/errors/:198
/git-lfs/git-lfs/
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/errors/:74
/git-lfs/git-lfs/tq.(*tqClient).Batch
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/tq/:77
/git-lfs/git-lfs/
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/tq/:40
/git-lfs/git-lfs/tq.(*TransferQueue).enqueueAndCollectRetriesFor
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/tq/transfer_queue.go:559
/git-lfs/git-lfs/tq.(*TransferQueue).collectBatches.func1
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/tq/transfer_queue.go:453

/usr/lib/golang/src/runtime/asm_amd64.s:1357
Error downloading (66dec18c9f1705b9387d62f8485f4e7d871ca388718786737ed3c72dbfaac9fb)
/git-lfs/git-lfs/
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/errors/:198
/git-lfs/git-lfs/
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/errors/:85
/git-lfs/git-lfs/lfs.(*GitFilter).downloadFile
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/lfs/gitfilter_smudge.go:115
/git-lfs/git-lfs/lfs.(*GitFilter).Smudge
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/lfs/gitfilter_smudge.go:76
/git-lfs/git-lfs/
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/commands/command_smudge.go:127
/git-lfs/git-lfs/
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/commands/command_filter_process.go:120
/git-lfs/git-lfs/vendor//spf13/cobra.(*Command).execute
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/vendor//spf13/cobra/:766
/git-lfs/git-lfs/vendor//spf13/cobra.(*Command).ExecuteC
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/vendor//spf13/cobra/:852
/git-lfs/git-lfs/vendor//spf13/cobra.(*Command).Execute
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/vendor//spf13/cobra/:800
/git-lfs/git-lfs/
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/commands/:103

/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/:33

/usr/lib/golang/src/runtime/:203

/usr/lib/golang/src/runtime/asm_amd64.s:1357
Smudge error
/git-lfs/git-lfs/
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/errors/:198
/git-lfs/git-lfs/
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/errors/:284
/git-lfs/git-lfs/lfs.(*GitFilter).Smudge
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/lfs/gitfilter_smudge.go:85
/git-lfs/git-lfs/
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/commands/command_smudge.go:127
/git-lfs/git-lfs/
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/commands/command_filter_process.go:120
/git-lfs/git-lfs/vendor//spf13/cobra.(*Command).execute
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/vendor//spf13/cobra/:766
/git-lfs/git-lfs/vendor//spf13/cobra.(*Command).ExecuteC
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/vendor//spf13/cobra/:852
/git-lfs/git-lfs/vendor//spf13/cobra.(*Command).Execute
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/vendor//spf13/cobra/:800
/git-lfs/git-lfs/
/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/commands/:103

/builddir/build/BUILD/git-lfs-2.11.0/_build/src//git-lfs/git-lfs/:33

/usr/lib/golang/src/runtime/:203

/usr/lib/golang/src/runtime/asm_amd64.s:1357

Current time in UTC:
2024-02-21 02:46:56

ENV:
LocalWorkingDir=/root/meta-llama/Llama-2-7b-chat-hf
LocalGitDir=/root/meta-llama/Llama-2-7b-chat-hf/.git
LocalGitStorageDir=/root/meta-llama/Llama-2-7b-chat-hf/.git
LocalMediaDir=/root/meta-llama/Llama-2-7b-chat-hf/.git/lfs/objects
LocalReferenceDirs=
TempDir=/root/meta-llama/Llama-2-7b-chat-hf/.git/lfs/tmp
ConcurrentTransfers=8
TusTransfers=false
BasicTransfersOnly=false
SkipDownloadErrors=false
FetchRecentAlways=false
FetchRecentRefsDays=7
FetchRecentCommitsDays=0
FetchRecentRefsIncludeRemotes=true
PruneOffsetDays=3
PruneVerifyRemoteAlways=false
PruneRemoteName=origin
LfsStorageDir=/root/meta-llama/Llama-2-7b-chat-hf/.git/lfs
AccessDownload=none
AccessUpload=none
DownloadTransfers=basic,lfs-standalone-file
UploadTransfers=basic,lfs-standalone-file
GIT_DIR=/root/meta-llama/Llama-2-7b-chat-hf/.git
GIT_EXEC_PATH=/usr/libexec/git-core

Client IP addresses:
172.17.0.2


解决方法:

// Skip smudge - We'll download binary files later in a faster batch
git lfs install --skip-smudge
// Do git clone here
git clone ...
// Fetch all the binary files in the new clone
cd project
git lfs pull
// Reinstate smudge
git lfs install --force

如果是国外的大文件,比如 大模型,最好配置git的代理,如下:

git config --global http.sslVerify "false"
git config --global advice.detachedHead false

#建议socks5 和http 都配置一下代理
#配置socks5
#git config --global http.proxy socks5 127.0.0.1:7890
#git config --global https.proxy socks5 127.0.0.1:789
#配置http
#git config --global http.proxy 127.0.0.1:7890
#git config --global https.proxy 127.0.0.1:7890
#查看设置:
#git config --global --get http.proxy
#git config --global --get https.proxy
#取消办法:
#git config --global --unset http.proxy
#git config --global --unset https.proxy

就可以正常下载了:

Downloading LFS objects:  20% (1/5), 298 MB | 3.1 MB/s