WSL: git: "fatal: fsync error Permission denied"
-
Your Windows build number: Microsoft Windows [Version 10.0.18234.1000]
-
What you’re doing and what’s happening:
atlefren@atlsve-M4800:/mnt/d/code$ git --version git version 2.7.4 atlefren@atlsve-M4800:/mnt/d/code$ git clone git@ssh.dev.azure.com:v3/path/to/repo Cloning into ‘repo’…
path/to/repo is of course edited
… remote: Found 319 objects to send. (11 ms) Receiving objects: 100% (319/319), 186.51 KiB | 0 bytes/s, done. Resolving deltas: 100% (132/132), done. fatal: fsync error on ‘/mnt/d/code/repo/.git/objects/pack/tmp_idx_QfTqP5’: Permission denied fatal: index-pack failed atlefren@atlsve-M4800:/mnt/d/code$
- What’s wrong / what should be happening instead:
The permission denied part and the fact that repo is not cloned.
I get the same error when doing a git pull on an existing repo. However, this does not happen with all repos.
I recently edited the /etc/wsl.conf file to contain this:
[interop]
enabled=false # enable launch of Windows binaries; default is true
appendWindowsPath=false # append Windows path to $PATH variable; default is true
[automount]
options=case=off
the windows drives are mapped like so:
atlefren@atlsve-M4800:/mnt/d/code$ mount
rootfs on / type lxfs (rw,noatime)
root on /root type lxfs (rw,noatime)
home on /home type lxfs (rw,noatime)
data on /data type lxfs (rw,noatime)
cache on /cache type lxfs (rw,noatime)
mnt on /mnt type lxfs (rw,noatime)
none on /dev type tmpfs (rw,noatime,mode=755)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,noatime)
proc on /proc type proc (rw,nosuid,nodev,noexec,noatime)
devpts on /dev/pts type devpts (rw,nosuid,noexec,noatime,gid=5,mode=620)
none on /run type tmpfs (rw,nosuid,noexec,noatime,mode=755)
none on /run/lock type tmpfs (rw,nosuid,nodev,noexec,noatime)
none on /run/shm type tmpfs (rw,nosuid,nodev,noatime)
none on /run/user type tmpfs (rw,nosuid,nodev,noexec,noatime,mode=755)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noatime)
C:\ on /mnt/c type drvfs (rw,relatime,uid=1000,gid=1000,case=off)
D:\ on /mnt/d type drvfs (rw,relatime,uid=1000,gid=1000,case=off)
Also: git clone of the same repo works fine /home/atlefren and works fine on Windows using git on windows. Guess it’s related to the mounting in some way. Problem appeared after updating Windows and adding the [interop]-part to /etc/wsl.conf
- Strace of the failing command, if applicable: https://gist.github.com/atlefren/ac570fe8b3f3e1cdd302964d917f7173
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 18
- Comments: 47 (4 by maintainers)
I noticed this only affects
/mntfolders (at least for me)We have identified the issue and @SvenGroot is working on a fix. Thanks for filing the issue.
Fixed in 18267.
The workaround is to alias
gittogit.exe😃Ugh, painful bug. I hope the fix goes out quickly.
Having the same error in Version 1809 build 18242.1000 and mounted drives to “/” instead
Mounted as such:
Also I’m using this wsl.conf (if helps)
Thanks @benhillis, just upgraded to 18267 and issue is gone 👏
@dannyk81 - Looks like the fix for this issue just missed the 18262 build. I suspect the fix will be in next week’s build.
I’ve only seen this problem when cloning. Pulling and pushing work just fine. So I’ve been cloning outside /mnt then move the whole thing over. In rare cases I have had to run git clone from Windows. Again pulling and pushing work just fine for me.
“repo sync” command failed with permission denied message. I opened the Ubuntu as an administrator and it works fine now.
I arrived on this page after doing an Internet search because I was experiencing
Permission deniederrors when attempting to userepo. For example:The solution was to to to the Windows side add
Everyoneto the newly-createdYoctodirectory and give themFull control. After doing this,repo syncwas able to successfully update from WSL1.I’m posting this here in case it helps anyone else who runs into a similar problem.
@therealkenc i’m running the latest windows, and it doesn’t look like this has been fixed
Came here to also state I see this in 1909 (18363.815)
This is on a drive mounted to a network share with full r/w. All files in the share list as owned by root:root and have full 777 permissions by default.
I am running into this error on 18363:
Unsure if related but I cannot get the metadata option to work with my network shares. It just seems to swallow the option (does not show up in
mounts -l). However, I am able to get a metadata option for the automounts.+1 for this. Please fix, this is a massive pain in the ass.
If it helps anyone, the only solution I’ve found is to restart my machine, then it works…
@mqudsi So basically running windows git on WSL? I’ve removed all the windows binaries from my WSL PATH, so no option for me. But, yeah, why not?
On the other hand: this issue will hopefully be resolved soon…
oh man this is sad.
I’ve gone back to working in a HyperV VM 😦
As I need to access the repo from windows my temporary solution is to use git on windows to clone the repo, seems like git on wsl still works for most other things