Skip to content
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

OSF error - "Please set a username" #19

Open
mathieuboudreau opened this issue Apr 13, 2022 · 3 comments
Open

OSF error - "Please set a username" #19

mathieuboudreau opened this issue Apr 13, 2022 · 3 comments

Comments

@mathieuboudreau
Copy link

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
Copy link
Author

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
Copy link
Member

ltetrel commented Apr 13, 2022

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
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants