fsprojects / IfSharp

F# for Jupyter Notebooks
Other
442 stars 71 forks source link

Permission denied error #246

Closed Ripper555 closed 4 years ago

Ripper555 commented 4 years ago

In docker I run: docker run -p 8888:8888 fsprojects/ifsharp

I try to create a new notebook:

[I 16:28:56.196 NotebookApp] Creating new notebook in
[I 16:28:56.222 NotebookApp] Writing notebook-signing key to /home/ifsharp-user/.local/share/jupyter/notebook_secret
[W 16:28:56.232 NotebookApp] 403 POST /api/contents (172.17.0.1): Permission denied: Untitled.ipynb
[W 16:28:56.232 NotebookApp] Permission denied: Untitled.ipynb
[W 16:28:56.232 NotebookApp] 403 POST /api/contents (172.17.0.1) 37.22ms referer=http://127.0.0.1:8888/tree

Thank you for any help!

cgravill commented 4 years ago

Did you try running: https://github.com/fsprojects/IfSharp#docker ?

Ripper555 commented 4 years ago

If you are asking if it ran it with a volume I did. Same result.

cgravill commented 4 years ago

I don't really use Docker much myself, the command on there is passing an additional argument $PWD:/notebooks presumably for where the notebooks are stored, might that be related to the permissions issue?

Ripper555 commented 4 years ago

@cgravill yes I am pretty familiar with docker and the -v $PWD:/notebooks is a volume flag. I have used that with the same error but even if that was the issue I would consider that a big bug if it was required.

cgravill commented 4 years ago

I'm well out of my expertise here but on a Windows host if I do:

docker run -p 8888:8888 fsprojects/ifsharp

I get a permissions error as you do. If instead I navigate somewhere Docker has access to and use:

docker run -v ${PWD}:/notebooks -p 8888:8888 fsprojects/ifsharp

it works as expected and is able to create new notebooks.

(note the adjustment for PowerShell, I've added a pull request to provide that example for Windows folks)

Other folks have been able to use a Linux host before with this.

Could you please provide the "Related information" from the issue template, that might help others with a similar set-up to assist.

Ripper555 commented 4 years ago

Wow so it is the volume. I messed up mounting it with a volume before (I think permissions on the host). I tried on a different folder and it works. I have not seen anything like this. The only thing it could be is in the Dockerfile:

VOLUME notebooks

should be:

VOLUME /notebooks

I will try to find time to test this over the weekend if you don't get to it first. Thanks for the help!

cgravill commented 4 years ago

Excellent glad it worked.

If you were able to make it more reliable for others with a pull request that would be much appreciated.

cgravill commented 4 years ago

I think this is effectively covered, so will close this.

Happy to take pull requests improving the Docker experience.