LoginSignup
2
2

More than 5 years have passed since last update.

docker で jupyter/minimal-notebook が起動しない時

Last updated at Posted at 2016-06-15

docker でOverlayFSを使っている環境で起こった話です。
自分で調査したわけではないのだが、興味深いことがあったので、記事にしてみました。

概要

xfs の上にOverlayFS を使っているときに、
docker で jupyter/minimal-notebook の最近のバージョン(a249876881d3)が起動できないことがあった。

その後の調査で ext4 の上に OverlayFS でも同様に起動ができなかった

docker run --rm -ti -u root -v $HOME/work:/home/jovyan/work --name jupyter_test -e NB_UID=10001 jupyter/minimal-notebook:a249876881d3

AUFSではどうなのか?

以前docker-machineで作ったaufs環境があったので、試してみると同様のエラーがでた。
詳しくは調べていないが、ある時点でのaufsにも問題があるのかもしれない(すでに治っているかなどもまだ調査していない)

結論

jupyter/docker-stacks上のこのコミットとOverlayFSの組み合わせが問題ではないかと考えている。

とすると、base-notebook に対するものなので、docker でOverlayFSを利用している環境では、jupyterの他のイメージも同様の問題がおこる可能性がある。

回避策

以下の方法で回避できる

原因

xfsでも、ext4でも起こるところから、OverlayFSに問題があると考えている。

エラー

起動すると以下のようなメッセージがでる。

Traceback (most recent call last):
  File "/opt/conda/lib/python3.5/site-packages/traitlets/traitlets.py", line 501, in get
    value = obj._trait_values[self.name]
KeyError: 'runtime_dir'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/bin/jupyter-notebook", line 6, in <module>
    sys.exit(main())
  File "/opt/conda/lib/python3.5/site-packages/jupyter_core/application.py", line 267, in launch_instance
    return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
  File "/opt/conda/lib/python3.5/site-packages/traitlets/config/application.py", line 595, in launch_instance
    app.initialize(argv)
  File "<decorator-gen-7>", line 2, in initialize
  File "/opt/conda/lib/python3.5/site-packages/traitlets/config/application.py", line 74, in catch_config_error
    return method(app, *args, **kwargs)
  File "/opt/conda/lib/python3.5/site-packages/notebook/notebookapp.py", line 1058, in initialize
    self.init_configurables()
  File "/opt/conda/lib/python3.5/site-packages/notebook/notebookapp.py", line 838, in init_configurables
    connection_dir=self.runtime_dir,
  File "/opt/conda/lib/python3.5/site-packages/traitlets/traitlets.py", line 529, in __get__
    return self.get(obj, cls)
  File "/opt/conda/lib/python3.5/site-packages/traitlets/traitlets.py", line 508, in get
    value = self._validate(obj, dynamic_default())
  File "/opt/conda/lib/python3.5/site-packages/jupyter_core/application.py", line 99, in _runtime_dir_default
    ensure_dir_exists(rd, mode=0o700)
  File "/opt/conda/lib/python3.5/site-packages/ipython_genutils/path.py", line 167, in ensure_dir_exists
    os.makedirs(path, mode=mode)
  File "/opt/conda/lib/python3.5/os.py", line 241, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/home/jovyan/.local/share/jupyter/runtime'

追記2016-06-17 Docker for Mac(beta)でも起きるようです。

自分で確認したのではないが、
Docker for Mac(beta)環境でもおこるようです。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2