Facing permisson issue while creating an ipynb file on a volume attached to a container spawn by DockerSpawner

Hi folks, So I have a usecase where multiple people use Jupyter server to work on their data science usecases. I have used JupyterHub with combination DcokerSpawner to spin up container for each user on my machine. Each user is created in our system and has a seperate workspace . Only one user is admin called ‘ross’. I am creating a volume for each user and attaching it while spawning container. I am facing permission issue while creating a notebook.

Jupyter Config file:

import os
import shutil
import subprocess

c = get_config()  # noqa

c.Authenticator.admin_users = {'ross'}


c.DockerSpawner.allowed_images = {
    'Jupyter Base Notebook': 'quay.io/jupyter/base-notebook:latest',
    'Jupyter Scipy Notebook': 'quay.io/jupyter/scipy-notebook:latest'
}

# we need the hub to listen on all ips when it is in a container
import dockerspawner
c.JupyterHub.spawner_class = dockerspawner.DockerSpawner

# The docker instances need access to the Hub, so the default loopback port doesn't work:
from IPython.utils.localinterfaces import public_ips
c.JupyterHub.hub_ip = public_ips()[0]


import os
import subprocess
def create_dir_hook(spawner):
    username = spawner.user.name
    volume_path = os.path.join('/home', username)  
    volume_path = os.path.join(volume_path, 'jupyterhub_volume_data')
    print(volume_path)
    if not os.path.exists(volume_path):
        print("Path doesnt exist")
        os.makedirs(volume_path)
    
      
    

c.Spawner.pre_spawn_hook = create_dir_hook



notebook_dir = '/home/{username}/jupyterhub_volume_data/'
print(notebook_dir)
c.DockerSpawner.notebook_dir = notebook_dir


c.DockerSpawner.volumes = { 
    'jupyterhub-user-{username}': notebook_dir 
        
    }


# delete containers when the stop
c.DockerSpawner.remove = True

# c.LocalAuthenticator.create_system_users=True

c.DockerSpawner.extra_create_kwargs = {'user': 'root'}
# c.DockerSpawner.extra_host_config = {'runtime': 'nvidia'}  

c.Spawner.environment = {'GRANT_SUDO': 'yes'}

Container logs :

