Skip to content

[BUG] FileNotFoundError: [Errno 2] No such file or directory #868

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

Closed
oesteban opened this issue Dec 1, 2017 · 9 comments · Fixed by nipy/nipype#2325
Closed

[BUG] FileNotFoundError: [Errno 2] No such file or directory #868

oesteban opened this issue Dec 1, 2017 · 9 comments · Fixed by nipy/nipype#2325

Comments

@oesteban
Copy link
Member

oesteban commented Dec 1, 2017

Possibly a problem of nipype itself, but so far I've only seen it in fmriprep. Previously reported under #821, but unrelated to the original cause of that issue.

Node: fmriprep_wf.single_subject_MSC08_wf.func_preproc_ses_func10_task_memorywords_wf.bold_reg_wf.bbreg_wf.mri_coreg
Working directory: /scratch/users/oesteban/fmriprep-phase1/work/ds000224/fmriprep_wf/single_subject_MSC08_wf/func_preproc_ses_func10_task_memorywords_wf/bold_reg_wf/bbreg_wf/mri_coreg

Node inputs:

args = <undefined>
brute_force_limit = <undefined>
brute_force_samples = <undefined>
compress_report = auto
conform_reference = <undefined>
dof = 9
environ = {'SUBJECTS_DIR': '/opt/freesurfer/subjects'}
ftol = 0.0001
generate_report = True
ignore_exception = False
initial_rotation = <undefined>
initial_scale = <undefined>
initial_shear = <undefined>
initial_translation = <undefined>
linmintol = 0.01
max_iters = <undefined>
no_brute_force = <undefined>
no_coord_dithering = <undefined>
no_cras0 = <undefined>
no_intensity_dithering = <undefined>
no_smooth = <undefined>
num_threads = 8
out_lta_file = True
out_params_file = <undefined>
out_reg_file = <undefined>
out_report = report.svg
ref_fwhm = <undefined>
reference_file = <undefined>
reference_mask = <undefined>
saturation_threshold = <undefined>
sep = [4]
source_file = /scratch/users/oesteban/fmriprep-phase1/work/ds000224/fmriprep_wf/single_subject_MSC08_wf/func_preproc_ses_func10_task_memorywords_wf/nonlinear_sdc_wf/skullstrip_bold_wf/apply_mask/ants_susceptibility_Warped_masked.nii.gz
source_mask = <undefined>
source_oob = <undefined>
subject_id = sub-MSC08
subjects_dir = /oak/stanford/groups/russpold/data/openfmri/derivatives/ds000224/freesurfer
terminal_output = <undefined>

Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/pipeline/plugins/multiproc.py", line 51, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/pipeline/engine/nodes.py", line 407, in run
    self._run_interface()
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/pipeline/engine/nodes.py", line 515, in _run_interface
    old_cwd = os.getcwd()
FileNotFoundError: [Errno 2] No such file or directory

and

Node: fmriprep_wf.single_subject_13_wf.func_preproc_task_dis_run_02_wf.bold_reg_wf.bbreg_wf.bbregister
Working directory: /scratch/users/oesteban/fmriprep-phase2/work/ds000212/fmriprep_wf/single_subject_13_wf/func_preproc_task_dis_run_02_wf/bold_reg_wf/bbreg_wf/bbregister

Node inputs:

args = <undefined>
compress_report = auto
contrast_type = t2
dof = 9
environ = {'SUBJECTS_DIR': '/opt/freesurfer/subjects'}
epi_mask = <undefined>
fsldof = <undefined>
generate_report = True
ignore_exception = False
init = <undefined>
init_cost_file = <undefined>
init_reg_file = /scratch/users/oesteban/fmriprep-phase2/work/ds000212/fmriprep_wf/single_subject_13_wf/func_preproc_task_dis_run_02_wf/bold_reg_wf/bbreg_wf/mri_coreg/registration.lta
intermediate_file = <undefined>
out_fsl_file = <undefined>
out_lta_file = True
out_reg_file = <undefined>
out_report = report.svg
reg_frame = <undefined>
reg_middle_frame = <undefined>
registered_file = True
source_file = /scratch/users/oesteban/fmriprep-phase2/work/ds000212/fmriprep_wf/single_subject_13_wf/func_preproc_task_dis_run_02_wf/nonlinear_sdc_wf/skullstrip_bold_wf/apply_mask/ants_susceptibility_Warped_masked.nii.gz
spm_nifti = <undefined>
subject_id = sub-13
subjects_dir = /oak/stanford/groups/russpold/data/openfmri/derivatives/ds000212/freesurfer
terminal_output = <undefined>

Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/pipeline/plugins/multiproc.py", line 51, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/pipeline/engine/nodes.py", line 407, in run
    self._run_interface()
  File "/usr/local/miniconda/lib/python3.6/site-packages/niworkflows/nipype/pipeline/engine/nodes.py", line 515, in _run_interface
    old_cwd = os.getcwd()
FileNotFoundError: [Errno 2] No such file or directory
@meng-du
Copy link

meng-du commented Dec 2, 2017

Hi, I'm getting this error too in a few different workflow (bold_mni_trans_wf/bold_to_mni_transform, bold_mni_trans_wf/merge, bold_reg_wf/bold_to_t1w_transform and a few components of bold_surf_wf). Is nipy/nipype #2325 supposed to be a fix?

Thank you!

@oesteban
Copy link
Member Author

oesteban commented Dec 3, 2017

I'm testing it out, but to be sure it will require that I understand why this error is actually happening

@oesteban
Copy link
Member Author

oesteban commented Dec 6, 2017

@metad are you using docker or singularity?

@meng-du
Copy link

meng-du commented Dec 6, 2017

@oesteban No I'm just using it with native python/pip

@oesteban
Copy link
Member Author

oesteban commented Dec 6, 2017

That's great:

pip install niworkflows --upgrade

should work for you

@meng-du
Copy link

meng-du commented Dec 6, 2017

Awesome thank you so much!

@oesteban
Copy link
Member Author

oesteban commented Dec 6, 2017

Please let us know if it resolved the problem :)

@meng-du
Copy link

meng-du commented Dec 7, 2017

Yes it's resolved!

@oesteban
Copy link
Member Author

oesteban commented Jan 3, 2018

Fixed in 750724b

@oesteban oesteban closed this as completed Jan 3, 2018
oesteban added a commit to oesteban/nipype that referenced this issue Jan 10, 2018
When ``maxtasksperchild`` was set at a very low value, workers
are created very often, sometimes at working directories deleted
after the interface cleanup. That would trigger an ``OSError``
when calling ``os.getcwd()`` during ``nipype.config`` import.

This PR sets an initializer for the workers that just changes to
the appropriate working directory before the worker is spun up.

Fixes nipreps/fmriprep#868
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants