datalad / datalad-osf

DataLad extension to interface with the Open Science Framework
Other
14 stars 12 forks source link

unable to clone: get 400 (Bad Request) #125

Closed yarikoptic closed 3 years ago

yarikoptic commented 4 years ago

Following the docs example at http://docs.datalad.org/projects/osf/en/latest/tutorial/cloneosfdata.html I am trying to clone an existing demo dataset, but unfortunately that does not work for not exactly a clear reason:

$> datalad clone osf://n6bgd/ best-study-ever
[ERROR  ] Failed to clone from any candidate source URL. Encountered errors per each url were:                   
| - osf://n6bgd/
  CommandError: 'git clone --progress osf://n6bgd/ /tmp/best-study-ever' failed with exitcode 128 [err: 'Cloning into '/tmp/best-study-ever'...
Traceback (most recent call last):
  File "/home/yoh/proj/datalad/datalad-maint/venvs/dev3/bin/git-remote-osf", line 8, in <module>
    sys.exit(main())
  File "/home/yoh/proj/datalad/datalad-maint/venvs/dev3/lib/python3.8/site-packages/datalad_osf/git_remote.py", line 481, in main
    osf.communicate()
  File "/home/yoh/proj/datalad/datalad-maint/venvs/dev3/lib/python3.8/site-packages/datalad_osf/git_remote.py", line 433, in communicate
    self.send('{}\n'.format(self.get_remote_refs()))
  File "/home/yoh/proj/datalad/datalad-maint/venvs/dev3/lib/python3.8/site-packages/datalad_osf/git_remote.py", line 145, in get_remote_refs
    refs_handle.write_to(fp)
  File "/home/yoh/proj/datalad/datalad-maint/venvs/dev3/lib/python3.8/site-packages/datalad_osf/osfclient/osfclient/models/file.py", line 63, in write_to
    raise RuntimeError("Response has status "
RuntimeError: Response has status code 400.'] [install(/tmp/best-study-ever)] 
install(error): /tmp/best-study-ever (dataset) [Failed to clone from any candidate source URL. Encountered errors per each url were:
- osf://n6bgd/
  CommandError: 'git clone --progress osf://n6bgd/ /tmp/best-study-ever' failed with exitcode 128 [err: 'Cloning into '/tmp/best-study-ever'...
Traceback (most recent call last):
  File "/home/yoh/proj/datalad/datalad-maint/venvs/dev3/bin/git-remote-osf", line 8, in <module>
    sys.exit(main())
  File "/home/yoh/proj/datalad/datalad-maint/venvs/dev3/lib/python3.8/site-packages/datalad_osf/git_remote.py", line 481, in main
    osf.communicate()
  File "/home/yoh/proj/datalad/datalad-maint/venvs/dev3/lib/python3.8/site-packages/datalad_osf/git_remote.py", line 433, in communicate
    self.send('{}\n'.format(self.get_remote_refs()))
  File "/home/yoh/proj/datalad/datalad-maint/venvs/dev3/lib/python3.8/site-packages/datalad_osf/git_remote.py", line 145, in get_remote_refs
    refs_handle.write_to(fp)
  File "/home/yoh/proj/datalad/datalad-maint/venvs/dev3/lib/python3.8/site-packages/datalad_osf/osfclient/osfclient/models/file.py", line 63, in write_to
    raise RuntimeError("Response has status "
RuntimeError: Response has status code 400.']]

What could be the culprit? Direct git clone invocation also fails similarly :

(git)lena:/tmp/test[master]git
$> git clone osf://n6bgd
Cloning into 'n6bgd'...
Traceback (most recent call last):
  File "/home/yoh/proj/datalad/datalad-maint/venvs/dev3/bin/git-remote-osf", line 8, in <module>
    sys.exit(main())
  File "/home/yoh/proj/datalad/datalad-maint/venvs/dev3/lib/python3.8/site-packages/datalad_osf/git_remote.py", line 481, in main
    osf.communicate()
  File "/home/yoh/proj/datalad/datalad-maint/venvs/dev3/lib/python3.8/site-packages/datalad_osf/git_remote.py", line 433, in communicate
    self.send('{}\n'.format(self.get_remote_refs()))
  File "/home/yoh/proj/datalad/datalad-maint/venvs/dev3/lib/python3.8/site-packages/datalad_osf/git_remote.py", line 145, in get_remote_refs
    refs_handle.write_to(fp)
  File "/home/yoh/proj/datalad/datalad-maint/venvs/dev3/lib/python3.8/site-packages/datalad_osf/osfclient/osfclient/models/file.py", line 63, in write_to
    raise RuntimeError("Response has status "
RuntimeError: Response has status code 400.

Also, going to that osf dataset https://osf.io/n6bgd/ shows in description: "this component can be git or datalad cloned from a 'osf://ID' URL, where 'ID' is the OSF node ID that shown in the OSF HTTP URL, e.g. https://osf.io/q8xnk/ can be cloned from osf://q8xnk"

DataLad 0.13.2.dev309 WTF (configuration, datalad, dependencies, environment, extensions, git-annex, location, metadata_extractors, python, system) # WTF ## configuration ## datalad - full_version: 0.13.2.dev309-gdf3d - version: 0.13.2.dev309 ## dependencies - annexremote: 1.4.3 - appdirs: 1.4.3 - boto: 2.49.0 - cmd:7z: 16.02 - cmd:annex: 8.20200720.1+git104-g8bfa7990b-1~ndall+1 - cmd:bundled-git: 2.24.0 - cmd:git: 2.24.0 - cmd:system-git: 2.27.0 - cmd:system-ssh: 8.1p1 - exifread: 2.1.2 - git: 3.1.0 - gitdb: 4.0.2 - humanize: 2.3.0 - iso8601: 0.1.12 - keyring: 18.0.1 - keyrings.alt: 3.4.0 - msgpack: 0.6.2 - mutagen: 1.40.0 - requests: 2.23.0 - scrapy: 1.7.3 - tqdm: 4.43.0 - wrapt: 1.11.2 ## environment - GIT_PAGER: less --no-init --quit-if-one-screen - LANG: en_US.UTF-8 - PATH: /home/yoh/proj/datalad/datalad-maint/venvs/dev3/bin:/home/yoh/gocode/bin:/home/yoh/gocode/bin:/home/yoh/bin:/home/yoh/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/sbin:/usr/sbin:/usr/local/sbin ## extensions - osf: - description: DataLad extension for OSF support - entrypoints: - datalad_osf.create_sibling_osf.CreateSiblingOSF: - class: CreateSiblingOSF - load_error: None - module: datalad_osf.create_sibling_osf - names: - create-sibling-osf - create_sibling_osf - datalad_osf.credentials.OSFCredentials: - class: OSFCredentials - load_error: None - module: datalad_osf.credentials - names: - osf-credentials - osf_credentials - load_error: None - module: datalad_osf - version: 0.2.0 ## git-annex - build flags: - Assistant - Webapp - Pairing - S3 - WebDAV - Inotify - DBus - DesktopNotify - TorrentParser - MagicMime - Feeds - Testsuite - dependency versions: - aws-0.20 - bloomfilter-2.0.1.0 - cryptonite-0.25 - DAV-1.3.3 - feed-1.0.0.0 - ghc-8.4.4 - http-client-0.5.13.1 - persistent-sqlite-2.8.2 - torrent-10000.1.1 - uuid-1.3.13 - yesod-1.6.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* - operating system: linux x86_64 - remote types: - git - gcrypt - p2p - S3 - bup - directory - rsync - web - bittorrent - webdav - adb - tahoe - glacier - ddar - git-lfs - hook - external - supported repository versions: - 8 - upgrade supported from repository versions: - 0 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - version: 8.20200720.1+git104-g8bfa7990b-1~ndall+1 ## location - path: /tmp - type: directory ## metadata_extractors - annex: - load_error: None - module: datalad.metadata.extractors.annex - version: None - audio: - load_error: None - module: datalad.metadata.extractors.audio - version: None - datacite: - load_error: None - module: datalad.metadata.extractors.datacite - version: None - datalad_core: - load_error: None - module: datalad.metadata.extractors.datalad_core - version: None - datalad_rfc822: - load_error: None - module: datalad.metadata.extractors.datalad_rfc822 - version: None - exif: - load_error: None - module: datalad.metadata.extractors.exif - version: None - frictionless_datapackage: - load_error: None - module: datalad.metadata.extractors.frictionless_datapackage - version: None - image: - load_error: None - module: datalad.metadata.extractors.image - version: None - xmp: - load_error: None - module: datalad.metadata.extractors.xmp - version: None ## python - implementation: CPython - version: 3.8.5 ## system - distribution: debian/testing/bullseye - encoding: - default: utf-8 - filesystem: utf-8 - locale.prefered: UTF-8 - max_path_length: 260 - name: Linux - release: 5.6.0-1-amd64 - type: posix - version: #1 SMP Debian 5.6.7-1 (2020-04-29)
adswa commented 4 years ago

FTR: Cloning this exact dataset works for me. So I must be having something that you don't have...

(osf) ╭─adina@muninn /tmp
╰─➤ datalad clone osf://q8xnk
install(ok): /tmp/q8xnk (dataset)    
here is my WTF # WTF ## configuration ## datalad - full_version: 0.13.1 - version: 0.13.1 ## dependencies - annexremote: 1.4.3 - appdirs: 1.4.4 - boto: 2.49.0 - cmd:7z: 16.02 - cmd:annex: 7.20190819+git2-g908476a9b-1~ndall+1 - cmd:bundled-git: 2.20.1 - cmd:git: 2.20.1 - cmd:system-git: 2.28.0 - cmd:system-ssh: 8.3p1 - humanize: 2.5.0 - iso8601: 0.1.12 - keyring: 21.3.0 - keyrings.alt: 3.4.0 - msgpack: 1.0.0 - requests: 2.24.0 - wrapt: 1.12.1 ## environment - LANG: en_US.UTF-8 - LANGUAGE: en_US:en - PATH: /home/adina/env/osf/bin:/home/adina/Documents/freesurfer/bin:/home/adina/Documents/freesurfer/fsfast/bin:/home/adina/Documents/freesurfer/tktools:/usr/share/fsl/5.0/bin:/usr/lib/fsl/5.0:/home/adina/Documents/freesurfer/mni/bin:/usr/share/fsl/5.0/5.0/bin:/home/adina/.local/bin:/home/adina/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/adina/.dotfiles/bin:/usr/local/go/bin:/home/adina/work/bin - PYTHONPATH: /usr/bin/python ## extensions - osf: - description: DataLad extension for OSF support - entrypoints: - datalad_osf.create_sibling_osf.CreateSiblingOSF: - class: CreateSiblingOSF - load_error: None - module: datalad_osf.create_sibling_osf - names: - create-sibling-osf - create_sibling_osf - datalad_osf.credentials.OSFCredentials: - class: OSFCredentials - load_error: None - module: datalad_osf.credentials - names: - osf-credentials - osf_credentials - load_error: None - module: datalad_osf - version: 0.2.0 ## git-annex - build flags: - Assistant - Webapp - Pairing - S3 - WebDAV - Inotify - DBus - DesktopNotify - TorrentParser - MagicMime - Feeds - Testsuite - dependency versions: - aws-0.20 - bloomfilter-2.0.1.0 - cryptonite-0.25 - DAV-1.3.3 - feed-1.0.0.0 - ghc-8.4.4 - http-client-0.5.13.1 - persistent-sqlite-2.8.2 - torrent-10000.1.1 - uuid-1.3.13 - yesod-1.6.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 - operating system: linux x86_64 - remote types: - git - gcrypt - p2p - S3 - bup - directory - rsync - web - bittorrent - webdav - adb - tahoe - glacier - ddar - git-lfs - hook - external - supported repository versions: - 5 - 7 - upgrade supported from repository versions: - 0 - 1 - 2 - 3 - 4 - 5 - 6 - version: 7.20190819+git2-g908476a9b-1~ndall+1 ## location - path: /tmp - type: directory ## metadata_extractors - annex: - load_error: None - module: datalad.metadata.extractors.annex - version: None - audio: - load_error: No module named 'mutagen' [audio.py::17] - module: datalad.metadata.extractors.audio - datacite: - load_error: None - module: datalad.metadata.extractors.datacite - version: None - datalad_core: - load_error: None - module: datalad.metadata.extractors.datalad_core - version: None - datalad_rfc822: - load_error: None - module: datalad.metadata.extractors.datalad_rfc822 - version: None - exif: - load_error: No module named 'exifread' [exif.py::16] - module: datalad.metadata.extractors.exif - frictionless_datapackage: - load_error: None - module: datalad.metadata.extractors.frictionless_datapackage - version: None - image: - load_error: No module named 'PIL' [image.py::16] - module: datalad.metadata.extractors.image - xmp: - load_error: No module named 'libxmp' [xmp.py::20] - module: datalad.metadata.extractors.xmp ## python - implementation: CPython - version: 3.8.5 ## system - distribution: debian/testing/bullseye - encoding: - default: utf-8 - filesystem: utf-8 - locale.prefered: UTF-8 - max_path_length: 260 - name: Linux - release: 5.7.0-2-amd64 - type: posix - version: #1 SMP Debian 5.7.10-1 (2020-07-26)

It also worked after upgrading to 0.13.2.dev9. I'm also attaching what else is in my venv:

pip freeze ``` annexremote==1.4.3 appdirs==1.4.4 boto==2.49.0 certifi==2020.6.20 cffi==1.14.1 chardet==3.0.4 cryptography==3.0 -e git+git@github.com:adswa/datalad.git@4ff2cb05a328c91a6ac3fc48ace3e7d7a2bf4668#egg=datalad datalad-osf==0.2.0 Deprecated==1.2.10 distro==1.5.0 fasteners==0.15 future==0.18.2 humanize==2.5.0 idna==2.10 iso8601==0.1.12 jeepney==0.4.3 jsmin==2.2.2 keyring==21.3.0 keyrings.alt==3.4.0 monotonic==1.5 msgpack==1.0.0 patool==1.12 pycparser==2.20 PyGithub==1.51 PyJWT==1.7.1 requests==2.24.0 SecretStorage==3.1.2 simplejson==3.17.2 six==1.15.0 tqdm==4.48.0 urllib3==1.25.10 Whoosh==2.7.4 wrapt==1.12.1 ```
adswa commented 4 years ago

although description says it that it is just "an example", IMHO would be better to tune it to use this particular dataset id (n6bgd) not some other q8xnk, so fast/silly readers like me do not just skip the preamble of the lengthy description and would start assuming that may be the ID is for the same dataset but some different version or smth

created #126 in response

adswa commented 4 years ago

Could you maybe run this with --dbg and see if the http response has any more meaningful information? When I did #126, it contained info on required attributes I initially didn't specify, for example...

adswa commented 4 years ago

FWIW I'm getting the same error on our Windows machine right now, and I just can't get behind the cause of it.

WTF on this machine ## configuration ## datalad - full_version: 0.13.0rc2 - version: 0.13.0rc2 ## dataset - id: None - metadata: - path: C:\Users\mih\code\datalad-osf - repo: GitRepo ## dependencies - appdirs: 1.4.3 - boto: 2.49.0 - cmd:7z: 19.00 - cmd:annex: 8.20200331-gb11931a4a - cmd:bundled-git: UNKNOWN - cmd:git: 2.23.0.windows.1 - cmd:system-git: 2.23.0.windows.1 - cmd:system-ssh: 8.0p1 - git: 3.0.2 - gitdb: 2.0.5 - humanize: 0.5.1 - iso8601: 0.1.12 - keyring: 19.1.0 - keyrings.alt: 3.1.1 - msgpack: 0.6.1 - requests: 2.22.0 - tqdm: 4.32.1 - wrapt: 1.11.2 ## environment - PATH: C:\Users\mih\Miniconda3;C:\Users\mih\Miniconda3\Library\mingw-w64\bin;C:\Users\mih\Miniconda3\Library\usr\bin;C:\Users\mih\Miniconda3\Library\bin;C:\Users\mih\Miniconda3\Scripts;C:\Users\mih\Miniconda3\bin;C:\Users\mih\Miniconda3\condabin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\TortoiseGit\bin;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\TortoiseGit\bin;C:\Users\mih\AppData\Local\Microsoft\WindowsApps;C:\Users\mih\Miniconda3\Library\mingw64\bin;C:\Program Files (x86)\Midnight Commander;C:\Program Files (x86)\7-Zip;. ## extensions - metalad: - description: DataLad semantic metadata command suite - entrypoints: - datalad_metalad.aggregate.Aggregate: - class: Aggregate - load_error: None - module: datalad_metalad.aggregate - names: - meta-aggregate - meta_aggregate - datalad_metalad.dump.Dump: - class: Dump - load_error: None - module: datalad_metalad.dump - names: - meta-dump - meta_dump - datalad_metalad.extract.Extract: - class: Extract - load_error: None - module: datalad_metalad.extract - names: - meta-extract - meta_extract - load_error: None - module: datalad_metalad - version: 0.2.0 - osf: - description: DataLad extension for OSF support - entrypoints: - datalad_osf.create_sibling_osf.CreateSiblingOSF: - class: CreateSiblingOSF - load_error: None - module: datalad_osf.create_sibling_osf - names: - create-sibling-osf - create_sibling_osf - datalad_osf.credentials.OSFCredentials: - class: OSFCredentials - load_error: None - module: datalad_osf.credentials - names: - osf-credentials - osf_credentials - load_error: None - module: datalad_osf - version: 0.2.0+1.g27e6958.dirty ## git-annex - build flags: - Assistant - Webapp - Pairing - S3 - WebDAV - TorrentParser - Feeds - Testsuite - dependency versions: - aws-0.21.1 - bloomfilter-2.0.1.0 - cryptonite-0.25 - DAV-1.3.4 - feed-1.2.0.1 - ghc-8.6.5 - http-client-0.6.4 - persistent-sqlite-2.9.3 - torrent-10000.1.1 - uuid-1.3.13 - yesod-1.6.0.1 - 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 - operating system: mingw32 x86_64 - remote types: - git - gcrypt - p2p - S3 - bup - directory - rsync - web - bittorrent - webdav - adb - tahoe - glacier - ddar - git-lfs - hook - external - supported repository versions: - 8 - upgrade supported from repository versions: - 2 - 3 - 4 - 5 - 6 - 7 - version: 8.20200331-gb11931a4a ## location - path: C:\Users\mih\code\datalad-osf - type: dataset ## metadata_extractors - annex: - load_error: None - module: datalad.metadata.extractors.annex - version: None - audio: - load_error: No module named 'mutagen' [audio.py::17] - module: datalad.metadata.extractors.audio - datacite: - load_error: None - module: datalad.metadata.extractors.datacite - version: None - datalad_core: - load_error: None - module: datalad.metadata.extractors.datalad_core - version: None - datalad_rfc822: - load_error: None - module: datalad.metadata.extractors.datalad_rfc822 - version: None - exif: - load_error: No module named 'exifread' [exif.py::16] - module: datalad.metadata.extractors.exif - frictionless_datapackage: - load_error: None - module: datalad.metadata.extractors.frictionless_datapackage - version: None - image: - load_error: No module named 'PIL' [image.py::16] - module: datalad.metadata.extractors.image - metalad_annex: - load_error: None - module: datalad_metalad.extractors.annex - version: None - metalad_core: - load_error: None - module: datalad_metalad.extractors.core - version: None - metalad_custom: - load_error: None - module: datalad_metalad.extractors.custom - version: None - metalad_runprov: - load_error: None - module: datalad_metalad.extractors.runprov - version: None - xmp: - load_error: No module named 'libxmp' [xmp.py::20] - module: datalad.metadata.extractors.xmp ## python - implementation: CPython - version: 3.7.3 ## system - distribution: 10/10.0.18965/SP0/Multiprocessor Free - encoding: - default: utf-8 - filesystem: utf-8 - locale.prefered: cp1252 - max_path_length: 259 - name: Windows - release: 10 - type: nt - version: 10.0.18965

... what working with the windows machine feels like (live from my desk)

EDIT: I now got past the "Bad request" status (and promptly remembered that a datalad clone from this repo isn't possible on Windows ;-) ). It was a malformed OSF token. Not sure whether this is true in your case, too...

adswa commented 3 years ago

The only way I can reproduce this if the credentials are not correct. If you still have the same OSF credential configuration, could you just just datalad osf-credentials and check that authentication works?

yarikoptic commented 3 years ago

Sorry for me forgetting about this one -- confirming it was credentials. Added new an it worked.

full protocol ```shell $> datalad clone osf://n6bgd/ best-study-ever [ERROR ] Failed to clone from any candidate source URL. Encountered errors per each url were: | - osf://n6bgd/ CommandError: 'git -c diff.ignoreSubmodules=none clone --progress osf://n6bgd/ /tmp/best-study-ever' failed with exitcode 128 [err: 'Cloning into '/tmp/best-study-ever'... fatal: bad revision 'HEAD' fatal: Response has status code 400.'] [install(/tmp/best-study-ever)] install(error): /tmp/best-study-ever (dataset) [Failed to clone from any candidate source URL. Encountered errors per each url were: - osf://n6bgd/ CommandError: 'git -c diff.ignoreSubmodules=none clone --progress osf://n6bgd/ /tmp/best-study-ever' failed with exitcode 128 [err: 'Cloning into '/tmp/best-study-ever'... fatal: bad revision 'HEAD' fatal: Response has status code 400.']] $> datalad osf-credentials osf_credentials(error): [Invalid credentials] $> datalad osf-credentials --reset You need to authenticate with 'https://osf.io' credentials. https://osf.io/settings/tokens provides information on how to gain access token: osf_credentials(ok): [authenticated as Yaroslav O. Halchenko ] $> datalad clone osf://n6bgd/ best-study-ever [INFO ] Scanning for unlocked files (this may take some time) [INFO ] Remote origin uses a protocol not supported by git-annex; setting annex-ignore install(ok): /tmp/best-study-ever (dataset) ```

do you think it would be feasible somehow to percolate that information to the user, since otherwise it is just a 400 (not 403) which only is seen.

adswa commented 3 years ago

Mhh, its been a while since I had worked on this, but if I remember correctly, I never saw any authentication errors in the http responses that we could propagate. I assume we could check for credential validity before a clone, but that seems to be a costly operation

yarikoptic commented 3 years ago

feel welcome to close until issue reemerges reported by a user (might never come, I might be special ;-))

adswa commented 3 years ago

You're definitely special :P

I'll close it for now.