Skip to content

main.nwb deleted after failed spikesorting #113

@mariapfj

Description

@mariapfj

when running spikesorting (kilosort2) on recording /maria/mec-social-nwb/actions/145-151021-5, I got the following error message (under). After this, the original main.nwb file is deleted and I have to re-register the recording. This has happened once or twice before, but I didn't connect the missing nwb file with the previous failed spikesorting until now. However, if I remember correctly I am usually able to re-register and spikesort without issue, so it doesn't seem to be an issue with the data or an issue that can easily be recreated. For that reason this is mainly a PSA unless the issue can be identified from the following error alone?

Processing 145-151021-5
N JOBS 24

Cleaning up existing NWB file

Preprocessing recording:
Num channels: 32
Duration: 949.27 s
Detected bad channels: ['CH7' 'CH8']
Active channels: 30
Saving preprocessed recording

Spike sorting with kilosort2 using installed sorter
Usage: /usr/bin/which [options] [--] COMMAND [...]
Write the full path of COMMAND(s) to standard output.

--version, -[vV] Print version and exit successfully.
--help, Print this help and exit successfully.
--skip-dot Skip directories in PATH that start with a dot.
--skip-tilde Skip directories in PATH that start with a tilde.
--show-dot Don't expand a dot to current directory in output.
--show-tilde Output a tilde for HOME directory for non-root.
--tty-only Stop processing options on the right if not on tty.
--all, -a Print all matches in PATH, not just the first
--read-alias, -i Read list of aliases from stdin.
--skip-alias Ignore option --read-alias; don't read stdin.
--read-functions Read shell functions from stdin.
--skip-functions Ignore option --read-functions; don't read stdin.

Recommended use is to write the output of (alias; declare -f) to standard
input, so that which can show aliases and shell functions. See which(1) for
examples.

If the options --read-alias and/or --read-functions are specified then the
output can be a full alias or function definition, optionally followed by
the full path of each command used inside of those.

Report bugs to [email protected].
Found 114 units!
Removed 0 units with less than 3 spikes

Postprocessing
Computing extensions
Computing QC metrics
Exporting to phy

Writing to NWB
Error exporting to NWB: [Errno 2] Unable to synchronously open file (unable to open file: name = '/projects/ec109/maria/mec-social-nwb/actions/145-151021-5/data/main_tmp.nwb', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)
ERROR: unable to process 145-151021-5
Traceback (most recent call last):
File "/fp/projects01/ec109/software/expipe-plugin-cinpla/src/expipe_plugin_cinpla/scripts/process.py", line 311, in process_ecephys
with NWBHDF5IO(nwb_path_tmp, mode="r") as read_io:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/projects/ec109/conda-envs/cinpla/lib/python3.11/site-packages/hdmf/utils.py", line 668, in func_call
return func(args[0], **pargs)
^^^^^^^^^^^^^^^^^^^^^^
File "/projects/ec109/conda-envs/cinpla/lib/python3.11/site-packages/pynwb/init.py", line 406, in init
super().load_namespaces(tm, path, file=file_obj, driver=driver, aws_region=aws_region)
File "/projects/ec109/conda-envs/cinpla/lib/python3.11/site-packages/hdmf/utils.py", line 668, in func_call
return func(args[0], **pargs)
^^^^^^^^^^^^^^^^^^^^^^
File "/projects/ec109/conda-envs/cinpla/lib/python3.11/site-packages/hdmf/backends/hdf5/h5tools.py", line 185, in load_namespaces
open_file_obj = cls.__resolve_file_obj(path, file_obj, driver, aws_region=aws_region)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/projects/ec109/conda-envs/cinpla/lib/python3.11/site-packages/hdmf/backends/hdf5/h5tools.py", line 158, in __resolve_file_obj
file_obj = File(path, 'r', **file_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/fp/homes01/u01/ec-mariapfj/.local/lib/python3.11/site-packages/h5py/_hl/files.py", line 562, in init
fid = make_fid(name, mode, userblock_size, fapl, fcpl, swmr=swmr)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/fp/homes01/u01/ec-mariapfj/.local/lib/python3.11/site-packages/h5py/_hl/files.py", line 235, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
File "h5py/h5f.pyx", line 102, in h5py.h5f.open
FileNotFoundError: [Errno 2] Unable to synchronously open file (unable to open file: name = '/projects/ec109/maria/mec-social-nwb/actions/145-151021-5/data/main_tmp.nwb', errno = 2, error message = 'No such file or directory', flags = 0, o_flags = 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/fp/projects01/ec109/software/expipe-plugin-cinpla/src/expipe_plugin_cinpla/widgets/process.py", line 300, in on_run
process.process_ecephys(
File "/fp/projects01/ec109/software/expipe-plugin-cinpla/src/expipe_plugin_cinpla/scripts/process.py", line 362, in process_ecephys
shutil.copy(nwb_path_tmp, nwb_path)
File "/projects/ec109/conda-envs/cinpla/lib/python3.11/shutil.py", line 431, in copy
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "/projects/ec109/conda-envs/cinpla/lib/python3.11/shutil.py", line 256, in copyfile
with open(src, 'rb') as fsrc:
^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/projects/ec109/maria/mec-social-nwb/actions/145-151021-5/data/main_tmp.nwb'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions