Datalad save doesn't work: permission denied

Hello, I created a datalad dataset with datalad create NAME and added a simple participants.json file:

├── .datalad
│   ├── .gitattributes
│   └── config
├── .git
│   ├── COMMIT_EDITMSG
│   ├── HEAD
│   ├── annex
│   ├── config
│   ├── config.dataladlock
│   ├── description
│   ├── hooks
│   ├── index
│   ├── info
│   ├── logs
│   ├── objects
│   └── refs
├── .gitattributes
└── participants.json 

when doing datalad save -m "message" participants.json , I get the following error message :

>git-annex: .git/annex/othertmp/participants.json.0/participants.json: rename: permission denied (Permission denied)
git-annex: add: 1 failed

I am using WSL2 on Windows 10. here is the datalad wtf

## configuration <SENSITIVE, report disabled by configuration>
## credentials
  - keyring:
    - active_backends:
      - PlaintextKeyring with no encyption v.1.0 at /home/mmaclean/.local/share/python_keyring/keyring_pass.cfg
    - config_file: /home/mmaclean/.config/python_keyring/keyringrc.cfg
    - data_root: /home/mmaclean/.local/share/python_keyring
## datalad
  - version: 0.15.4
## dataset
  - branches:
    - git-annex@ab35102
    - master@beffb8e
  - id: 73e27049-fb00-472e-a1e0-d32ae8c6f294
  - metadata: <SENSITIVE, report disabled by configuration>
  - path: /c/Users/michm/Data/NAME
  - repo: AnnexRepo
## dependencies
  - annexremote: 1.4.3
  - appdirs: 1.4.4
  - boto: 2.49.0
  - cmd:7z: 16.02
  - cmd:annex: 8.20210127-g42239bc
  - cmd:bundled-git: UNKNOWN
  - cmd:git: 2.30.0
  - cmd:system-git: 2.30.0
  - cmd:system-ssh: 8.4p1
  - exifread: 2.1.2
  - humanize: 3.2.0
  - iso8601: 0.1.13
  - keyring: 22.0.1
  - keyrings.alt: 4.0.2
  - msgpack: 1.0.2
  - mutagen: 1.41.1
  - requests: 2.25.1
  - wrapt: 1.12.1
## environment
  - LANG: C.UTF-8
  - PATH: /usr/local/fsl/bin:/home/mmaclean/.local/bin:/home/mmaclean/miniconda3/bin:/home/mmaclean/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/c/Program Files/NVIDIA Corporation/NVIDIA NvDLISR:/c/Program Files/MATLAB/R2019b/bin:/c/Program Files/SlikSvn/bin:/c/Program Files/Git/cmd:/c/Program Files (x86)/Pulse Secure/VC142.CRT/X64:/c/Program Files (x86)/Pulse Secure/VC142.CRT/X86:/c/Program Files/Docker/Docker/resources/bin:/c/ProgramData/DockerDesktop/version-bin:/c/Users/michm/AppData/Local/Microsoft/WindowsApps:/c/Users/michm/AppData/Local/Programs/MiKTeX 2.9/miktex/bin/x64:/c/Users/michm/AppData/Local/Programs/Microsoft VS Code/bin:/c/Users/michm/AppData/Local/gitkraken/bin:/snap/bin:/home/mmaclean/.local/bin
  - PYTHONPATH: /home/mmaclean/dipy:
## extensions
## git-annex
  - build flags:
    - Assistant
    - Webapp
    - Pairing
    - Inotify
    - DBus
    - DesktopNotify
    - TorrentParser
    - MagicMime
    - Feeds
    - Testsuite
    - S3
    - WebDAV
  - dependency versions:
    - aws-0.22
    - bloomfilter-2.0.1.0
    - cryptonite-0.26
    - DAV-1.3.4
    - feed-1.3.0.1
    - ghc-8.8.4
    - http-client-0.6.4.1
    - persistent-sqlite-2.10.6.2
    - torrent-10000.1.1
    - uuid-1.3.13
    - yesod-1.6.1.0
  - key/value backends:
    - SHA256E
    - SHA256
    - SHA512E
    - SHA512
    - SHA224E
    - SHA224
    - SHA384E
    - SHA384
    - SHA3_256E
    - SHA3_256
    - SHA3_512E
    - SHA3_512
    - SHA3_224E
    - SHA3_224
    - SHA3_384E
    - SHA3_384
    - SKEIN256E
    - SKEIN256
    - SKEIN512E
    - SKEIN512
    - BLAKE2B256E
    - BLAKE2B256
    - BLAKE2B512E
    - BLAKE2B512
    - BLAKE2B160E
    - BLAKE2B160
    - BLAKE2B224E
    - BLAKE2B224
    - BLAKE2B384E
    - BLAKE2B384
    - BLAKE2BP512E
    - BLAKE2BP512
    - BLAKE2S256E
    - BLAKE2S256
    - BLAKE2S160E
    - BLAKE2S160
    - BLAKE2S224E
    - BLAKE2S224
    - BLAKE2SP256E
    - BLAKE2SP256
    - BLAKE2SP224E
    - BLAKE2SP224
    - SHA1E
    - SHA1
    - MD5E
    - MD5
    - WORM
    - URL
    - X*
  - local repository version: 8
  - operating system: linux x86_64
  - remote types:
    - git
    - gcrypt
    - p2p
    - S3
    - bup
    - directory
    - rsync
    - web
    - bittorrent
    - webdav
    - adb
    - tahoe
    - glacier
    - ddar
    - git-lfs
    - httpalso
    - borg
    - hook
    - external
  - supported repository versions:
    - 8
  - upgrade supported from repository versions:
    - 0
    - 1
    - 2
    - 3
    - 4
    - 5
    - 6
    - 7
  - version: 8.20210127-g42239bc
## location
  - path: /c/Users/michm/Data/NAME
  - type: dataset
## metadata_extractors
  - annex (datalad 0.15.4):
    - distribution: datalad 0.15.4
    - load_error: None
    - module: datalad.metadata.extractors.annex
    - version: None
  - audio (datalad 0.15.4):
    - distribution: datalad 0.15.4
    - load_error: None
    - module: datalad.metadata.extractors.audio
    - version: None
  - datacite (datalad 0.15.4):
    - distribution: datalad 0.15.4
    - load_error: None
    - module: datalad.metadata.extractors.datacite
    - version: None
  - datalad_core (datalad 0.15.4):
    - distribution: datalad 0.15.4
    - load_error: None
    - module: datalad.metadata.extractors.datalad_core
    - version: None
  - datalad_rfc822 (datalad 0.15.4):
    - distribution: datalad 0.15.4
    - load_error: None
    - module: datalad.metadata.extractors.datalad_rfc822
    - version: None
  - exif (datalad 0.15.4):
    - distribution: datalad 0.15.4
    - load_error: None
    - module: datalad.metadata.extractors.exif
    - version: None
  - frictionless_datapackage (datalad 0.15.4):
    - distribution: datalad 0.15.4
    - load_error: None
    - module: datalad.metadata.extractors.frictionless_datapackage
    - version: None
  - image (datalad 0.15.4):
    - distribution: datalad 0.15.4
    - load_error: None
    - module: datalad.metadata.extractors.image
    - version: None
  - xmp (datalad 0.15.4):
    - distribution: datalad 0.15.4
    - load_error: ModuleNotFoundError(No module named 'libxmp')
    - module: datalad.metadata.extractors.xmp
## metadata_indexers
## python
  - implementation: CPython
  - version: 3.7.9
## system
  - distribution: debian/buster/sid
  - encoding:
    - default: utf-8
    - filesystem: utf-8
    - locale.prefered: UTF-8
  - max_path_length: 300
  - name: Linux
  - release: 5.10.60.1-microsoft-standard-WSL2
  - type: posix
  - version: #1 SMP Wed Aug 25 23:20:18 UTC 2021

Any thoughts as to why datalad can’t save?
Thanks!

Hi Michèle

Can you print outputs of ls -la in your directory to see the read/write permissions of files and sub-folders?

Thanks,
Steven

Hello Steven,
Thanks for your reply.

ls -la in the directory returns:

total 4
drwxr-xr-x 1 mmaclean mmaclean 512 Jan 26 11:10 .
drwxrwxrwx 1 mmaclean mmaclean 512 Jan 26 11:00 ..
drwxr-xr-x 1 mmaclean mmaclean 512 Jan 26 11:00 .datalad
drwxr-xr-x 1 mmaclean mmaclean 512 Jan 27 10:04 .git
-rw-r--r-- 1 mmaclean mmaclean  55 Jan 26 11:00 .gitattributes
-rwxr-xr-x 1 mmaclean mmaclean 935 Apr 12  2021 participants.json

Thanks,
Michèle

@mwmaclean and I most likely found the issue.

So even though we were using WSL, we had created the dataset and were trying to save data on the WIndows part of the file system (typically mounted in /mnt/c/... in the WSL environment).

When trying those same operation in the home folder of the WSL, then things worked as intended.

1 Like

I’m currently having the same issue. Does your answer mean it is simply not possible to work (e.g. save) with datasets on the windows part of my file system, when using WSL?

Pretty much I think.

The windows file system does not support symlinks that underpins the whole git-annex thing that datalad uses.

So if you use WSL but make your way to your windows file system that way, datalad won’t be happy.

Will let @yarikoptic confirm this.

1 Like

Ah I see. I’m currently working my way through the handbook and it’s just some things that do not work. Like saving the books in section 1.2, then the above error occured. After that everything worked like a charm until at section 5.3, I tried to use the “write your own procedures” and then again saving the python code didn’t work… Any ideas?
Or should I open a new thread?

thinking might be better to open an issue on the datalad handbook repo on github

1 Like