5

I'm getting a common error, but the chmod solutions I've found don't seem to be working.

When I create a Jupyter notebook through terminal, by running jupyter notebook, on Ubuntu 19.10, I get this error I'm sure many are familiar with:

The file at file:///home/vurnhat/.local/share/jupyter/runtime/nbserver-25715-open.html is not readable. It may have been removed, moved, or file permissions may be preventing access.

I've manually pasted the link into Firefox and it works. Is there any way I can change some setting in my Chromium browser to get it to work there?

Brendon
  • 51
  • which version of Linux have you installed  (Ubuntu server, Ubuntu desktop, Kubuntu, Lubuntu, Xubuntu, Ubuntu MATE, et al.) , and which release number? Please click [edit] and add that vital information to your question so all the facts we need are in the question. Please don't use Add Comment, since that's our channel to you. All facts about your system should go in the Question with [edit] – K7AAY Mar 16 '20 at 18:44
  • I'm also facing same issue. Using Ubuntu 20.04 Any help? – user_3pij Oct 12 '20 at 09:08

4 Answers4

2

I had the same issue. I don't know what the problem is with Chrome, but a quick "fix" for me was to run:

jupyter notebook --browser firefox

so I don't have to copy-paste the link in Firefox.

2

The issue is chromium being a snap app in Ubuntu, if the URL is used instead of the html file, the issue is resolved. jupyter notebook --generate-config will output the directory for config file, edit it and add this line c.NotebookApp.use_redirect_file = False

2

Generate a jupyter config file in terminal using commands:

jupyter notebook --generate-config

open the script jupyter_notebook_config.py in the directory
/.jupyter and uncomment the line 531 : Set c.NotebookApp.use_redirect_file = True to
c.NotebookApp.use_redirect_file = False. It will work.

1

Your issue is probably be related to Chromium being a snap app. According to this Stack Overflow answer:

With recent versions of snap, applications installed with snap can't by default open files in hidden folders (with a name starting by .).

In Ubuntu 20.04, chromium is installed with snap (even when using the command sudo apt install chromium-browser), so chromium can't open the html file used by Jupyter.

As stated by @rahul-sood, a simple workaround is to copy-paste one of the alternative links given by Jupyter in the terminal (starting by http://localhost:8889/?token= or http://127.0.0.1:8889/?token=).

This snap issue is also mentioned in this Ask Ubuntu answer:

The Snap 'home' interface permits access only to non-hidden files and directories in a user's /home.

The Snap 'personal-files' interface permits access to all files and directories in a user's /home.

  • Snap interfaces are defined in the yaml file used in snap creation.
  • The personal-files interface requires an additional $snap connect foo:foo-connect. The home interface does not, which makes it more convenient for some uses.

Also see this relevant thread in the snapcraft forum: Can browsers open local files?


Summarizing, this is probably an issue due to Chromium being a snap application. Your options are:

  • Copy and paste one of the links starting with http://localhost:8889/?token= or http://127.0.0.1:8889/?token= in Chromium to open your notebook in it.

  • Use another non-snap browser as default.

  • Use the command mentioned by Salvatore Lampitelli to open the notebook in the specified non-snap browser.