go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.6k stars 5.45k forks source link

LFS checksum bug #2653

Closed TheRealPowerCoder closed 6 years ago

TheRealPowerCoder commented 7 years ago

Description

Hello,

I was about to push our source code into our new repos (all clean) with LFS enabled. All except one repo could be pushed. The one repo returned an i/o timeout when uploading one specific LFS File.

I was able to recreate the problem by creating a completly new repo with .gitignore, .gitattributes and the problematic file. LFS wont upload the file to the server. Afterwards I shrunk the file size down to 17 bytes that still wont be pushed (see Client Side).

Server Side (Gitea, Docker)

[Macaron] 2017-10-04 14:21:17: Started POST /powercoder/test-lfs.git/info/lfs/objects/batch for 192.168.162.22 [Macaron] 2017-10-04 14:21:18: Completed /powercoder/test-lfs.git/info/lfs/objects/batch 200 OK in 138.252134ms [Macaron] 2017-10-04 14:21:28: Started POST /powercoder/test-lfs.git/info/lfs/objects/batch for 192.168.162.22 [Macaron] 2017-10-04 14:21:28: Completed /powercoder/test-lfs.git/info/lfs/objects/batch 200 OK in 81.95643ms [Macaron] 2017-10-04 14:21:38: Started POST /powercoder/test-lfs.git/info/lfs/objects/batch for 192.168.162.22 [Macaron] 2017-10-04 14:21:38: Completed /powercoder/test-lfs.git/info/lfs/objects/batch 200 OK in 86.223643ms [Macaron] 2017-10-04 14:21:48: Started POST /powercoder/test-lfs.git/info/lfs/objects/batch for 192.168.162.22 [Macaron] 2017-10-04 14:21:48: Completed /powercoder/test-lfs.git/info/lfs/objects/batch 200 OK in 42.738494ms [Macaron] 2017-10-04 14:21:58: Started POST /powercoder/test-lfs.git/info/lfs/objects/batch for 192.168.162.22 [Macaron] 2017-10-04 14:21:58: Completed /powercoder/test-lfs.git/info/lfs/objects/batch 200 OK in 5.895199ms [Macaron] 2017-10-04 14:22:08: Started POST /powercoder/test-lfs.git/info/lfs/objects/batch for 192.168.162.22 [Macaron] 2017-10-04 14:22:08: Completed /powercoder/test-lfs.git/info/lfs/objects/batch 200 OK in 8.244827ms [Macaron] 2017-10-04 14:22:18: Started POST /powercoder/test-lfs.git/info/lfs/objects/batch for 192.168.162.22 [Macaron] 2017-10-04 14:22:18: Completed /powercoder/test-lfs.git/info/lfs/objects/batch 200 OK in 6.07595ms [Macaron] 2017-10-04 14:22:28: Started POST /powercoder/test-lfs.git/info/lfs/objects/batch for 192.168.162.22 [Macaron] 2017-10-04 14:22:28: Completed /powercoder/test-lfs.git/info/lfs/objects/batch 200 OK in 5.537536ms [Macaron] 2017-10-04 14:22:38: Started POST /powercoder/test-lfs.git/info/lfs/objects/batch for 192.168.162.22 [Macaron] 2017-10-04 14:22:38: Completed /powercoder/test-lfs.git/info/lfs/objects/batch 200 OK in 5.709606ms`

Client Side (Windows LFS 1.3.1)

$ git lfs push --all origin master Git LFS: (0 of 1 files, 36 skipped) 153 B / 17 B, 1.36 MB skipped LFS: Put http://192.168.254.191:3000/powercoder/test- lfs/info/lfs/objects/f8051d7550d50d1ea25ad9f972055c43e67cae7e654ae3488ef40dcffa9141d4: read tcp 192.168.162.22:61993->192.168.254.191:3000: i/o timeout

with the file in question being test.ttf (17 Bytes; it once was a ttf file):

$ git lfs ls-files f8051d7550 * test.ttf

test.ttf (Hex dump):

00 00 02 00 00 F0 00 00 00 01 00 00 00 00 00 00 00

test.zip

When changing any of the non-zero values to some different hex value, the files gets uploaded and the push completes successfully.

Expected output The file being pushed. Tested with the https://github.com/git-lfs/lfs-test-server which accepts the file as-is, no questions asked. Gitea on the otherhand seems to bug out.

As I don't know how Gitea handles LFS files internally I can only guess it to be some sort of checksum error. My current workaround is not adding the file to LFS which is not a viable solution in the long run.

I tried https://try.gitea.io but there is no LFS to test my issue. https://try.gitea.io/TheRealPowerCoder/lfs-test

Thanks.

Screenshots

lafriks commented 6 years ago

Can not reproduce it with latest master version. File is accepted and uploaded successfully

lafriks commented 6 years ago

Can this be closed as I see no way to fix such data in easy way and issue that produced them was fixed already in 1.3?

TheRealPowerCoder commented 6 years ago

As I am no longer able to reproduce this error because we since moved on from Gitea, this Issue can be closed as nobody else seems to be affected by this error (potentially fixed).