Files larger than 4 GB are not correctly handled on Windows

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

Files larger than 4 GB are not correctly handled on Windows.

For example:

  • after cloning a file bigger than 4GB, the downloaded file does not appear to be complete.

  • git checkout fails with Smudge error: Error downloading <object_name>

This is the case when using either Git core or Git LFS.

Environment

Windows Operating System

Bitbucket DC version 8.9.5

Diagnosis

The downloaded file after git clone operation does not appear to be complete. (or)

The git checkout operation fails with an error

1 Smudge error: Error downloading <object_name> (d1XXXX): cannot write data to temporary file "D:\\Drive\\Git\\Windows_OS\\.git\\lfs\\incomplete\\c1bxxxxxxxxxxxxxxx": LFS: unexpected EOF

Enable git trace logging

1 2 3 4 5 6 7 8 9 10 11 For Windows: set GIT_TRACE_PACKET=1 set GIT_TRACE=1 set GIT_CURL_VERBOSE=1 set GIT_TRANSFER_TRACE=1 For Linux: export GIT_TRACE_PACKET=1 export GIT_TRACE=1 export GIT_CURL_VERBOSE=1 export GIT_TRANSFER_TRACE=1

and try to perform git checkout operation. The checkout operation fails with the below error messages

1 2 3 4 5 6 7 8 <DATE:TIMESTAMP> trace git-lfs: xfer: Attempting to resume download of "c1XXXXXXXXXXXX" from byte 1083359179 <DATE:TIMESTAMP> trace git-lfs: HTTP: GET <BITBUCKET_BASE_URL>/rest/git-lfs/storage/WINDOWSOS/c1XXXXXXXXXXXX > GET /rest/git-lfs/storage/WINDOWSOS/c1XXXXXXXXXXXX HTTP/1.1 . <DATE:TIMESTAMP> trace git-lfs: xfer: failed to resume download for "c1XXXXXXXXXXXX" from byte 1083359179: expected status code 206, received 200. Re-downloading from start . <DATE:TIMESTAMP> trace git-lfs: xfer: adapter "basic" worker 0 finished job for "c1XXXXXXXXXXXX" <DATE:TIMESTAMP> trace git-lfs: tq: retrying object c1XXXXXXXXXXXX: cannot write data to temporary file "D:\\Drive\\Git\\Windows_OS\\.git\\lfs\\incomplete\\c1bxxxxxxxxxxxxxxx": LFS: unexpected EOF

Cause

This issue is caused by the following issue in the Git core project (which is not owned by the Bitbucket Server team):

Solution

Workaround

When using Git LFS, smudging should be disabled completely.

To give a brief overview of the smudge filter, large files are replaced with pointers with GIT LFS. These pointers are replaced by the actual files during git checkout process instead of clone, thus making the clones faster. The Git smudge filter is what converts the LFS pointer stored in Git with the actual large file from the LFS server. If the local repository does not have the LFS object, the smudge filter will automatically download it.

Disable smudging:

1 2 3 4 5 $ git lfs install --skip-smudge $ git lfs env ... snip git config filter.lfs.process = "git-lfs filter-process --skip" git config filter.lfs.smudge = "git-lfs smudge --skip -- %f"

Run git lfs env command to verify if smudge filter is disabled.

1 2 3 4 $ git lfs env git config filter.lfs.process = "git-lfs filter-process --skip" git config filter.lfs.smudge = "git-lfs smudge --skip -- %f"

ℹ️ By disabling the smudge filter, the LFS objects are to be pulled manually.

Use the following git lfs command to explicitly pull changes in the branches or fetch updates from the remote:

1 git lfs pull

Warning added in Git LFS

The following message will be added to the Git client log when this issue is encountered:

1 2 Encountered <number> file(s) that may not have been copied correctly on Windows git lfs help smudge` for more details

This has been introduced as part of this Git pull request.

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.