Closed anne-urai closed 2 years ago
Hey Anne, I was able to run your code above without any "HTTPError: Forbidden" errors. There was one, potentially important, change I made regarding the initial set up of openalyx. Unless you configured it earlier, it does not look like the password was set for your openalyx connection. Specifically I am referring to this part:
...
pw = 'international'
one = ONE().setup(base_url='https://openalyx.internationalbrainlab.org')
...
To be certain you do not have anything weird that might be causing problems in your stored ONE credentials please run the following command in your terminal: mv /Users/urai/.one /Users/urai/.one_bkup
Then please reattempt to load your data as before, but with the following difference:
from one.api import ONE
pw = 'international'
one = ONE(base_url='https://openalyx.internationalbrainlab.org', password=pw, silent=True)
Let me know if that works for you or if you run into the same issue.
Full list of commands that functioned for me and their output:
(ibl_py3.9) michele@gala:~/Documents$ python
Python 3.9.12 (main, Jun 1 2022, 11:38:51)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from one.api import ONE
>>> pw = 'international'
>>> one = ONE(base_url='https://openalyx.internationalbrainlab.org', password=pw, silent=True)
>>> rep_site_sessions = one.alyx.rest('sessions', 'list', dataset_types='spikes.times', tag='2022_Q2_IBL_et_al_RepeatedSite')
>>> files = one.load_collection(rep_site_sessions[-1], 'alf', download_only=True)
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
/home/michele/Downloads/ONE/openalyx.internationalbrainlab.org/wittenlab/Subjects/ibl_witten_13/2019
>>> trials = one.load_object(rep_site_sessions[-1], 'trials', collection='alf')
>>> type(trials)
<class 'one.alf.io.AlfBunch'>
...
@micheleangelofabbri I think this is entirely unrelated to ONE parameters. It appears to be a problem of file permissions on FlatIron. You are probably not seeing any download errors because you're using AWS instead of FlatIron. I can reproduce Anne's issue on my machine.
@anne-urai You can download from AWS instead of FlatIron by installing boto3 into your environment (pip install boto3
). If you then restart python / your notebook, the downloads should work without error.
I can see that this error occurred because some trials datasets were removed but the public filesystem wasn't rebuilt. I'll try to get this done this week.
Thanks @k1o0, indeed installing boto3
does the trick. Perhaps this could be added to the ONE-api
requirements?
Yes we'll add it in the next release
Describe the bug
Following the instructions here https://int-brain-lab.github.io/iblenv/notebooks_external/data_release_repro_ephys.html#Overview-of-the-Data
and then downloading the ALF files for one example dataset,
I can download a subset of the files, but not all (it ends in a HTTP forbidden error). Across a few tested datasets, they are usually the same
npy
files that have this error (o.a.trials.probabilityLeft
,trials.choice
).Since I can download many other files correctly, and I'm connected to OpenAlyx correctly, could there be another reason why I can't access a subset of files?
Note: I get the same HTTP: Forbidden errors when loading through
trials = one.load_object(rep_site_sessions[-1], 'trials', collection='alf')
.Full output: