Skip to content

Running Out of memory in a process can cause the extension handler to crash #1423

Open
@justusschock

Description

@justusschock

Description

If I run tail /dev/zero in a jupyterlab instance to produce an OOM, it can with ~40% probability trigger the following exception and cause all terminal tabs to close:

Traceback (most recent call last):
  File "/opt/jupyter/envs/main/lib/python3.10/site-packages/tornado/web.py", line 1298, in send_error
    self.write_error(status_code, **kwargs)
  File "/opt/jupyter/envs/main/lib/python3.10/site-packages/jupyter_server/base/handlers.py", line 739, in write_error
    html = self.render_template("%s.html" % status_code, **ns)
  File "/opt/jupyter/envs/main/lib/python3.10/site-packages/jupyter_server/base/handlers.py", line 667, in render_template
    return template.render(**ns)
  File "/opt/jupyter/envs/main/lib/python3.10/site-packages/jinja2/environment.py", line 1304, in render
    self.environment.handle_exception()
  File "/opt/jupyter/envs/main/lib/python3.10/site-packages/jinja2/environment.py", line 939, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "/opt/jupyter/envs/main/lib/python3.10/site-packages/jupyter_server/templates/404.html", line 1, in top-level template code
    {% extends "error.html" %}
  File "/opt/jupyter/envs/main/lib/python3.10/site-packages/jupyter_server/templates/error.html", line 1, in top-level template code
    {% extends "page.html" %}
  File "/opt/jupyter/envs/main/lib/python3.10/site-packages/jupyter_server/templates/page.html", line 9, in top-level template code
    {% block favicon %}<link id="favicon" rel="shortcut icon" type="image/x-icon" href="{{ static_url("favicon.ico") }}">
  File "/opt/jupyter/envs/main/lib/python3.10/site-packages/jupyter_server/templates/page.html", line 9, in block 'favicon'
    {% block favicon %}<link id="favicon" rel="shortcut icon" type="image/x-icon" href="{{ static_url("favicon.ico") }}">
  File "/opt/jupyter/envs/main/lib/python3.10/site-packages/jupyter_server/extension/handler.py", line 118, in static_url
    raise Exception(msg) from None
Exception: This extension doesn't have any static paths listed. Check that the extension's `static_paths` trait is set.

Reproduce

  • Open a jupyterlab instance
  • click on the terminal card
  • run tail /dev/zero
  • repeat until terminal window crashes

Expected behavior

I would expect to have the command killed due to OOM, but not the server getting an exception

Context

  • Operating System and version: Ubuntu 20.04
  • Browser and version: Arc version 1.41.0 (Chromium Engine Version 124.0.6367.92)
  • Jupyter Server version: 2.14.0
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
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
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