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

user-home-test branch #1517

Closed
pvelasco opened this issue Feb 25, 2019 · 6 comments

Comments

Projects
None yet
2 participants
@pvelasco
Copy link
Contributor

commented Feb 25, 2019

As mentioned in neurostars, the last few versions of the fmriprep docker images fail to run when specifying a user (docker run -u myuser ...).
@oesteban created a new docker image (poldracklab/fmriprep:user-home-test).

This new image fixes the permissions problem with $TEMPLATEFLOW_HOME. However, now I get an error similar to the one in a different Neurostats post when processing the (GRE) fieldmap:

Node: fmriprep_wf.single_subject_Pilot005_wf.func_preproc_ses_day1_task_TASK_acq_normal_run_01_echo_1_wf.sdc_wf.phdiff_wf.meta
Working directory: /tmp/work/fmriprep_wf/single_subject_Pilot005_wf/func_preproc_ses_day1_task_TASK_acq_normal_run_01_echo_1_wf/sdc_wf/phdiff_wf/meta

Node inputs:

bids_dir = None
bids_validate = False
fields = <undefined>
in_file = /data/phelpslab/Linda/BIDSdata/sub-Pilot005/ses-day1/fmap/sub-Pilot005_ses-day1_acq-GRE_run-01_phasediff.nii.gz
undef_fields = False

Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/plugins/multiproc.py", line 69, in run_node
    result['result'] = node.run(updatehash=updatehash)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 473, in run
    result = self._run_interface(execute=True)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 557, in _run_interface
    return self._run_command(execute)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/pipeline/engine/nodes.py", line 637, in _run_command
    result = self._interface.run(cwd=outdir)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 371, in run
    outputs = self.aggregate_outputs(runtime)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 472, in aggregate_outputs
    raise error
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 465, in aggregate_outputs
    setattr(outputs, key, val)
  File "/usr/local/miniconda/lib/python3.7/site-packages/traits/trait_handlers.py", line 172, in error
    value )
traits.trait_errors.TraitError: The 'run' trait of a ReadSidecarJSONOutputSpec instance must be a unicode string, but a value of 1 <class 'int'> was specified.

This error was supposed to be fixed after v.1.3.0.post2, so I'm not sure from which version the user-home-test branch was created...

Thanks.

@oesteban

This comment has been minimized.

Copy link
Contributor

commented Mar 1, 2019

Hi @pvelasco, we've just released 1.3.0.post3 that should take care of both issues.

I'm going to close this one in favor of the neurostars thread (https://neurostars.org/t/singularity-fmriprep-permissionerror-errno-13-permission-denied-cache/3693). Please feel free to reopen if this is still an issue.

@oesteban oesteban closed this Mar 1, 2019

@pvelasco

This comment has been minimized.

Copy link
Contributor Author

commented Mar 1, 2019

Hi @oesteban,
I tested 1.3.0.post3 (specifying a user) and I got a different error (also related to permissions inside the docker image):

Process Process-2:
Traceback (most recent call last):
  File "/usr/local/miniconda/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/usr/local/miniconda/lib/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/cli/run.py", line 755, in build_workflow
    err_on_aroma_warn=opts.error_on_aroma_warnings,
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/base.py", line 218, in init_fmriprep_wf
    err_on_aroma_warn=err_on_aroma_warn,
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/base.py", line 516, in init_single_subject_wf
    num_bold=len(subject_data['bold']))
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/bold/base.py", line 399, in init_func_preproc_wf
    bold_reference_wf = init_bold_reference_wf(omp_nthreads=omp_nthreads)
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/bold/util.py", line 121, in init_bold_reference_wf
    omp_nthreads=omp_nthreads, pre_mask=pre_mask)
  File "/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/workflows/bold/util.py", line 302, in init_enhance_and_skullstrip_bold_wf
    'epi_atlasbased_brainmask.json')),
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/ants/registration.py", line 935, in __init__
    super(Registration, self).__init__(**inputs)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/ants/base.py", line 76, in __init__
    super(ANTSCommand, self).__init__(**inputs)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 645, in __init__
    super(CommandLine, self).__init__(**inputs)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 182, in __init__
    self.load_inputs_from_json(from_file, overwrite=True)
  File "/usr/local/miniconda/lib/python3.7/site-packages/nipype/interfaces/base/core.py", line 495, in load_inputs_from_json
    with open(json_file) as fhandle:
PermissionError: [Errno 13] Permission denied: '/usr/local/miniconda/lib/python3.7/site-packages/fmriprep/data/epi_atlasbased_brainmask.json'

The problem is that the package_data in fmriprep gets installed with the same permissions as in /src/fmriprep, which are -rw-rw---- (only root and its group have rw access).

I have a fix for it, and will be submitting a PR shortly.
(Note: I can only submit PRs to branches, not tags, so which branch do you want me to submit the PR to? To master, since the problem is still there?)

@oesteban oesteban reopened this Mar 1, 2019

@oesteban

This comment has been minimized.

Copy link
Contributor

commented Mar 1, 2019

This is surprising, why tests would then even work?. Yes, send the PR to master, please.

@pvelasco

This comment has been minimized.

Copy link
Contributor Author

commented Mar 1, 2019

Sorry, I got it wrong: in the master branch, the permissions are correct.
I think the problem is the --no-cache-dir in the pip install .[all]

I tried building the Docker image for 1.3.0.post3 with

pip install .[all]

(omitting --no-cache-dir) and it runs for a regular user.

Bottom line: tag 1.3.0.post3 is fine except for the --no-cache-dir.

So I'm closing the PR. Thanks a lot for your help!

@pvelasco pvelasco closed this Mar 1, 2019

@oesteban

This comment has been minimized.

Copy link
Contributor

commented Mar 6, 2019

Hi, the latest release 1.3.1 is out. Please let us know if that version resolves this problem!

@pvelasco

This comment has been minimized.

Copy link
Contributor Author

commented Mar 7, 2019

Hi @oesteban,
Yes, it does. It works fine.
Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.