ross-VirtualBox:~/Desktop$ docker logs f3dcca9c6ccf
Entered start.sh with args: start-notebook.py
Running hooks in: /usr/local/bin/start-notebook.d as uid: 0 gid: 0
Done running hooks in: /usr/local/bin/start-notebook.d
Granting jovyan passwordless sudo rights!
Running hooks in: /usr/local/bin/before-notebook.d as uid: 0 gid: 0
Sourcing shell script: /usr/local/bin/before-notebook.d/10activate-conda-env.sh
Done running hooks in: /usr/local/bin/before-notebook.d
Running as jovyan: start-notebook.py
[W 2024-03-08 02:08:34.407 ServerApp] A `_jupyter_server_extension_points` function was not found in nbclassic. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[I 2024-03-08 02:08:34.411 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2024-03-08 02:08:34.417 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2024-03-08 02:08:34.417 JupyterHubSingleUser] Starting jupyterhub single-user server extension version 4.0.2
[I 2024-03-08 02:08:34.418 JupyterHubSingleUser] Using default url from server extension lab: /lab
[I 2024-03-08 02:08:34.424 ServerApp] jupyterhub | extension was successfully linked.
[W 2024-03-08 02:08:34.426 LabApp] 'extra_template_paths' was found in both NotebookApp and ServerApp. This is likely a recent change. This config will only be set in NotebookApp. Please check if you should also config these traits in ServerApp for your purpose.
[I 2024-03-08 02:08:34.435 ServerApp] jupyterlab | extension was successfully linked.
[W 2024-03-08 02:08:34.437 NotebookApp] 'extra_template_paths' was found in both NotebookApp and ServerApp. This is likely a recent change. This config will only be set in NotebookApp. Please check if you should also config these traits in ServerApp for your purpose.
[I 2024-03-08 02:08:34.444 ServerApp] nbclassic | extension was successfully linked.
[W 2024-03-08 02:08:34.447 JupyterNotebookApp] 'extra_template_paths' was found in both NotebookApp and ServerApp. This is likely a recent change. This config will only be set in NotebookApp. Please check if you should also config these traits in ServerApp for your purpose.
[I 2024-03-08 02:08:34.452 ServerApp] notebook | extension was successfully linked.
[I 2024-03-08 02:08:34.453 ServerApp] Writing Jupyter server cookie secret to /home/jovyan/.local/share/jupyter/runtime/jupyter_cookie_secret
[I 2024-03-08 02:08:34.734 ServerApp] notebook_shim | extension was successfully linked.
/opt/conda/lib/python3.11/site-packages/jupyter_server/serverapp.py:2235: JupyterServerAuthWarning: Core endpoints without @allow_unauthenticated, @ws_authenticated, nor @web.authenticated:
- GET of JupyterHubLogoutHandler registered for /user/ross/logout
- GET of JupyterHubOAuthCallbackHandler registered for /user/ross/oauth_callback
  self.web_app = ServerWebApplication(
[I 2024-03-08 02:08:34.824 ServerApp] notebook_shim | extension was successfully loaded.
[I 2024-03-08 02:08:34.827 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2024-03-08 02:08:34.829 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2024-03-08 02:08:34.840 JupyterHubSingleUser] Updating Hub with activity every 300 seconds
[I 2024-03-08 02:08:34.840 ServerApp] jupyterhub | extension was successfully loaded.
[I 2024-03-08 02:08:34.859 LabApp] JupyterLab extension loaded from /opt/conda/lib/python3.11/site-packages/jupyterlab
[I 2024-03-08 02:08:34.859 LabApp] JupyterLab application directory is /opt/conda/share/jupyter/lab
[I 2024-03-08 02:08:34.860 LabApp] Extension Manager is 'pypi'.
[I 2024-03-08 02:08:34.885 ServerApp] jupyterlab | extension was successfully loaded.
[I 2024-03-08 02:08:34.889 ServerApp] nbclassic | extension was successfully loaded.
[I 2024-03-08 02:08:34.893 ServerApp] notebook | extension was successfully loaded.
[I 2024-03-08 02:08:34.893 ServerApp] Serving notebooks from local directory: /home/ross/jupyterhub_volume_data
[I 2024-03-08 02:08:34.894 ServerApp] Jupyter Server 2.13.0 is running at:
[I 2024-03-08 02:08:34.894 ServerApp] http://f3dcca9c6ccf:8888/user/ross/lab?token=...
[I 2024-03-08 02:08:34.894 ServerApp]     http://127.0.0.1:8888/user/ross/lab?token=...
[I 2024-03-08 02:08:34.894 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[I 2024-03-08 02:08:35.114 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.81ms
[I 2024-03-08 02:08:35.204 ServerApp] 302 GET /user/ross/ -> /user/ross/lab? (@172.17.0.1) 7.43ms
[I 2024-03-08 02:08:35.229 ServerApp] 302 GET /user/ross/ -> /user/ross/lab? (@::ffff:127.0.0.1) 0.49ms
[I 2024-03-08 02:08:35.243 ServerApp] 302 GET /user/ross/lab? -> /hub/api/oauth2/authorize?client_id=jupyterhub-user-ross&redirect_uri=%2Fuser%2Fross%2Foauth_callback&response_type=code&state=[secret] (@::ffff:127.0.0.1) 1.72ms
[I 2024-03-08 02:08:35.498 ServerApp] Logged-in user {'name': 'ross', 'admin': True, 'groups': [], 'kind': 'user', 'session_id': '4edd8cf6eda2498da6c788d147a09631', 'scopes': ['access:servers!server=ross/', 'read:users:groups!user=ross', 'read:users:name!user=ross']}
[I 2024-03-08 02:08:35.507 ServerApp] 302 GET /user/ross/oauth_callback?code=[secret]&state=[secret] -> /user/ross/lab? (@::ffff:127.0.0.1) 135.82ms
[I 2024-03-08 02:08:35.533 ServerApp] 200 GET /user/ross/lab? (ross@::ffff:127.0.0.1) 20.95ms
[I 2024-03-08 02:08:35.661 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
[I 2024-03-08 02:08:36.214 ServerApp] 200 GET /user/ross/api/kernelspecs?1709863716199 (ross@::ffff:127.0.0.1) 12.66ms
[I 2024-03-08 02:08:36.218 ServerApp] 200 GET /user/ross/api/me?1709863716199 (ross@::ffff:127.0.0.1) 1.47ms
[I 2024-03-08 02:08:36.340 ServerApp] 200 GET /user/ross/lab/api/settings?1709863716227 (ross@::ffff:127.0.0.1) 110.13ms
[I 2024-03-08 02:08:36.344 ServerApp] 200 GET /user/ross/api/sessions?1709863716233 (ross@::ffff:127.0.0.1) 2.89ms
[I 2024-03-08 02:08:36.345 ServerApp] 200 GET /user/ross/api/terminals?1709863716233 (ross@::ffff:127.0.0.1) 3.15ms
[I 2024-03-08 02:08:36.346 ServerApp] 101 GET /user/ross/api/events/subscribe?token=[secret] (ross@::ffff:127.0.0.1) 3.44ms
[I 2024-03-08 02:08:36.347 ServerApp] 200 GET /user/ross/api/kernelspecs?1709863716234 (ross@::ffff:127.0.0.1) 4.28ms
[I 2024-03-08 02:08:36.348 ServerApp] 200 GET /user/ross/api/kernels?1709863716232 (ross@::ffff:127.0.0.1) 4.58ms
[I 2024-03-08 02:08:36.371 ServerApp] 200 GET /user/ross/api/me?1709863716235 (ross@::ffff:127.0.0.1) 1.00ms
[I 2024-03-08 02:08:36.657 ServerApp] 200 GET /user/ross/lab/api/translations/default?1709863716634 (ross@::ffff:127.0.0.1) 19.69ms
[I 2024-03-08 02:08:36.677 ServerApp] 200 GET /user/ross/api/config/jupyterlabapputilsextensionannouncements?1709863716672 (ross@::ffff:127.0.0.1) 2.61ms
[I 2024-03-08 02:08:36.854 ServerApp] 200 GET /user/ross/lsp/status?1709863716846 (ross@::ffff:127.0.0.1) 4.47ms
[I 2024-03-08 02:08:36.926 ServerApp] 200 GET /user/ross/api/contents?content=1&hash=0&1709863716914 (ross@::ffff:127.0.0.1) 7.59ms
[I 2024-03-08 02:08:36.953 ServerApp] 200 GET /user/ross/lab/api/translations?1709863716902 (ross@::ffff:127.0.0.1) 48.06ms
[I 2024-03-08 02:08:37.031 ServerApp] 200 GET /user/ross/lab/api/settings/@jupyterlab/codemirror-extension:plugin?1709863717025 (ross@::ffff:127.0.0.1) 3.49ms
[I 2024-03-08 02:08:37.042 ServerApp] 200 GET /user/ross/lab/api/settings/@jupyterlab/notebook-extension:panel?1709863717026 (ross@::ffff:127.0.0.1) 7.22ms
[I 2024-03-08 02:08:37.215 ServerApp] 200 GET /user/ross/lab/api/workspaces/default?1709863717210 (ross@::ffff:127.0.0.1) 1.09ms
[I 2024-03-08 02:08:37.453 ServerApp] 200 GET /user/ross/api/contents?content=1&hash=0&1709863717439 (ross@::ffff:127.0.0.1) 10.35ms
[I 2024-03-08 02:08:37.504 ServerApp] 200 GET /user/ross/lab/api/settings?ids_only=true&1709863717484 (ross@::ffff:127.0.0.1) 16.53ms
[I 2024-03-08 02:08:37.779 LabApp] Build is up to date
[I 2024-03-08 02:08:37.780 ServerApp] 200 GET /user/ross/lab/api/build?1709863716713 (ross@::ffff:127.0.0.1) 1063.46ms
[I 2024-03-08 02:08:38.167 ServerApp] 204 PUT /user/ross/lab/api/workspaces/default?1709863718162 (ross@::ffff:127.0.0.1) 1.27ms
[I 2024-03-08 02:08:38.199 ServerApp] 200 GET /user/ross/api/contents?content=1&hash=0&1709863718190 (ross@::ffff:127.0.0.1) 7.19ms
[I 2024-03-08 02:08:38.484 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.55ms
[I 2024-03-08 02:08:38.806 ServerApp] 204 PUT /user/ross/lab/api/workspaces/default?1709863718802 (ross@::ffff:127.0.0.1) 1.25ms
[I 2024-03-08 02:08:40.839 ServerApp] Creating new notebook in 
[I 2024-03-08 02:08:40.899 ServerApp] Writing notebook-signing key to /home/jovyan/.local/share/jupyter/notebook_secret
[W 2024-03-08 02:08:40.902 ServerApp] 403 POST /user/ross/api/contents?1709863720833 (::ffff:127.0.0.1): Permission denied: Untitled.ipynb
[W 2024-03-08 02:08:40.903 ServerApp] wrote error: 'Permission denied: Untitled.ipynb'
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.11/site-packages/jupyter_server/services/contents/fileio.py", line 230, in perm_to_403
        yield
      File "/opt/conda/lib/python3.11/site-packages/jupyter_server/services/contents/fileio.py", line 220, in atomic_writing
        with atomic_writing(os_path, *args, **kwargs) as f:
      File "/opt/conda/lib/python3.11/contextlib.py", line 137, in __enter__
        return next(self.gen)
               ^^^^^^^^^^^^^^
      File "/opt/conda/lib/python3.11/site-packages/jupyter_server/services/contents/fileio.py", line 112, in atomic_writing
        fileobj = open(path, "w", encoding=encoding, **kwargs)  # noqa: SIM115
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    PermissionError: [Errno 13] Permission denied: '/home/ross/jupyterhub_volume_data/Untitled.ipynb'
    
    The above exception was the direct cause of the following exception:
    
    Traceback (most recent call last):
      File "/opt/conda/lib/python3.11/site-packages/tornado/web.py", line 1790, in _execute
        result = await result
                 ^^^^^^^^^^^^
      File "/opt/conda/lib/python3.11/site-packages/jupyter_server/auth/decorator.py", line 73, in inner
        return await out
               ^^^^^^^^^
      File "/opt/conda/lib/python3.11/site-packages/jupyter_server/services/contents/handlers.py", line 284, in post
        await self._new_untitled(path, type=type, ext=ext)
      File "/opt/conda/lib/python3.11/site-packages/jupyter_server/services/contents/handlers.py", line 231, in _new_untitled
        model = await ensure_async(
                ^^^^^^^^^^^^^^^^^^^
      File "/opt/conda/lib/python3.11/site-packages/jupyter_core/utils/__init__.py", line 198, in ensure_async
        result = await obj
                 ^^^^^^^^^
      File "/opt/conda/lib/python3.11/site-packages/jupyter_server/services/contents/manager.py", line 992, in new_untitled
        return await self.new(model, path)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/conda/lib/python3.11/site-packages/jupyter_server/services/contents/manager.py", line 1018, in new
        model = await self.save(model, path)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/conda/lib/python3.11/site-packages/jupyter_server/services/contents/largefilemanager.py", line 133, in save
        return await super().save(model, path)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/conda/lib/python3.11/site-packages/jupyter_server/services/contents/filemanager.py", line 959, in save
        await self._save_notebook(os_path, nb, capture_validation_error=validation_error)
      File "/opt/conda/lib/python3.11/site-packages/jupyter_server/services/contents/fileio.py", line 487, in _save_notebook
        with self.atomic_writing(os_path, encoding="utf-8") as f:
      File "/opt/conda/lib/python3.11/contextlib.py", line 137, in __enter__
        return next(self.gen)
               ^^^^^^^^^^^^^^
      File "/opt/conda/lib/python3.11/site-packages/jupyter_server/services/contents/fileio.py", line 217, in atomic_writing
        with self.perm_to_403(os_path):
      File "/opt/conda/lib/python3.11/contextlib.py", line 158, in __exit__
        self.gen.throw(typ, value, traceback)
      File "/opt/conda/lib/python3.11/site-packages/jupyter_server/services/contents/fileio.py", line 239, in perm_to_403
        raise HTTPError(403, "Permission denied: %s" % path) from e
    tornado.web.HTTPError: HTTP 403: Forbidden (Permission denied: Untitled.ipynb)
[W 2024-03-08 02:08:40.908 ServerApp] 403 POST /user/ross/api/contents?1709863720833 (ross@::ffff:127.0.0.1) 69.49ms
[I 2024-03-08 02:08:41.875 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.59ms
[I 2024-03-08 02:08:45.266 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.48ms
[I 2024-03-08 02:08:46.647 ServerApp] 200 GET /user/ross/api/sessions?1709863726640 (ross@::ffff:127.0.0.1) 1.10ms
[I 2024-03-08 02:08:46.652 ServerApp] 200 GET /user/ross/api/terminals?1709863726642 (ross@::ffff:127.0.0.1) 1.01ms
[I 2024-03-08 02:08:46.653 ServerApp] 200 GET /user/ross/api/kernels?1709863726641 (ross@::ffff:127.0.0.1) 0.83ms
[I 2024-03-08 02:08:48.339 ServerApp] 200 GET /user/ross/api/contents?content=1&hash=0&1709863728334 (ross@::ffff:127.0.0.1) 2.08ms
[I 2024-03-08 02:08:48.643 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.72ms
[I 2024-03-08 02:08:52.016 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.51ms
[I 2024-03-08 02:08:55.372 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.45ms
[I 2024-03-08 02:08:56.656 ServerApp] 200 GET /user/ross/api/sessions?1709863736651 (ross@::ffff:127.0.0.1) 0.84ms
[I 2024-03-08 02:08:56.662 ServerApp] 200 GET /user/ross/api/terminals?1709863736657 (ross@::ffff:127.0.0.1) 0.74ms
[I 2024-03-08 02:08:56.664 ServerApp] 200 GET /user/ross/api/kernels?1709863736657 (ross@::ffff:127.0.0.1) 1.60ms
[I 2024-03-08 02:08:58.347 ServerApp] 200 GET /user/ross/api/contents?content=1&hash=0&1709863738343 (ross@::ffff:127.0.0.1) 1.98ms
[I 2024-03-08 02:08:58.781 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.44ms
[I 2024-03-08 02:09:02.146 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.49ms
[I 2024-03-08 02:09:05.514 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.41ms
[I 2024-03-08 02:09:06.665 ServerApp] 200 GET /user/ross/api/sessions?1709863746661 (ross@::ffff:127.0.0.1) 0.95ms
[I 2024-03-08 02:09:06.670 ServerApp] 200 GET /user/ross/api/terminals?1709863746666 (ross@::ffff:127.0.0.1) 0.87ms
[I 2024-03-08 02:09:06.673 ServerApp] 200 GET /user/ross/api/kernels?1709863746668 (ross@::ffff:127.0.0.1) 0.80ms
[I 2024-03-08 02:09:08.359 ServerApp] 200 GET /user/ross/api/contents?content=1&hash=0&1709863748351 (ross@::ffff:127.0.0.1) 5.20ms
[I 2024-03-08 02:09:08.896 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.45ms
[I 2024-03-08 02:09:12.292 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.57ms
[I 2024-03-08 02:09:15.708 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.70ms
[I 2024-03-08 02:09:16.674 ServerApp] 200 GET /user/ross/api/sessions?1709863756670 (ross@::ffff:127.0.0.1) 0.89ms
[I 2024-03-08 02:09:16.679 ServerApp] 200 GET /user/ross/api/terminals?1709863756675 (ross@::ffff:127.0.0.1) 0.93ms
[I 2024-03-08 02:09:16.683 ServerApp] 200 GET /user/ross/api/kernels?1709863756676 (ross@::ffff:127.0.0.1) 0.67ms
[I 2024-03-08 02:09:18.381 ServerApp] 200 GET /user/ross/api/contents?content=1&hash=0&1709863758375 (ross@::ffff:127.0.0.1) 2.45ms
[I 2024-03-08 02:09:19.112 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.59ms
[I 2024-03-08 02:09:22.529 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.61ms
[I 2024-03-08 02:09:25.921 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.57ms
[I 2024-03-08 02:09:26.685 ServerApp] 200 GET /user/ross/api/sessions?1709863766678 (ross@::ffff:127.0.0.1) 0.85ms
[I 2024-03-08 02:09:27.686 ServerApp] 200 GET /user/ross/api/terminals?1709863767677 (ross@::ffff:127.0.0.1) 1.05ms
[I 2024-03-08 02:09:27.688 ServerApp] 200 GET /user/ross/api/kernels?1709863767678 (ross@::ffff:127.0.0.1) 0.82ms
[I 2024-03-08 02:09:29.328 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.53ms
[I 2024-03-08 02:09:32.732 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.64ms
[I 2024-03-08 02:09:36.137 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.74ms
[I 2024-03-08 02:09:37.693 ServerApp] 200 GET /user/ross/api/kernelspecs?1709863777688 (ross@::ffff:127.0.0.1) 1.53ms
[I 2024-03-08 02:09:37.695 ServerApp] 200 GET /user/ross/api/me?1709863777689 (ross@::ffff:127.0.0.1) 0.82ms
[I 2024-03-08 02:09:39.534 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 1.02ms
[I 2024-03-08 02:09:42.946 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.56ms
[I 2024-03-08 02:09:46.327 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 1.09ms
[I 2024-03-08 02:09:49.710 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.65ms
[I 2024-03-08 02:09:53.108 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.56ms
[I 2024-03-08 02:09:56.486 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.56ms
[I 2024-03-08 02:09:59.851 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.46ms
[I 2024-03-08 02:10:03.230 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.54ms
[I 2024-03-08 02:10:06.590 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.46ms
[I 2024-03-08 02:10:09.966 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.50ms
[I 2024-03-08 02:10:13.322 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.53ms
[I 2024-03-08 02:10:16.684 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.45ms
[I 2024-03-08 02:10:20.027 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.52ms
[I 2024-03-08 02:10:23.408 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.38ms
[I 2024-03-08 02:10:26.779 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.52ms
[I 2024-03-08 02:10:30.204 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.81ms
[I 2024-03-08 02:10:33.617 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.76ms
[I 2024-03-08 02:10:37.022 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.50ms
[I 2024-03-08 02:10:40.440 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.79ms
[I 2024-03-08 02:10:43.810 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.54ms
[I 2024-03-08 02:10:47.255 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.72ms
[I 2024-03-08 02:10:50.683 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.51ms
[I 2024-03-08 02:10:54.046 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.42ms
[I 2024-03-08 02:10:57.390 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.44ms
[I 2024-03-08 02:11:00.730 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.54ms
[I 2024-03-08 02:11:04.064 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.56ms
[I 2024-03-08 02:11:07.391 ServerApp] 200 GET /user/ross/api (@172.17.0.2) 0.44ms
ross@ross-VirtualBox:~/Desktop$ 

Command to run Jupyterhub :

jupyterhub -f jupyter_config.py

an observation:

can anyone help me here ?
Thanks in advanced

You could modify your pre_spawn_hook to change the ownership of the directory to that of the user. Alternative you can set the CHOWN_HOME environment variable in the spawner:
https://jupyter-docker-stacks.readthedocs.io/en/latest/using/common.html#docker-options

1 Like

Thanks @manics
image