danielfrg / s3contents

Jupyter Notebooks in S3 - Jupyter Contents Manager implementation
Apache License 2.0
248 stars 88 forks source link

SingleUser start up error #142

Open jasondavindev opened 2 years ago

jasondavindev commented 2 years ago

I'm using Jupyterhub + KubeSpawner for my workload. When I launch the container I face the error

    Traceback (most recent call last):
      File "/opt/conda/lib/python3.9/site-packages/tornado/web.py", line 1704, in _execute
        result = await result
      File "/opt/conda/lib/python3.9/site-packages/tornado/gen.py", line 234, in wrapper
        yielded = ctx_run(next, result)
      File "/opt/conda/lib/python3.9/site-packages/notebook/services/contents/handlers.py", line 116, in get
        model = yield maybe_future(self.contents_manager.get(
      File "/opt/conda/lib/python3.9/site-packages/s3contents/genericmanager.py", line 125, in get
        if path.startswith(self.parent.root_dir):
    AttributeError: 'SingleUserNotebookApp' object has no attribute 'root_dir'

I tried with options but the error remains

--NotebookApp.root_dir=
--SingleUserNotebookApp.root_dir=
--ServerApp.root_dir=

My Dockerfile

FROM jupyterhub/k8s-singleuser-sample:1.2.0
...
RUN pip3 install s3contents
...
burakovsky commented 1 year ago

I have a similar problem when run Classic Jupyter Notebook:

Traceback (most recent call last):
      File "/home/lyte/.local/lib/python3.8/site-packages/tornado/web.py", line 1713, in _execute
        result = await result
      File "/home/lyte/.local/lib/python3.8/site-packages/tornado/gen.py", line 234, in wrapper
        yielded = ctx_run(next, result)
      File "/home/lyte/.local/lib/python3.8/site-packages/notebook/services/contents/handlers.py", line 111, in get
        model = yield maybe_future(self.contents_manager.get(
      File "/home/lyte/.local/lib/python3.8/site-packages/s3contents/genericmanager.py", line 126, in get
        if path.startswith(self.parent.root_dir):
    AttributeError: 'NotebookApp' object has no attribute 'root_dir'

It looks like root_dir is only JupyterLab config option (according to documentation it was added as a substitute for notebook_dir), because when I added c.NotebookApp.root_dir = "" parameter I saw this warning message in logs:

Config option `root_dir` not recognized by `NotebookApp`.  Did you mean `notebook_dir`?

I fixed it by removing this JupyterLab workaround

djuarezg commented 1 year ago

Any news on this?

I had to upgrade to more recent versions.