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

Error running mindboggle on Windows 10 #144

Closed
cochrand opened this issue Mar 1, 2018 · 11 comments
Closed

Error running mindboggle on Windows 10 #144

cochrand opened this issue Mar 1, 2018 · 11 comments

Comments

@cochrand
Copy link

cochrand commented Mar 1, 2018

Following the instructions at http://mindboggle.readthedocs.io/en/latest/, when I first tried following instructions on using mindboggle and entered "docker run --rm -ti -v $HOST:$DOCK nipy/mindboggle $IMAGE --id $ID"

I got the following error:

the input device is not a TTY. If you are using mintty, try prefixing the command with 'winpty'

Then after adding winpty, "winpty docker run --rm -ti -v $HOST:$DOCK nipy/mindboggle $IMAGE --id $ID", I get the following output and error:

Create missing output directory /home/jovyan/work/mindboggle123_output
Create missing working directory /home/jovyan/work/mindboggle123_output/working
Traceback (most recent call last):
File "/opt/conda/bin/mindboggle123", line 147, in
reconall.inputs.T1_files = IMAGE
File "/opt/conda/lib/python3.5/site-packages/nipype/interfaces/base.py", line
2043, in validate
value = super(MultiPath, self).validate(object, name, newvalue)
File "/opt/conda/lib/python3.5/site-packages/traits/trait_types.py", line 2337
, in validate
return TraitListObject( self, object, name, value )
File "/opt/conda/lib/python3.5/site-packages/traits/trait_handlers.py", line 2
314, in init
raise excp
File "/opt/conda/lib/python3.5/site-packages/traits/trait_handlers.py", line 2
306, in init
value = [ validate( object, name, val ) for val in value ]
File "/opt/conda/lib/python3.5/site-packages/traits/trait_handlers.py", line 2
306, in
value = [ validate( object, name, val ) for val in value ]
File "/opt/conda/lib/python3.5/site-packages/nipype/interfaces/traits_extensio
n.py", line 92, in validate
self.info_text, value))
traits.trait_errors.TraitError: The trait 'T1_files' of a ReconAllInputSpec inst
ance is an existing file name, but the path 'C:/Program Files/Git/home/jovyan/w
ork/example_mri_data/T1.nii.gz' does not exist.

@PeerHerholz
Copy link
Contributor

Hey @cochrand,

as far as I can tell, this looks like a problem related to how you set your paths and/or mounted them within the docker command. Could you maybe paste the complete setup, e.g. how you set the environment variables (HOST, DOCK, IMAGE, ID)?

Regarding the initial/first error I can't be of any help, as I only worked with docker on windows once. But maybe the windows parts of the docker notebook from the nipype tutorial provide useful insights!?

HTH, best, Peer

@cochrand
Copy link
Author

cochrand commented Mar 1, 2018

Thanks Peer, I had seen the previous thread, but it seemed that the errors I was getting were different and that was also using the "--entrypoint /bin/bash bids/mindboggle" command. It was also difficult for me to follow the responses and see how they applied to my case.

These are the commands I used to set up docker:

HOST=/Users/COchranD3/Documents/Mindboggle/
DOCK=/home/jovyan/work
IMAGE=$DOCK/example_mri_data/T1.nii.gz
ID=arno

winpty docker run --rm -ti -v $HOST:$DOCK nipy/mindboggle $IMAGE --id $ID

@PeerHerholz
Copy link
Contributor

Thanks for providing the additional information.

Chances are, it's a path/how-docker-works-on-windows thingy.
Did you check the "run a docker image on windows section" in the notebook mentioned in the last post? If not, just have a look, because even it's not related to the mindboggle docker image it includes some very important points.

Based on that, can try setting HOST like this:
HOST=/c/Users/COchranD3/Documents/Mindboggle/ and try it again?

@cochrand
Copy link
Author

cochrand commented Mar 2, 2018

Thanks for the tutorial reference, that was definitely helpful and I was able to successfully do the exercise.

Unfortunately, still having the same error message. It seems the key error is the last line if I'm not mistaken: "the path 'C:/Program Files/Git/home/jovyan/work/example_mri_data/T1.nii.gz' does not exist."

Can't figure out why it's looking in Program Files/Git/

