Closed yger closed 4 years ago
Are you running the kachery-p2p daemon?
Also, I would focus on the demo script first as it allows a much more fine-grained selection of which data to download. And it is loaded in a way that the format is unambiguous, including the electrode layout, etc.
Ok, I forgot the kachery-p2p daemon, now installed and running fine (at last, it seems fine). However, when trying to execute the code snippet on the github, I still have the following error ` LoadFileError Traceback (most recent call last)
And the error for the script download_all.py is different
Creating (1 of 7): recordings/cortexlab-single-phase-3.dat
/usr/lib/python3/dist-packages/apport/report.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import fnmatch, glob, traceback, errno, sys, atexit, locale, imp
Traceback (most recent call last):
File "scripts/download_all.py", line 22, in
Could you please try the sample script again? I think something timed out.
Error is now
Exception: Unable to load object: sha1://4184f3c842745e9e48b4e5aeb0a2019912837e5f/cortexlab-single-phase-3-ch0-7-10sec.json
Hmmm. I suspect the files are not being loaded because something keeps timing out. (It is working on my machine, so I can't reproduce). Maybe it relates to geographic distance to the data.
If you want you can keep trying to run the script and I suspect things will load after a couple tries.
But if you wait a few hours we will release a new version that has more careful timeouts set.
Tagging: @jsoules
Ok, I'll keep retrying this afternoon, and see how it goes. I used kachery-p2p from pip install, and not from master branch. Could it be the reason?
And for info, this is the log of kachery
PROTOCOL VERSION: kachery-p2p-0.4.18
CHANNEL: flatiron1 (7 nodes) self 9748db Node de05da... li1075-33: 45.33.92.33:45002 bootstrap out udp-in udp-out Node d94fda... labbox-ephys-deployment-7c989c78c6-m6k9x: ephys1.laboratorybox.org:14107 out Node da13c4... dubb: : udp-in udp-out Node 9beb5d... ccmlin008.flatironinstitute.org: :4008 udp-in udp-out Node f64510... tegula: : udp-in udp-out Node* abf4d3... DBC-Linux: : udp-in udp-out
OTHER self 9748db Node f10a45... li1075-31: 45.33.92.31:45002 bootstrap out udp-in udp-out
The pypi version should be good. Thanks for testing!
On Mon, Aug 24, 2020 at 8:25 AM Pierre Yger notifications@github.com wrote:
Ok, I'll keep retrying this afternoon, and see how it goes. I used kachery-p2p from pip install, and not from master branch. Could it be the reason?
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/flatironinstitute/neuropixels-data-sep-2020/issues/10#issuecomment-679095161, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA4CIQEJS4CFTRWTFQXYMK3SCJL2JANCNFSM4QJHJRRQ .
No problem, looking forward to try it out. I also forgot a portion of the error in fact
Loaded file: sha1://4184f3c842745e9e48b4e5aeb0a2019912837e5f/cortexlab-single-phase-3-ch0-7-10sec.json /usr/lib/python3/dist-packages/traitlets/config/configurable.py:143: ResourceWarning: unclosed <socket.socket fd=33, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 39868), raddr=('127.0.0.1', 20431)> for name, config_value in my_config.items(): ResourceWarning: Enable tracemalloc to get the object allocation traceback
Thanks. I've seen that particular warning before (it seems to be benign).
I've increased the default timeouts and pushed another version to pypi. So please try pip install --upgrade kachery-p2p
and you should get version 0.4.25 (via pip show). Then restart the daemon. Don't worry that the console still shows protocol version 0.4.18, that's expected.
Then I'm guessing that the load will work. (Fingers crossed)
Sadly, I just upgraded kachery, and even with version 0.4.25 (and nodejs 12.18.3), the errors are the same :-(
Okay, thanks so much for testing. I am going to confer with @jsoules, and we will come up with a more robust solution for this. Please hang tight and expect something by tomorrow.
Thanks for reporting this issue. To make sure I'm on the same page, would you mind pasting the code/command you were trying to execute?
Also, could I ask you to try again and time how long it takes for you to get the error? Just something simple like:
from time import perf_counter
start = perf_counter()
try:
YOUR CODE HERE
except Exception as error:
print(error)
finally:
print(f"Elapsed time: {perf_counter() - start}")
for Python or
$ time SCRIPT.sh
for shell.
Thanks!
This is my output for the attached script (uploaded as text file) test.txt
Loaded file: sha1://4184f3c842745e9e48b4e5aeb0a2019912837e5f/cortexlab-single-phase-3-ch0-7-10sec.json Unable to load object: sha1://4184f3c842745e9e48b4e5aeb0a2019912837e5f/cortexlab-single-phase-3-ch0-7-10sec.json Elapsed time: 0.0064486739993299125 /home/pierre/.local/lib/python3.8/site-packages/matplotlib-3.2.1-py3.8-linux-x86_64.egg/matplotlib/_pylab_helpers.py:76: ResourceWarning: unclosed <socket.socket fd=6, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('127.0.0.1', 42288), raddr=('127.0.0.1', 20431)> gc.collect(1) ResourceWarning: Enable tracemalloc to get the object allocation traceback
Ah, that's helpful. I think it's not a download problem here, but the file itself doesn't exist. Will remedy and respond soon.
@yger, please try again. It will probably work as is (now the file exists). But you should also git pull on this repo because there was an adjustment to one of the other files as well.
In addition we are working on making the download more fail-proof by providing a fall-back static file server in case the p2p network does not come through.
I updated the repo, and relaunch the same script. But I still have nothing displayed and now the error reads
Loaded file: sha1://08295c224a0753457cde13e78a97cdf8465bd214/known_recordings.json 'NoneType' object is not subscriptable Elapsed time: 0.0138720929990086
Could you please put a raise statement after the print(error) so we can see the full error trace?
...
except Exception as error:
print(error)
raise error
...
Sure, sorry for that
Traceback (most recent call last):
File "test.py", line 40, in
Actually, if I delete the kachery folder, to clean everything, the error is still there, but at least we can see that something is loaded
Loaded 137007 of 137007 bytes from 9beb5d (100.0 %): sha1://08295c224a0753457cde13e78a97cdf8465bd214/known_recordings.json
Loaded file: sha1://08295c224a0753457cde13e78a97cdf8465bd214/known_recordings.json
'NoneType' object is not subscriptable
Elapsed time: 12.740095626999391
/usr/lib/python3/dist-packages/apport/report.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import fnmatch, glob, traceback, errno, sys, atexit, locale, imp
Traceback (most recent call last):
File "test.py", line 40, in
This is strange because I am not having that problem on my end. Could you please try this from the command-line
kachery-p2p-cat sha1://08295c224a0753457cde13e78a97cdf8465bd214/known_recordings.json
You should see the content of that file. Is it empty?
If not empty, then you can find the location on your system:
kachery-load sha1://08295c224a0753457cde13e78a97cdf8465bd214/known_recordings.json
Then check the sha1sum of that file (make sure not corrupted somehow)
sha1sum ...
Perhaps @jsoules can test as well.
Oh, I think I may know what the problem is. Do you have the KACHERY_STORAGE_DIR environment set in both terminal running the daemon, and the terminal running the script? (and they need to be set to the same path)
Yes, sorry, my fault, it was the env variable not correctly set to the same value in the two terminals... Now it seems that my script is loading something!
Glad that's working and thanks for your patience. We are adding some checks to make things less prone
The download_all.py script do not work, with the error
requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=20431): Max retries exceeded with url: /loadFile (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fb93ef22f10>: Failed to establish a new connection: [Errno 111] Connection refused'))
Same for the example script