Repository navigation
Closed
Milestone
Description
If GitLFS cannot decode a pointer file then it fails. This can happen if a user tracks *.bin files on a case sensitive file system. GitLFS would not track *.BIN files on that system. If another users works with the repo on a case insensitive file system then GitLFS would try to decode pointers for the *.BIN which would fail. I wonder if it should rather just warn the user in that case?
Plus the failure is different for large and small files (@ttaylorr I assume this is because we read the first 1024 bytes of the pointer, right?).
Testcase:
git version 2.11.0
git-lfs/1.5.2 (GitHub; darwin amd64; go 1.7.3)
Error message if decoding of a large file fails:
$ git clone --branch largefile [email protected]:larsxschneider/lfstest-individual-files.git smudge-error
Cloning into 'smudge-error'...
remote: Counting objects: 33, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 33 (delta 2), reused 0 (delta 0), pack-reused 21
Receiving objects: 100% (33/33), 6.21 KiB | 0 bytes/s, done.
Resolving deltas: 100% (5/5), done.
fatal: big-file1.bin: smudge filter lfs failed
panic: runtime error: index out of range
goroutine 1 [running]:
panic(0x3a1400, 0xc420010250)
/usr/local/Cellar/go/1.7.3/libexec/src/runtime/panic.go:500 +0x1a1
github.com/git-lfs/git-lfs/git.(*FilterProcessScanner).readRequest(0xc420172fc0, 0xc4200f51f0, 0x0, 0xc420051a10)
/private/tmp/git-lfs-20161122-73173-1n7qhbi/git-lfs-1.5.2/src/github.com/git-lfs/git-lfs/git/filter_process_scanner.go:181 +0x218
github.com/git-lfs/git-lfs/git.(*FilterProcessScanner).Scan(0xc420172fc0, 0x402e11)
/private/tmp/git-lfs-20161122-73173-1n7qhbi/git-lfs-1.5.2/src/github.com/git-lfs/git-lfs/git/filter_process_scanner.go:143 +0x50
github.com/git-lfs/git-lfs/commands.filterCommand(0xc4200e9380, 0x602ba0, 0x0, 0x0)
/private/tmp/git-lfs-20161122-73173-1n7qhbi/git-lfs-1.5.2/src/github.com/git-lfs/git-lfs/commands/command_filter_process.go:76 +0x1f9
github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra.(*Command).execute(0xc4200e9380, 0x602ba0, 0x0, 0x0, 0xc4200e9380, 0x602ba0)
/private/tmp/git-lfs-20161122-73173-1n7qhbi/git-lfs-1.5.2/src/github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra/command.go:477 +0x170
github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra.(*Command).Execute(0xc4200e84e0, 0xc420051ed0, 0x1)
/private/tmp/git-lfs-20161122-73173-1n7qhbi/git-lfs-1.5.2/src/github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra/command.go:551 +0x380
github.com/git-lfs/git-lfs/commands.Run()
/private/tmp/git-lfs-20161122-73173-1n7qhbi/git-lfs-1.5.2/src/github.com/git-lfs/git-lfs/commands/run.go:65 +0x196
main.main()
/private/tmp/git-lfs-20161122-73173-1n7qhbi/git-lfs-1.5.2/git-lfs.go:33 +0x111
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 message if decoding of a small file fails:
$ git clone --branch smallfile [email protected]:larsxschneider/lfstest-individual-files.git smudge-error
Cloning into 'smudge-error'...
remote: Counting objects: 33, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 33 (delta 2), reused 0 (delta 0), pack-reused 21
Receiving objects: 100% (33/33), 6.21 KiB | 0 bytes/s, done.
Resolving deltas: 100% (5/5), done.
fatal: big-file1.bin: 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'
Plus, even if we disable the smudge filter, the checkout fails:
$ GIT_LFS_SKIP_SMUDGE=1 git clone --branch largefile [email protected]:larsxschneider/lfstest-individual-files.git smudge-error
Cloning into 'smudge-error'...
remote: Counting objects: 33, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 33 (delta 2), reused 0 (delta 0), pack-reused 21
Receiving objects: 100% (33/33), 6.21 KiB | 0 bytes/s, done.
Resolving deltas: 100% (5/5), done.
fatal: big-file1.bin: smudge filter lfs failed
panic: runtime error: index out of range
goroutine 1 [running]:
panic(0x3a1400, 0xc420010250)
/usr/local/Cellar/go/1.7.3/libexec/src/runtime/panic.go:500 +0x1a1
github.com/git-lfs/git-lfs/git.(*FilterProcessScanner).readRequest(0xc420135dc0, 0xc420106a30, 0x0, 0xc420051a10)
/private/tmp/git-lfs-20161122-73173-1n7qhbi/git-lfs-1.5.2/src/github.com/git-lfs/git-lfs/git/filter_process_scanner.go:181 +0x218
github.com/git-lfs/git-lfs/git.(*FilterProcessScanner).Scan(0xc420135dc0, 0x402e11)
/private/tmp/git-lfs-20161122-73173-1n7qhbi/git-lfs-1.5.2/src/github.com/git-lfs/git-lfs/git/filter_process_scanner.go:143 +0x50
github.com/git-lfs/git-lfs/commands.filterCommand(0xc4200f8000, 0x602ba0, 0x0, 0x0)
/private/tmp/git-lfs-20161122-73173-1n7qhbi/git-lfs-1.5.2/src/github.com/git-lfs/git-lfs/commands/command_filter_process.go:76 +0x1f9
github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra.(*Command).execute(0xc4200f8000, 0x602ba0, 0x0, 0x0, 0xc4200f8000, 0x602ba0)
/private/tmp/git-lfs-20161122-73173-1n7qhbi/git-lfs-1.5.2/src/github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra/command.go:477 +0x170
github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra.(*Command).Execute(0xc42008d040, 0xc420051ed0, 0x1)
/private/tmp/git-lfs-20161122-73173-1n7qhbi/git-lfs-1.5.2/src/github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra/command.go:551 +0x380
github.com/git-lfs/git-lfs/commands.Run()
/private/tmp/git-lfs-20161122-73173-1n7qhbi/git-lfs-1.5.2/src/github.com/git-lfs/git-lfs/commands/run.go:65 +0x196
main.main()
/private/tmp/git-lfs-20161122-73173-1n7qhbi/git-lfs-1.5.2/git-lfs.go:33 +0x111
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'
Metadata
Metadata
Assignees
Labels
No labels
Activity
ttaylorr commentedon Dec 1, 2016
I think LFS should fail the push/checkout if we can't parse a pointer. We should only be uploading or checking out entirely correct payloads, not partial ones. Regardless, this should be an error that exits with a non-zero code, but it should also log the stacktrace into
.git/lfs/logs.I responded to a couple of your finer points below:
I don't quite understand what you're saying here. Would LFS ignore
*.BINfiles on a case-sensitive FS and not try and deal with them?This should not be the case, since the size of the file does not affect the size of the pointer. The only valid scenario(s) where a pointer would be longer than 1024 bytes and still correctly parse-able would be:
Some of the specific errors you're pointing out in the stacktrace are related to this, but I'm pretty sure that the reader is just behind/ahead somehow and therefore unable to parse what it expected to be on the stream at that position. To be sure, I'd need to see exactly what was on the reader, and we should build better tools to debug that sort of thing.
ttaylorr commentedon Dec 1, 2016
OK, I understand what you're saying now. This seems likes a problem that's a larger LFS issue, and I'd be curious to hear @technoweenie's thoughts.
technoweenie commentedon Dec 1, 2016
I think Git LFS should pass the raw git blob through if it can't parse the LFS pointer. I haven't encountered the
*.binvs*.BINissue, but it makes sense to me.I'm not sure a warning is necessary though, as it could be quite noisy. Maybe if it looks like a valid LFS pointer, but is somehow invalid, LFS could print a warning to STDERR. If the blob contents are very obviously not an LFS pointer (such as some
FOO.BINfile), then aGIT_TRACEwarning should be sufficient.larsxschneider commentedon Dec 2, 2016
@technoweenie We could count invalid LFS pointers and just warn once at the end (e.g.
Warning: GitLFS detected invalid pointer files. See log for further information.or something). This would only work with the filter protocol, though...technoweenie commentedon Dec 2, 2016
That sounds good to me 👍
larsxschneider commentedon Dec 7, 2016
This just happened again in one of our repos after the user updated to Git 2.11 + GitLFS 1.5.x. I think the old clean/smudge system did not throw an error if the pointer decoding failed. User could see the new more strict behavior as a regression.
larsxschneider commentedon Dec 8, 2016
Someone on the Git list just experienced that error:
http://public-inbox.org/git/CABW+60x0PSw7uNQZg4SeN7EAbNpraR_HWvnVFz1-fVLYX=B8RQ@mail.gmail.com/
FYI: You can fix your repo with the following commands:
mrobbeloth commentedon Dec 12, 2016
Lars,
This approach is not working for me. The patch in Git 2.11+GIfLFS 1.5.x has completely broken our automated nightly builds. I'll have to make sure our build systems are downgraded to git 2.10.2 or lower.
Michael
larsxschneider commentedon Dec 12, 2016
@mrobbeloth-pdi I am sorry that it does not work for you. What error do you see?
mrobbeloth commentedon Dec 12, 2016
I'm seeing the following error:
Cloning into '/mnt/build/mrobbeloth/projects/BuildScripts/main_5.0_aio/myandroid/frameworks'...
POST git-upload-pack (303 bytes)
Checking out files: 55% (20151/36637)
fatal: base/media/tests/contents/media_api/videoeditor/AACLC_44.1kHz_256kbps_s_1_17.mp4: 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'
The checkout process occurs as part of a crontab started bash script. The entire set of repos are checked out fresh every night in a new subdirectory to make sure no errors have crept in due to local caching.
I followed the process above on the file mentioned in this error message and still get the same result.
Michael
larsxschneider commentedon Dec 12, 2016
@mrobbeloth-pdi
With the instructions above you created a commit with the hash . Can you post the output of the following commands (the last one only if it is no more than 3 lines)?
Can you also post the content of your
.gitattributesfiles?mrobbeloth commentedon Dec 12, 2016
mrobbeloth@scorpion:/mnt/savage/mrobbeloth/projects/ar6mx_lollipop_full/myandroid/frameworks/base/media/tests/contents/media_api/videoeditor$ git show 7e50ad92a99a044838b5615971c965e2f4d442b5commit 7e50ad92a99a044838b5615971c965e2f4d442b5
Author: mrobbeloth-pdi [email protected]
Date: Mon Dec 12 10:49:36 2016 -0500
diff --git a/base/media/tests/contents/media_api/videoeditor/AACLC_44.1kHz_256kbps_s_1_17.mp4 b/base/media/tests/contents/media_api/videoeditor/AACLC_44.1kHz_256kbps_s_1_17.mp4
index 32d4221..79489c3 100644
Binary files a/base/media/tests/contents/media_api/videoeditor/AACLC_44.1kHz_256kbps_s_1_17.mp4 and b/base/media/tests/contents/media_api/videoeditor/AACLC_44.1kHz_256kbps_s_1_17.mp4 differ
mrobbeloth@scorpion:/mnt/savage/mrobbeloth/projects/ar6mx_lollipop_full/myandroid/frameworks/base/media/tests/contents/media_api/videoeditor$ git show --binary 7e50ad92a99a044838b5615971c965e2f4d442b5 | grep literal
literal 132
literal 1503107
mrobbeloth@scorpion:/mnt/savage/mrobbeloth/projects/ar6mx_lollipop_full/myandroid/frameworks/base/media/tests/contents/media_api/videoeditor$ git cat-file -p :base/media/tests/contents/media_api/videoeditor/AACLC_44.1kHz_256kbps_s_1_17.mp4
version https://git-lfs.github.com/spec/v1
oid sha256:f599848e79a1479d249349554da5079a6ae1617b79843a47d397da2128d74499
size 1503107
mrobbeloth@scorpion:/mnt/savage/mrobbeloth/projects/ar6mx_lollipop_full/myandroid/frameworks/base/media/tests/contents/media_api/videoeditor$ more .gitattributes
*.mp4 filter=lfs diff=lfs merge=lfs -text
larsxschneider commentedon Dec 12, 2016
This looks all good. Can you run...
... and paste the output here (the last 100 lines or so should be enough).
mrobbeloth commentedon Dec 13, 2016
b5
08:09:30.488695 git.c:349 trace: built-in: git 'checkout' '7e50ad92a99a044838b5615971c965e2f4d442b5'
Note: checking out '7e50ad92a99a044838b5615971c965e2f4d442b5'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b
HEAD is now at 7e50ad9... Move files properlty to GitLFS
larsxschneider commentedon Dec 13, 2016
@mrobbeloth-pdi I think I need a few more log lines ;-)
larsxschneider commentedon Dec 15, 2016
@mrobbeloth-pdi I just realized that you could remove the following line from your Git config to ignore the error with the latest Git/GitLFS versions:
I am too busy right now but I will look into if @ttaylorr doesn't fix it first 😉
mrobbeloth commentedon Dec 17, 2016
Lars,
Here you go:
mrobbeloth@...:~/projects$ GIT_TRACE=1 git clone https://github.com/PDi-Communication-Systems-Inc/lollipop_frameworks.git framework
17:53:56.692161 git.c:371 trace: built-in: git 'clone' 'https://github.com/PDi-Communication-Systems-Inc/lollipop_frameworks.git' 'framework'
Cloning into 'framework'...
17:53:56.694935 run-command.c:350 trace: run_command: 'git-remote-https' 'origin' 'https://github.com/PDi-Communication-Systems-Inc/lollipop_frameworks.git'
17:53:57.134527 run-command.c:350 trace: run_command: 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' 'https://github.com/PDi-Communication-Systems-Inc/lollipop_frameworks.git/'
17:53:57.135439 exec_cmd.c:116 trace: exec: 'git' 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' 'https://github.com/PDi-Communication-Systems-Inc/lollipop_frameworks.git/'
17:53:57.137500 git.c:371 trace: built-in: git 'fetch-pack' '--stateless-rpc' '--stdin' '--lock-pack' '--thin' '--check-self-contained-and-connected' '--cloning' 'https://github.com/PDi-Communication-Systems-Inc/lollipop_frameworks.git/'
remote: Counting objects: 42441, done.
remote: Compressing objects: 100% (20/20), done.
17:53:57.301557 run-command.c:350 trace: run_command: 'index-pack' '--stdin' '-v' '--fix-thin' '--keep=fetch-pack 68849 on PDiES2' '--check-self-contained-and-connected' '--pack_header=2,42441'
17:53:57.302028 exec_cmd.c:116 trace: exec: 'git' 'index-pack' '--stdin' '-v' '--fix-thin' '--keep=fetch-pack 68849 on PDiES2' '--check-self-contained-and-connected' '--pack_header=2,42441'
17:53:57.303323 git.c:371 trace: built-in: git 'index-pack' '--stdin' '-v' '--fix-thin' '--keep=fetch-pack 68849 on PDiES2' '--check-self-contained-and-connected' '--pack_header=2,42441'
remote: Total 42441 (delta 4), reused 0 (delta 0), pack-reused 42417
Receiving objects: 100% (42441/42441), 800.48 MiB | 3.89 MiB/s, done.
Resolving deltas: 100% (13933/13933), done.
17:58:39.281644 run-command.c:350 trace: run_command: 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' '--progress=Checking connectivity'
17:58:39.282095 exec_cmd.c:116 trace: exec: 'git' 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' '--progress=Checking connectivity'
17:58:39.283874 git.c:371 trace: built-in: git 'rev-list' '--objects' '--stdin' '--not' '--all' '--quiet' '--progress=Checking connectivity'
17:58:49.263567 run-command.c:350 trace: run_command: 'git-lfs filter-process'
17:58:49.265437 run-command.c:209 trace: exec: '/bin/sh' '-c' 'git-lfs filter-process' 'git-lfs filter-process'
trace git-lfs: run_command: 'git' version
trace git-lfs: run_command: 'git' config -l
trace git-lfs: Initialize filter-process
trace git-lfs: Read filter-process request.
Downloading base/media/tests/contents/media_api/videoeditor/AACLC_44.1kHz_256kbps_s_1_17.mp4 (1.43 MB)
trace git-lfs: api: batch 1 files
trace git-lfs: HTTP: POST https://github.com/PDi-Communication-Systems-Inc/lollipop_frameworks.git/info/lfs/objects/batch
trace git-lfs: HTTP: 200
trace git-lfs: HTTP: {"objects":[{"oid":"f599848e79a1479d249349554da5079a6ae1617b79843a47d397da2128d74499","size":1503107,"actions":{"download":{"href":"https://github-cloud.s3.amazonaws.com/alambic/media/124649142/f5/99/f599848e79a1479d249349554da5079a6ae1617b79843a47d397da2128d74499?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIMWPLRQEC4XCWWPA%2F20161216%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20161216T225856Z&X-Amz-Expires=86400&X-Amz-Signature=ebb9996f4a0ee5e7012c92595261ee0e94038d120d15808a475221bc11c08747&X-Am
trace git-lfs: HTTP: z-SignedHeaders=host&actor_id=0&token=1","expires_at":"2016-12-17T22:58:56Z"}}}]}
trace git-lfs: xfer: adapter "basic" Begin() with 1 workers
trace git-lfs: xfer: adapter "basic" started
trace git-lfs: xfer: adapter "basic" Add() for "f599848e79a1479d249349554da5079a6ae1617b79843a47d397da2128d74499"
trace git-lfs: xfer: adapter "basic" End()
trace git-lfs: xfer: adapter "basic" worker 0 starting
trace git-lfs: xfer: adapter "basic" worker 0 processing job for "f599848e79a1479d249349554da5079a6ae1617b79843a47d397da2128d74499"
trace git-lfs: HTTP: GET https://github-cloud.s3.amazonaws.com/alambic/media/124649142/f5/99/f599848e79a1479d249349554da5079a6ae1617b79843a47d397da2128d74499
trace git-lfs: HTTP: 200
trace git-lfs: xfer: adapter "basic" worker 0 finished job for "f599848e79a1479d249349554da5079a6ae1617b79843a47d397da2128d74499"
trace git-lfs: xfer: adapter "basic" worker 0 stopping
trace git-lfs: xfer: adapter "basic" stopped
trace git-lfs: Read filter-process request.
trace git-lfs: Read filter-process request.
fatal: base/media/tests/contents/media_api/videoeditor/H264_BP_1080x720_30fps_12Mbps_AACLC_44.1khz_64kbps_s_1_17.mp4: smudge filter lfs failed
17:58:52.465103 run-command.c:42 trace: run_command: running exit handler for pid 68910
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'
mrobbeloth commentedon Dec 17, 2016
Lars,
Also, having the line, process = git-lfs filter-process, present or not makes no difference
Michael
larsxschneider commentedon Dec 18, 2016
@mrobbeloth-pdi Ah, your repo is openly accessible. This is a useful information for your next bug report 😉
I can reproduce the problem and I am pretty sure the
filter-processline makes a difference. Please run this to see if you have set the config somewhere:I looked at your repo and realized that you are not using GitLFS properly. All your files are actually in Git: https://github.com/PDi-Communication-Systems-Inc/lollipop_frameworks/tree/master/base/media/tests/contents/media_api/videoeditor
I made a PR to move the files to LFS. However, all files are already in your Git repo. That means you don't gain anything by using GitLFS right now. You should purge the files from your Git repo's history.
PDi-Communication-Systems-Inc/lollipop_frameworks#1
mrobbeloth commentedon Dec 20, 2016
okay the pull request you made worked on the master branch, but how can I do this another branch for this repo like tvrc. I'm encountering the same error when trying to switch from one branch to another. I can't merge the branches because the provide logical differences in firmware functionality on hardware.