SIMEXP / Repo2Data

Automatic data fetcher from the web
MIT License
7 stars 3 forks source link

OSF error - "Please set a username" #19

Open mathieuboudreau opened 2 years ago

mathieuboudreau commented 2 years ago

Hi there,

I'm trying to use this tool with an OSF link, but am getting an error asking for me to set a username.

Here is my config file:

{ "src": "https://osf.io/qsa4x/",
  "dst": ".",
  "projectName": "mrm_analysis"}

And here is the output error:


(base) mathieuboudreau@Mathieus-MacBook-Pro mrm_analysis % repo2data -r data.json
---- repo2data starting ----
/Users/mathieuboudreau/opt/anaconda3/lib/python3.8/site-packages/repo2data
Config from file :
data.json
Destination:
./mrm_analysis

Info : Starting to download from osf https://osf.io/qsa4x/ ...
usage: osf clone [-h] [-U] [output]
osf clone: error: Please set a username (run `osf -h` for details).
Traceback (most recent call last):
  File "/Users/mathieuboudreau/opt/anaconda3/bin/repo2data", line 60, in <module>
    main()
  File "/Users/mathieuboudreau/opt/anaconda3/bin/repo2data", line 57, in main
    repo2data.install()
  File "/Users/mathieuboudreau/opt/anaconda3/lib/python3.8/site-packages/repo2data/repo2data.py", line 75, in install
    ret += [Repo2DataChild(self._data_requirement_file, self._use_server).install()]
  File "/Users/mathieuboudreau/opt/anaconda3/lib/python3.8/site-packages/repo2data/repo2data.py", line 262, in install
    self._scan_dl_type()
  File "/Users/mathieuboudreau/opt/anaconda3/lib/python3.8/site-packages/repo2data/repo2data.py", line 251, in _scan_dl_type
    self._osf_download()
  File "/Users/mathieuboudreau/opt/anaconda3/lib/python3.8/site-packages/repo2data/repo2data.py", line 208, in _osf_download
    subprocess.check_call(['osf'
  File "/Users/mathieuboudreau/opt/anaconda3/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['osf', '--project', 'qsa4x', 'clone', './mrm_analysis']' returned non-zero exit status 1.
(base) mathieuboudreau@Mathieus-MacBook-Pro mrm_analysis % 

I didn't see anywhere in the OSF section of your README it indicating I had to provide a username, is that so?

mathieuboudreau commented 2 years ago

facepalms nevermind, OSF had created my project private by default, I didn't catch that.

The website is bugging out and won't let me put it public, but that's surely the problem.

Maybe a more descriptive error would be helpful, if it's easy to implement?

ltetrel commented 2 years ago

Hi @mathieuboudreau,

For error handling I mostly rely on the library that it is being used. that would be indeed too much work for me to catch all errors and make them more readable. you can check all download libraries here: https://github.com/SIMEXP/Repo2Data/blob/master/requirements.txt.

I also just emphasis in the doc that the the osf project indeed needs to be public.

lmk if the issue persists,

mathieuboudreau commented 1 year ago

The issue persists,

osf clone: error: Please set a username (run `osf -h` for details).

Also, the current setup in repo2data requires that it points to an OSF project, and downloads that entire project, instea of pointing to a single file and downloading just that file.