Just to see if I could get any more insight I changed variable IMAGE=$HOST/example_mri_data/T1.nii.gz because I have this file in the HOST directory. Got same error, except the last line was replaced with "the path 'C:/Users/COchranD3/Documents/Mindboggle/example_mri_data/T1.nii.gz' does not exist."

This is even more confusing because this path DOES exist.

Still scratching my head on this one. Any advice much appreciated.

@PeerHerholz
Copy link
Contributor

Hm, okay. Are you using the Docker QuickStart Terminal?

Just to follow up on the possible mount problem, try the following:

HOST=/c/Users/COchranD3/Documents/Mindboggle/
DOCK=/home/jovyan/work

docker run --rm -ti -v $HOST:$DOCK --entrypoint /bin/bash nipy/mindboggle

Within the container, check if you can ls the directory and file (example_mri_data/T1.nii.gz).

@cochrand
Copy link
Author

cochrand commented Mar 5, 2018

I am using Docker CE for Windows - https://docs.docker.com/docker-for-windows/install/
The other looked like it was for older Windows versions. Should I try it instead?

Tried the command suggested. Got a similar error:

C:/Program Files/Docker/Docker/Resources/bin/docker.exe: Error response from daemon: OCI runtime create failed: container_linux.go:296: starting container process caused "exec: "C:/Program Files/Git/usr/bin/bash.exe": stat C:/Program Files/Git/usr/bin/bash.exe: no such file or directory": unknown.

I apologize for the ignorance, but I'm not sure how to ls files within the container. ls gives me my home directory.

@cochrand
Copy link
Author

cochrand commented Mar 5, 2018

OK, after much searching I found an article I don't completely understand:

[https://github.com/moby/moby/issues/13741#issuecomment-128893740]

but after changing command line to
docker run --rm -ti -v $HOST:$DOCK --entrypoint //bin/bash nipy/mindboggle

with the double slash, I no longer get the error. Doing this takes me into the container at directory: jovyan@eb5dea7c0a26:~/work$

but there is nothing in this directory - no example_mri_data directory or T1.nii.gz file.

@PeerHerholz
Copy link
Contributor

Oh, okay. Thanks for pointing to this thread and solution!

If you set your environment variables like this:
HOST=/c/Users/COchranD3/Documents/Mindboggle/
DOCK=/home/jovyan/work

running ls in jovyan@eb5dea7c0a26:~/work$ should list everything that is in /c/Users/COchranD3/Documents/Mindboggle/.
Based on your post some days ago this should also include example_mri_data/T1.nii.gz.

@cochrand
Copy link
Author

cochrand commented Mar 5, 2018

I figured out (sort of) what is happening. Something about the Git Bash shell I am using to run Docker is causing some screwy things to happen with the volume mapping. Instead of using /c/Users/COchranD3/Documents/Mindboggle/, it created a new path - C:/Program Files/Git/Users/COchranD3/Documents/Mindboggle/, and even if I put the example_mri_data in this folder, there is still something wrong with the mapping - still nothing when I use ls in the work directory.

I redid the whole process using Powershell instead of Git Bash, and it seems to be working - still performing analysis after several hours, and it is creating appropriate output folders.

So I think I will just use Powershell, as much as I would have liked to have figured out how to get it work in Git Bash.

Thanks for your help!

@PeerHerholz
Copy link
Contributor

Ah okay, that's what I meant a few posts ago, asking about and referring to the Docker QuickStart Terminal. Indeed the shell / terminal one's using can / will make a huge difference.
Would be interesting to check if everything works if you're using the Docker QuickStart Terminal.  
Sorry, that my comments weren't that helpful.

Yeah, depending on your machine the complete mindboggle pipeline will take quite a while, as it includes FreeSurfer, ANTs and mindboggle itself. If you're planning to analyze a large dataset (and have access to certain computational resources), you might want to check the singularity version of mindboggle. Additionally, if your dataset is in BIDS format you could also use the mindboggle BIDS app.

Assuming that everything works now, it would be cool, if you close this issue. Best regards!

@cochrand cochrand closed this as completed Mar 8, 2018
@binarybottle
Copy link
Member

Thank you, @PeerHerholz and @cochrand for resolving this issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants