-
Notifications
You must be signed in to change notification settings - Fork 848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Files created with WSL distro to Windows drive are corrupted #11604
Comments
Logs are required for review from WSL teamIf this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. How to collect WSL logsDownload and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The scipt will output the path of the log file once done. Once completed please upload the output files to this Github issue. Click here for more info on logging View similar issuesPlease view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it! Closed similar issues:
|
Adding logs from collect-wsl-logs.ps1: |
The log file doesn't contain any WSL traces. Please make sure that you reproduced the issue while the log collection was running. Diagnostic information
|
I did reproduce the issue when generating the attached logs. |
I just hit the same issue with a plain text file created via vim in my WSL distro, but to another location on the Windows C:\ drive. So the issue is not git-specific. I updated the issue title accordingly. |
Logs are required for review from WSL teamIf this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. How to collect WSL logsDownload and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The scipt will output the path of the log file once done. Once completed please upload the output files to this Github issue. Click here for more info on logging View similar issuesPlease view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it! Closed similar issues:
|
Reviewing the /mnt/c mount: $ mount | grep 'C:\' |
Thank you @flakfizer. I wonder if the issue comes from the windows filesystem here. Can you share the output of Also can you share the full strace of the command that seems to crate the corrupted file ? |
chkdsk reports no issues with the volume when run after repo-ing. Redacted full strace output attached here . |
If it helps, I also started hitting this issue and I can a persistent repro for it |
Duplicate of #11619 Refer to related issue which is closed now. #11619 (comment) The root cause of the error is in the MDE plug-in for WSL. The issue has been fixed inside that plugin version 1.24.605.1. |
@flakfizer Can you mention the exact steps of repro while creating a text file and the failure message |
I'm not able to reproduce reliably. The comment you referred to was in reference to an issue I hit once but haven't seen since. |
Windows Version
10.0.22631.3593
WSL Version
2.1.5.0
Are you using WSL 1 or WSL 2?
Kernel Version
5.15.146.1-2
Distro Version
Ubuntu 23.10
Other Software
$ which git
/usr/bin/git
$ git --version
git version 2.40.1
Repro Steps
git clone of a new repo is failing when cloning into a directory outside of the WSL VM using the WSL distro's git binary. The initially created .git dir HEAD and config files appear to be corrupted as seen from within WSL, but not Windows.
(I've anonymized my project and repo names)
$ wslpath -w $(pwd)
C:\dev\proj\myproj
$ git config --list --show-origin
<shows ~/.gitconfig as only config file with expected contents>
$ git clone https://
Cloning into 'MyProj'
fatal: unknown error occurred while reading the configuration files
$ cd MyProj/.git
$ ls -li
ls: cannot access 'config': No such file or directory
ls: cannot access 'HEAD': No such file or directory
total 0
-????????? ? ? ? ? ? HEAD
-????????? ? ? ? ? ? config
$ cat config
cat: config: No such file or directory
$ cat HEAD
cat: HEAD: No file or directory
These files appear to created without issue as accessed directly from Windows:
PS> cd C:\dev\proj\myproj\MyProj.git
PS > ls
Mode LastWriteTime Length Name
-a---- 5/21/2024 12:35 PM 26 config
-a---- 5/21/2024 12:35 PM 23 HEAD
(expected)
PS > Get-Content config
[core]
ignorecase = true
(expected)
PS > Get-Content HEAD
ref: refs/heads/master
(expected)
strace of the clone shows the newfstatat of config and HEAD failing (not surprisingly, given the above), which is the cause of the clone failure:
$ strace -o clone.strace git clone https://
Cloning into 'MyProj'
fatal: unknown error occurred while reading the configuration files
$ tail -n15 clone.strace
openat(AT_FDCWD, "MyProj", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
newfstatat(3, "", {st_mode=S_IFDIR|0777, st_size=4096, ...}, AT_EMPTY_PATH) = 0
getdents64(3, 0x561125a099a0 /* 3 entries /, 32768) = 72
newfstatat(AT_FDCWD, "MyProj/.git", {st_mode=S_IFDIR|0777, st_size=4096, ...}, AT_SYMLINK_NOFOLLOW) = 0
openat(AT_FDCWD, "MyProj/.git", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 4
newfstatat(4, "", {st_mode=S_IFDIR|0777, st_size=4096, ...}, AT_EMPTY_PATH) = 0
getdents64(4, 0x561125a119e0 / 4 entries /, 32768) = 104
newfstatat(AT_FDCWD, "MyProj/.git/config", 0x7ffcef0cff30, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "MyProj/.git/HEAD", 0x7ffcef0cff30, AT_SYMLINK_NOFOLLOW) = -1 ENOENT (No such file or directory)
getdents64(4, 0x561125a119e0 / 0 entries */, 32768) = 0
close(4) = 0
rmdir("MyProj/.git") = -1 ENOTEMPTY (Directory not empty)
close(3) = 0
exit_group(128) = ?
+++ exited with 128 +++
Other notes:
Expected Behavior
A successfully cloned git repo with .git/{HEAD,config} files accessible via their Windows drive or through WSL.
Actual Behavior
(see repro steps)
Diagnostic Logs
(see repo steps)
The text was updated successfully, but these errors were encountered: