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

404 error when starting notebook from a hidden folder #2382

Closed
choldgraf opened this issue Apr 6, 2017 · 37 comments · Fixed by #2907
Closed

404 error when starting notebook from a hidden folder #2382

choldgraf opened this issue Apr 6, 2017 · 37 comments · Fixed by #2907

Comments

@choldgraf
Copy link
Contributor

choldgraf commented Apr 6, 2017

I'm getting a 404 error when I start a jupyter notebook and point it to a hidden folder.

Note: this is resolved, see update below

For me this was enough to recreate the problem:

mkdir test
mkdir .test

# works
jupyter notebook --notebook-dir=./test

# 404 error
jupyter notebook --notebook-dir=./.test

Update

This is not an error, but is expected behavior. Jupyter Notebooks don't serve hidden folders for safety reasons. Newer versions of the notebook server make it possible to launch the server from a hidden folder. Try running:

pip install --upgrade jupyter

@choldgraf
Copy link
Contributor Author

(this started after I upgraded to 5.0, and it's also happening with jupyter lab FWIW

@tjnd89
Copy link

tjnd89 commented Apr 9, 2017

I'm also seeing the same thing after updating a Windows install. But in my case the folder is not really hidden. I have a bunch of notebooks stored in my .ipython folder. When running

#404 error
cd c:\users\tj\.ipython
jupyter notebook

#works
cd c:\users\tj\.ipython\test
jupyter notebook

If you right-click properties on the .ipython folder it will look like the read-only box is checked. But this is true for all folders in windows and is misleading (it's not really readonly). This can be verified using:

(C:\Anaconda3) C:\Users\tj>attrib .ipython
             C:\Users\tj\.ipython

Here's a copy of the server error message:

(C:\Anaconda3) C:\Users\tj\.ipython>jupyter notebook
[I 05:54:30.053 NotebookApp] Serving notebooks from local directory: C:\Users\tj\.ipython
[I 05:54:30.054 NotebookApp] 0 active kernels
[I 05:54:30.054 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=91fd95901828a7e9dbfccc166eaa977bb508bf8813a2f064
[I 05:54:30.054 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 05:54:30.082 NotebookApp]

    Copy/paste this URL into your browser when you connect for the first time,
    to login with a token:
        http://localhost:8888/?token=91fd95901828a7e9dbfccc166eaa977bb508bf8813a2f064
[I 05:54:30.565 NotebookApp] Accepting one-time-token-authenticated connection from ::1
[I 05:54:30.567 NotebookApp] Refusing to serve hidden directory, via 404 Error
[W 05:54:30.658 NotebookApp] 404 GET /tree?token=bc1848cfa7a983646a888ae7ded3bfb6ec54cdc7ac9653f1 (::1) 94.25ms referer=None

@takluyver
Copy link
Member

I think our 'is it hidden' check always respects the Unix convention (files starting with a . are hidden), as well as checking the hidden attribute on Windows.

We probably shouldn't be checking the directory where you start the notebook server, though.

@tjnd89
Copy link

tjnd89 commented Apr 14, 2017

On the windows side version the jupyter client 4.4.0 works fine with when starting in a directory with a leading . in the name). Something new was introduced in 5.0.0 that breaks this behavior.

@SamuelMarks
Copy link

Error still present

@xingshou
Copy link

xingshou commented Jun 14, 2017

I have the same issue in my Mac book.

jupyter            1.0.0      
jupyter-client     5.0.1      
jupyter-console    5.1.0      
jupyter-core       4.3.0

@vickorian
Copy link

This error occurs if you set c.NotebookApp.notebook_dir in jupyter_notebook_config to a drive letter rather than a folder. See issue# 3133 ContinuumIO/anaconda-issues#3133

@kumarvem
Copy link

kumarvem commented Aug 1, 2017

Thanks, after unhide folder it is working.
How to unhide folder in windows => http://www.wikihow.com/Unhide-Folders-in-Windows-7

@bharagavafirst
Copy link

even after checking hide folder in windows for anaconda folder im getting this message pls help

@bharagavafirst
Copy link

i also mark anaconda folder as un hidden and read only but this does not resolve my problem

@jupyter jupyter deleted a comment from hainm Oct 5, 2017
@takluyver
Copy link
Member

And please keep it civil even when responding to other people who may not have been completely civil themselves. Sweary comments make everyone angry and unproductive.

The comment I'm referring to has been deleted, but everyone who's commented on this issue got it by email already. So I wanted to post this before anyone feels the need to make their own angry response. Take a deep breath and move on.

(I know this can be difficult - I bit back the urge to write something snarkier in my own response, and I could probably have bitten it further back than I did. Thanks @choldgraf for getting the discussion back on track after that.)

@takluyver
Copy link
Member

I've opened #2907 to address this as we discussed, by allowing starting the notebook server in a hidden directory.

Looking at the code, I wonder if this was actually an oversight all along; I think the is_hidden function is only meant to check files and directories below the root, and was doing the wrong thing when passed the root directory itself.

@takluyver takluyver added this to the 5.2 milestone Oct 6, 2017
gnestor pushed a commit that referenced this issue Oct 6, 2017
* The root directory of the notebook server should never be hidden

Closes gh-2382

* Test that root dir is not hidden
@choldgraf
Copy link
Contributor Author

🎉 🎉 🎉 🎉 woooo @takluyver 🎉 🎉 🎉 🎉

@khadekirti
Copy link

I faced the same issue. Here is what I have done :

  1. Download Python & Install from: https://www.python.org/downloads/
  2. Set variable path: "C:\Users\Python27" and "C:\Python27\Scripts"
  3. In the command prompt type 'pip install jupyter'
  4. Next, in the command prompt type 'jupyter notebook'

@kskand
Copy link

kskand commented Nov 14, 2017

I am getting below error while opening 'jupyter notebook', i tried with other port also but it didn't work. Can anyone help me on this ? I am using windows 10.
(C:\Users\ks00349483\AppData\Local\Continuum\Anaconda3) C:\Users\ks00349483>jupyter notebook
[I 16:21:49.067 NotebookApp] The port 8888 is already in use, trying another port.
[I 16:21:49.237 NotebookApp] Serving notebooks from local directory: C:\Users\ks00349483
[I 16:21:49.237 NotebookApp] 0 active kernels
[I 16:21:49.237 NotebookApp] The Jupyter Notebook is running at: http://localhost:8889/?token=e69ede421e2df0425d8ac9d8c36f1ffaa32a18d1297d338c
[I 16:21:49.237 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 16:21:49.252 NotebookApp]

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
    http://localhost:8889/?token=e69ede421e2df0425d8ac9d8c36f1ffaa32a18d1297d338c

[I 16:21:50.440 NotebookApp] Accepting one-time-token-authenticated connection from ::1
[I 16:21:50.456 NotebookApp] Refusing to serve hidden directory, via 404 Error
[W 16:21:50.640 NotebookApp] 404 GET /tree?token=0cb117662c05f2133d736476ab685bf019cd19a17cc0becd (::1) 199.62ms referer=None

@kskand
Copy link

kskand commented Nov 14, 2017

@goanpeca : Thanks for you quick response but it didn't help. When i installed Anaconda last week at that it worked but this week, suddenly i started getting this error.

@takluyver
Copy link
Member

What does jupyter notebook --version give you? Notebook version 5.2 should have it fixed, so if you're using an older version, update.

@rezwanh001
Copy link

When I run anaconda-navigator , I am getting following issues. How can I solve this ?

[I 10:45:03.733 NotebookApp] Writing notebook server cookie secret to /run/user/1000/jupyter/notebook_cookie_secret
[I 10:45:05.584 NotebookApp] Serving notebooks from local directory: /home/rezwan
[I 10:45:05.584 NotebookApp] 0 active kernels 
[I 10:45:05.584 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=fbaf89288e9faf90768125f2f2bbb8bbe40e74f2a816c0ab
[I 10:45:05.584 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 10:45:05.585 NotebookApp] 

Copy/paste this URL into your browser when you connect for the first time,
to login with a token:
http://localhost:8888/?token=fbaf89288e9faf90768125f2f2bbb8bbe40e74f2a816c0ab
[6098:6136:1121/104506.194884:ERROR:browser_gpu_channel_host_factory.cc(108)] Failed to launch GPU process.
[I 10:45:06.198 NotebookApp] Accepting one-time-token-authenticated connection from 127.0.0.1

@takluyver
Copy link
Member

I think the only bit there that's actually an error is the line about browser_gpu_channel_host_factory - people are discussing that on #2836.

@hichoe95
Copy link

maybe you should try 'pip3 install --upgrade jupyter '

i solved it with this way

@zhouzhou77
Copy link

@hichoe95 Thank you so much , I solved this proplem too ..

@rkranjancs1014
Copy link

just check if your directory is hidden

@ecampana
Copy link

ecampana commented Aug 22, 2018

I wanted to add that this error message also appears when you try to configure jupyter to use a directory where you don't have file access. For example,

c.NotebookApp.notebook_dir = u'/home/myaccount/notebooks'

where "notebooks" is a directory not accessible able to you. This unlikely scenario happened to me when IT copied a folder to my home directory but did not properly set the file permissions on it.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.