Skip to content

Downloads of notebook files from the configured S3 bucket in JupyterLab are failing #468

Open
@DianaLyM

Description

@DianaLyM

Description

Currently, we start JupyterLab using jupyter lab --no-browser --log-level=DEBUG --config jupyter_lab_config.py. Notebooks are saved in S3. They download successfully when the bucket is named notebooks, but fail when using other bucket names. (Unsure if Jupyter server has hardcoded the bucket name as notebooks or only routes notebooks paths for ipynb files.)

The jupyter_lab_config.py file is configured with the connection to S3ContentsManager.

import os
from s3contents import S3ContentsManager

c = get_config()
c.ServerApp.contents_manager_class = S3ContentsManager
c.S3ContentsManager.prefix_case_sensitive = True
c.S3ContentsManager.bucket = os.environ.get('S3_BUCKET', "my_nb")
c.S3ContentsManager.region_name = os.environ.get('REGION', "eu-central-1")
c.S3ContentsManager.access_key_id = '****'
c.S3ContentsManager.secret_access_key = '****'
c.S3ContentsManager.debug = True

This download behavior might be a bug in JupyterLab.

Reproduce

  1. Set bucket name and startup jupyterlab.
  2. Access http://127.0.0.1:8888/lab/ and navigate to JupyterLab
  3. Select a file from the left-hand file list, which correctly displays all files under the bucket, and right-click on it.
  4. Click on Download.
  5. See the error in the browser’s Recent Download History.

JupyterLab seems unable to resolve the file paths correctly, leading to 404 errors in the console logs.

[W 2025-05-09 09:20:10.371 ServerApp] 404 GET /my_nb/nb_test/hello.ipynb (127.0.0.1) 121.80ms referer=http://127.0.0.1:8888/lab

Expected behavior

Notebook files can now be successfully downloaded from any configured bucket.

Context

  • Operating System and version: Macbook Pro 14.4
  • Browser and version: Chrome Version 131.0.6778.141
  • JupyterLab version: 4.2.4
    jupyter_client            8.6.2
    jupyter_core              5.3.1
    jupyter-events            0.10.0
    jupyter-lsp               2.2.0
    jupyter_server            2.14.2
    jupyter_server_fileid     0.9.0
    jupyter_server_terminals  0.5.3
    jupyter_server_ydoc       0.8.0
    jupyter-ydoc              0.2.5
    jupyterlab                4.2.4
    
Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output
[W 2024-12-31 16:21:16.588 ServerApp] 404 GET /files/untitled.md?_xsrf=[secret] (xxx@127.0.0.1) 18.27ms referer=http://127.0.0.1:8888/lab/workspaces/auto-a/tree/untitled.md
Browser Output
Paste the output from your browser Javascript console here, if applicable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions