Notebook permissions issue (Seems to involve an issue with Anaconda-navigator)

Hi all,

First off, I’m sorry, please forgive me I promise I’m not being dense. I’m doing some undergraduate research and so this is all pretty new to me. Given the behaviors I feel like I’m missing something very super basic like “the outlet is wired in series with the light so you have to turn on the light switch to run power to the outlet”.

I am running Ubuntu 20.04 LTS. I installed ROOT and Geant4 by hand both are functioning (probably unrelated but giving as much background as I can just in case). I then installed Anaconda 2.0.4. Anaconda installed Jupyter Notebook 6.3.0. Everything ran fine, worked fine. I ran my tests, everything produced expected data outputs. I then came back in the morning, turned on my computer and booted up $ anaconda-navagator. It booted up as expected, clicked to launch Jupyter Notebook exactly as the night before. The navagator claimed it started the notebook but nothing popped up. Following troubleshooting guidelines I attempted running $ python notebook and received the following Errno 13.

Traceback (most recent call last):
  File "/home/a/anaconda3/bin/jupyter-notebook", line 11, in <module>
    sys.exit(main())
  File "/home/a/.local/lib/python3.8/site-packages/jupyter_core/application.py", line 254, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/home/a/anaconda3/lib/python3.8/site-packages/traitlets/config/application.py", line 844, in launch_instance
    app.initialize(argv)
  File "/home/a/anaconda3/lib/python3.8/site-packages/traitlets/config/application.py", line 87, in inner
    return method(app, *args, **kwargs)
  File "/home/a/.local/lib/python3.8/site-packages/notebook/notebookapp.py", line 2116, in initialize
    super().initialize(argv)
  File "/home/a/anaconda3/lib/python3.8/site-packages/traitlets/config/application.py", line 87, in inner
    return method(app, *args, **kwargs)
  File "/home/a/.local/lib/python3.8/site-packages/jupyter_core/application.py", line 229, in initialize
    self.migrate_config()
  File "/home/a/.local/lib/python3.8/site-packages/jupyter_core/application.py", line 155, in migrate_config
    migrate()
  File "/home/a/.local/lib/python3.8/site-packages/jupyter_core/migrate.py", line 245, in migrate
    with open(os.path.join(env['jupyter_config'], 'migrated'), 'w') as f:
PermissionError: [Errno 13] Permission denied: '/usr/local/root/etc/notebook/migrated'

I received the same error via $ jupyter-notebook as well. Technically $ sudo jupyter-notebook --allow-root brings up a note book but without any of the functionality. I’ve googled the issue and found a stack-overflow with the same issue but they are running on mac and none of the suggested fixes seem to work with ubuntu. This being the only direct representation of the same issue in the help forums reinforces my belief that I’m missing something super basic. Hopefully it is paired with a similarly basic fix.

Let me know if you need any more data. And thank you so so much in advance for all your help in advance.

There some suggestions for Linux permissions errors at Anaconda’s Troubleshooting documentation dealing with a licenses directory. Tried that?

Tried the idea described here?

Failing those working…
Did you try the following in your terminal before running Anaconda or Jupyter?:

sudo chown -R user: /usr/local/root/etc/notebook

Where you substitute user with your username in that command.

Yup sorry I should have clarified. Tried all the stuff from Anaconda as well.

I don’t have anything in ~/etc/conda so I don’t think that one is likely.

Tried the chown suggestion and the error changed toooo:

[C 17:07:04.825 NotebookApp] Bad config encountered during initialization: The 'kernel_spec_manager_class' trait of <notebook.notebookapp.NotebookApp object at 0x7fb0678f9f70> instance must be a type, but 'nb_conda_kernels.CondaKernelSpecManager' could not be imported

reinstall? Or is there a way to fix the config without a full reinstall?

Interesting the error changed. Hard to say yet if directly getting at issue, but I’m hoping that is progress.

Already tried the stuff noted here, here, or here?

No direct joy. After clearing the config-dir follow up attempts returned to the error ending in

PermissionError: [Errno 13] Permission denied: '/usr/local/root/etc/notebook/migrated'

very interesting, upon a whim I went back and checked the config-dir and found that it propagated a new file migrated which makes it /usr/local/root/etc/notebook/migrated ie. the file throwing the Errno 13. I checked the file using emacs and it contains only this one line 021-07-24T23:22:33.322252

Sorry, I’m stumped. I didn’t come across anything more.
Maybe someone else will see this and be able to help you sort it?

Good news. You got it to throw that new Bad config... error. I spent some time tracking that error. Found that I had somehow partially started a second environment called notebook that was gumming up and confusing things. I must have drifted a bit more than I thought I was that first night at my desk and input some wonky stuff. The computer (and to be fair, mostly the user ie myself) were getting confused where notebook meant the environment and where it meant the jupyter. And it was only partially setup so there was some gumming up there. Anyway, so I grabbed a conda command sheet, and removed the bad extra environment via conda env remove --name notebook and then full uninstalled and reinstalled anaconda. Things are back to working properly. Thank you for helping to shift me onto the right path. I never would have gotten there if you hadn’t helped figure out it was an issue with the Bad config....

Gonna’ mark this as my solution so hopefully it can be closed. Thank you again for all your help.

1 Like

Very glad to hear it seems sorted now.
And thanks very much for posting the solution. Hopefully it will help others.