Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document need to run "jlpm build:core" before running JupyterLab in dev mode #16313

Open
lokashrinav opened this issue May 10, 2024 · 4 comments

Comments

@lokashrinav
Copy link

lokashrinav commented May 10, 2024

Description

Receiving 500: Internal Server Error when running jupyter lab --dev-mode.

Reproduce

  1. Run jupyter lab --dev-mode in the command line.
  2. See the error message "500 Internal Server Error

Expected behavior

It's supposed to open up jupyter labs properly in developer mode.

Context

Operating System and version: Microsoft Windows 11 Home 10.0.22631 N/A Build 22631
Browser and version: Chrome 124
JupyterLab version: 4.2.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
PS C:\Users\navee\jupyterlab> jupyter lab --dev-mode
[I 2024-05-10 00:49:05.610 ServerApp] ipyparallel | extension was successfully linked.
[I 2024-05-10 00:49:05.610 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2024-05-10 00:49:05.626 ServerApp] jupyter_server_terminals | extension was successfully linked.
[I 2024-05-10 00:49:05.626 ServerApp] jupyterlab | extension was successfully linked.
[I 2024-05-10 00:49:05.641 ServerApp] notebook | extension was successfully linked.
[I 2024-05-10 00:49:05.641 ServerApp] notebook_shim | extension was successfully linked.
[I 2024-05-10 00:49:05.688 ServerApp] notebook_shim | extension was successfully loaded.
[I 2024-05-10 00:49:05.689 ServerApp] Loading IPython parallel extension
[I 2024-05-10 00:49:05.689 ServerApp] ipyparallel | extension was successfully loaded.
[I 2024-05-10 00:49:05.689 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2024-05-10 00:49:05.689 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2024-05-10 00:49:05.689 LabApp] Running JupyterLab in dev mode
[I 2024-05-10 00:49:05.689 LabApp] JupyterLab extension loaded from C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyterlab
[I 2024-05-10 00:49:05.689 LabApp] JupyterLab application directory is C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\dev_mode
[I 2024-05-10 00:49:10.024 LabApp] You're running JupyterLab from source.
    If you're working on the TypeScript sources of JupyterLab, try running
    jupyter lab --dev-mode --watch


to have the system incrementally watch and build JupyterLab for you, as you
make changes.

[I 2024-05-10 00:49:10.024 LabApp] Extension Manager is 'pypi'.
[I 2024-05-10 00:49:10.290 ServerApp] jupyterlab | extension was successfully loaded.
[I 2024-05-10 00:49:10.296 ServerApp] notebook | extension was successfully loaded.
[I 2024-05-10 00:49:10.296 ServerApp] Serving notebooks from local directory: C:\Users\navee\jupyterlab
[I 2024-05-10 00:49:10.296 ServerApp] Jupyter Server 2.14.0 is running at:
[I 2024-05-10 00:49:10.296 ServerApp] http://localhost:8888/lab?token=4a449f591d102dc72a4e226944dfa2e5612ae7813d004ca1
[I 2024-05-10 00:49:10.304 ServerApp] http://127.0.0.1:8888/lab?token=4a449f591d102dc72a4e226944dfa2e5612ae7813d004ca1
[I 2024-05-10 00:49:10.304 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2024-05-10 00:49:10.320 ServerApp]

To access the server, open this file in a browser:
    file:///C:/Users/navee/AppData/Roaming/jupyter/runtime/jpserver-33072-open.html
Or copy and paste one of these URLs:
    http://localhost:8888/lab?token=4a449f591d102dc72a4e226944dfa2e5612ae7813d004ca1
    http://127.0.0.1:8888/lab?token=4a449f591d102dc72a4e226944dfa2e5612ae7813d004ca1

[I 2024-05-10 00:49:11.135 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
[E 2024-05-10 00:49:11.638 ServerApp] Uncaught exception GET /lab?token=4a449f591d102dc72a4e226944dfa2e5612ae7813d004ca1 (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/lab?token=4a449f591d102dc72a4e226944dfa2e5612ae7813d004ca1', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyter_server\extension\handler.py", line 28, in get_template
return cast(str, self.settings[env].get_template(name)) # type:ignore[attr-defined]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\environment.py", line 1013, in get_template
return self._load_template(name, globals)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\environment.py", line 972, in _load_template
template = self.loader.load(self, name, self.make_globals(globals))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\loaders.py", line 126, in load
source, filename, uptodate = self.get_source(environment, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\loaders.py", line 207, in get_source
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: index.html

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\web.py", line 1788, in _execute
    result = method(*self.path_args, **self.path_kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\web.py", line 3301, in wrapper
    return method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\web.py", line 1967, in wrapper
    return method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyterlab_server\handlers.py", line 172, in get
    tpl = self.render_template("index.html", page_config=page_config)  # type:ignore[no-untyped-call]
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyter_server\base\handlers.py", line 666, in render_template
    template = self.get_template(name)
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyter_server\extension\handler.py", line 30, in get_template
    return cast(str, super().get_template(name))  # type:ignore[misc]
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyter_server\base\handlers.py", line 661, in get_template
    return self.settings["jinja2_env"].get_template(name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\environment.py", line 1013, in get_template
    return self._load_template(name, globals)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\environment.py", line 972, in _load_template
    template = self.loader.load(self, name, self.make_globals(globals))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\loaders.py", line 126, in load
    source, filename, uptodate = self.get_source(environment, name)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\loaders.py", line 207, in get_source
    raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: index.html

[E 2024-05-10 00:49:11.653 ServerApp] Could not open static file ''
[E 2024-05-10 00:49:11.669 LabApp] {
"Host": "localhost:8888",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"
}
[E 2024-05-10 00:49:11.669 LabApp] 500 GET /lab?token=[secret] (2bb57da0b844421eb094cfacca377e93@::1) 31.24ms referer=None
[W 2024-05-10 00:49:11.716 ServerApp] 404 GET /static/lab/logo/logo.png (2bb57da0b844421eb094cfacca377e93@::1) 0.00ms referer=http://localhost:8888/lab?token=[secret]
[W 2024-05-10 00:49:11.730 ServerApp] 404 GET /static/lab/style/bootstrap.min.css (2bb57da0b844421eb094cfacca377e93@::1) 0.00ms referer=http://localhost:8888/lab?token=[secret]
[W 2024-05-10 00:49:11.738 ServerApp] 404 GET /static/lab/style/index.css (2bb57da0b844421eb094cfacca377e93@::1) 0.00ms referer=http://localhost:8888/lab?token=[secret]
[W 2024-05-10 00:49:11.738 ServerApp] 404 GET /static/lab/style/bootstrap-theme.min.css (2bb57da0b844421eb094cfacca377e93@::1) 0.00ms referer=http://localhost:8888/lab?token=[secret]
[W 2024-05-10 00:49:12.036 ServerApp] 403 GET /static/lab/favicon.ico (::1): favicon.ico is not in root static directory
[W 2024-05-10 00:49:12.036 ServerApp] 403 GET /static/lab/favicon.ico (2bb57da0b844421eb094cfacca377e93@::1) 0.00ms referer=http://localhost:8888/lab
[E 2024-05-10 00:49:13.448 ServerApp] Uncaught exception GET /lab (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/lab', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyter_server\extension\handler.py", line 28, in get_template
return cast(str, self.settings[env].get_template(name)) # type:ignore[attr-defined]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\environment.py", line 1013, in get_template
return self._load_template(name, globals)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\environment.py", line 972, in _load_template
template = self.loader.load(self, name, self.make_globals(globals))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\loaders.py", line 126, in load
source, filename, uptodate = self.get_source(environment, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\loaders.py", line 207, in get_source
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: index.html

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\web.py", line 1788, in _execute
    result = method(*self.path_args, **self.path_kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\web.py", line 3301, in wrapper
    return method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\web.py", line 1967, in wrapper
    return method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyterlab_server\handlers.py", line 172, in get
    tpl = self.render_template("index.html", page_config=page_config)  # type:ignore[no-untyped-call]
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyter_server\base\handlers.py", line 666, in render_template
    template = self.get_template(name)
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyter_server\extension\handler.py", line 30, in get_template
    return cast(str, super().get_template(name))  # type:ignore[misc]
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyter_server\base\handlers.py", line 661, in get_template
    return self.settings["jinja2_env"].get_template(name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\environment.py", line 1013, in get_template
    return self._load_template(name, globals)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\environment.py", line 972, in _load_template
    template = self.loader.load(self, name, self.make_globals(globals))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\loaders.py", line 126, in load
    source, filename, uptodate = self.get_source(environment, name)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\loaders.py", line 207, in get_source
    raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: index.html

[E 2024-05-10 00:49:13.461 LabApp] {
"Host": "localhost:8888",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"
}
[E 2024-05-10 00:49:13.465 LabApp] 500 GET /lab (2bb57da0b844421eb094cfacca377e93@::1) 24.22ms referer=None
[W 2024-05-10 00:49:13.477 ServerApp] 404 GET /static/lab/style/bootstrap.min.css?v=0e8a7fbd6de23ad6b27ab95802a0a0915af6693af612bc304d83af445529ce5d95842309ca3405d10f538d45c8a3a261b8cff78b4bd512dd9effb4109a71d0ab (2bb57da0b844421eb094cfacca377e93@::1) 0.00ms referer=http://localhost:8888/lab
[W 2024-05-10 00:49:13.492 ServerApp] 404 GET /static/lab/style/bootstrap-theme.min.css?v=8b2f045cb5b4d5ad346f6e816aa2566829a4f5f2783ec31d80d46a57de8ac0c3d21fe6e53bcd8e1f38ac17fcd06d12088bc9b43e23b5d1da52d10c6b717b22b3 (2bb57da0b844421eb094cfacca377e93@::1) 15.64ms referer=http://localhost:8888/lab
[W 2024-05-10 00:49:13.492 ServerApp] 404 GET /static/lab/style/index.css?v=30372e3246a801d662cf9e3f9dd656fa192eebde9054a2282449fe43919de9f0ee9b745d7eb49d3b0a5e56357912cc7d776390eddcab9dac85b77bdb17b4bdae (2bb57da0b844421eb094cfacca377e93@::1) 15.64ms referer=http://localhost:8888/lab
[W 2024-05-10 00:49:13.503 ServerApp] 404 GET /static/lab/logo/logo.png?v=a2a176ee3cee251ffddf5fa21fe8e43727a9e5f87a06f9c91ad7b776d9e9d3d5e0159c16cc188a3965e00375fb4bc336c16067c688f5040c0c2d4bfdb852a9e4 (2bb57da0b844421eb094cfacca377e93@::1) 0.00ms referer=http://localhost:8888/lab
[W 2024-05-10 00:49:13.548 ServerApp] 403 GET /static/lab/favicon.ico?v=50afa725b5de8b00030139d09b38620224d4e7dba47c07ef0e86d4643f30c9bfe6bb7e1a4a1c561aa32834480909a4b6fe7cd1e17f7159330b6b5914bf45a880 (::1): favicon.ico is not in root static directory
[W 2024-05-10 00:49:13.557 ServerApp] 403 GET /static/lab/favicon.ico?v=50afa725b5de8b00030139d09b38620224d4e7dba47c07ef0e86d4643f30c9bfe6bb7e1a4a1c561aa32834480909a4b6fe7cd1e17f7159330b6b5914bf45a880 (2bb57da0b844421eb094cfacca377e93@::1) 8.05ms referer=http://localhost:8888/lab
[E 2024-05-10 00:49:14.998 ServerApp] Uncaught exception GET /lab (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/lab', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyter_server\extension\handler.py", line 28, in get_template
return cast(str, self.settings[env].get_template(name)) # type:ignore[attr-defined]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\environment.py", line 1013, in get_template
return self._load_template(name, globals)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\environment.py", line 972, in _load_template
template = self.loader.load(self, name, self.make_globals(globals))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\loaders.py", line 126, in load
source, filename, uptodate = self.get_source(environment, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\loaders.py", line 207, in get_source
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: index.html

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\web.py", line 1788, in _execute
    result = method(*self.path_args, **self.path_kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\web.py", line 3301, in wrapper
    return method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\tornado\web.py", line 1967, in wrapper
    return method(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyterlab_server\handlers.py", line 172, in get
    tpl = self.render_template("index.html", page_config=page_config)  # type:ignore[no-untyped-call]
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyter_server\base\handlers.py", line 666, in render_template
    template = self.get_template(name)
               ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyter_server\extension\handler.py", line 30, in get_template
    return cast(str, super().get_template(name))  # type:ignore[misc]
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyter_server\base\handlers.py", line 661, in get_template
    return self.settings["jinja2_env"].get_template(name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\environment.py", line 1013, in get_template
    return self._load_template(name, globals)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\environment.py", line 972, in _load_template
    template = self.loader.load(self, name, self.make_globals(globals))
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\loaders.py", line 126, in load
    source, filename, uptodate = self.get_source(environment, name)
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\loaders.py", line 207, in get_source
    raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: index.html

[E 2024-05-10 00:49:15.013 LabApp] {
"Host": "localhost:8888",
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.7",
"Referer": "http://localhost:8888/lab",
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"
}
[E 2024-05-10 00:49:15.013 LabApp] 500 GET /lab (2bb57da0b844421eb094cfacca377e93@::1) 16.84ms referer=http://localhost:8888/lab
[W 2024-05-10 00:49:15.039 ServerApp] 404 GET /static/lab/style/bootstrap.min.css?v=0e8a7fbd6de23ad6b27ab95802a0a0915af6693af612bc304d83af445529ce5d95842309ca3405d10f538d45c8a3a261b8cff78b4bd512dd9effb4109a71d0ab (2bb57da0b844421eb094cfacca377e93@::1) 2.88ms referer=http://localhost:8888/lab
[W 2024-05-10 00:49:15.041 ServerApp] 404 GET /static/lab/style/bootstrap-theme.min.css?v=8b2f045cb5b4d5ad346f6e816aa2566829a4f5f2783ec31d80d46a57de8ac0c3d21fe6e53bcd8e1f38ac17fcd06d12088bc9b43e23b5d1da52d10c6b717b22b3 (2bb57da0b844421eb094cfacca377e93@::1) 1.53ms referer=http://localhost:8888/lab
[W 2024-05-10 00:49:15.046 ServerApp] 404 GET /static/lab/style/index.css?v=30372e3246a801d662cf9e3f9dd656fa192eebde9054a2282449fe43919de9f0ee9b745d7eb49d3b0a5e56357912cc7d776390eddcab9dac85b77bdb17b4bdae (2bb57da0b844421eb094cfacca377e93@::1) 1.72ms referer=http://localhost:8888/lab
[W 2024-05-10 00:49:15.049 ServerApp] 404 GET /static/lab/logo/logo.png?v=a2a176ee3cee251ffddf5fa21fe8e43727a9e5f87a06f9c91ad7b776d9e9d3d5e0159c16cc188a3965e00375fb4bc336c16067c688f5040c0c2d4bfdb852a9e4 (2bb57da0b844421eb094cfacca377e93@::1) 4.52ms referer=http://localhost:8888/lab
[W 2024-05-10 00:49:15.095 ServerApp] 403 GET /static/lab/favicon.ico?v=50afa725b5de8b00030139d09b38620224d4e7dba47c07ef0e86d4643f30c9bfe6bb7e1a4a1c561aa32834480909a4b6fe7cd1e17f7159330b6b5914bf45a880 (::1): favicon.ico is not in root static directory
[W 2024-05-10 00:49:15.103 ServerApp] 403 GET /static/lab/favicon.ico?v=50afa725b5de8b00030139d09b38620224d4e7dba47c07ef0e86d4643f30c9bfe6bb7e1a4a1c561aa32834480909a4b6fe7cd1e17f7159330b6b5914bf45a880 (2bb57da0b844421eb094cfacca377e93@::1) 8.14ms referer=http://localhost:8888/lab
[E 2024-05-10 00:49:15.151 ServerApp] Uncaught exception GET /lab (::1)
HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/lab', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jupyter_server\extension\handler.py", line 28, in get_template
return cast(str, self.settings[env].get_template(name)) # type:ignore[attr-defined]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\environment.py", line 1013, in get_template
return self._load_template(name, globals)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\environment.py", line 972, in _load_template
template = self.loader.load(self, name, self.make_globals(globals))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\loaders.py", line 126, in load
source, filename, uptodate = self.get_source(environment, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\navee\AppData\Local\Programs\Python\Python311\Lib\site-packages\jinja2\loaders.py", line 207, in get_source
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: index.html

Browser Output
500 : Internal Server Error
@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label May 10, 2024
@krassowski
Copy link
Member

Thank you for opening the issue @lokashrinav. 500 : Internal Server Error is definitely not a great first experience. Usually it comes about when the templates cannot be found because the lab was not built for dev mode (this is confirmed by your logs, jinja2.exceptions.TemplateNotFound: index.html).

Your reproduction steps indeed do not include the build steps which are required prior to running jupyter lab --dev-mode. Can you try following each step in https://jupyterlab.readthedocs.io/en/stable/developer/contributing.html#installing-jupyterlab and get back to me confirming whether this solved the 500 error, in particular:

jlpm run build   # I think only this is really required, but if it does not help, please try the following ones too
jlpm run build:core
jupyter lab build

I think there are two issues:

  • documentation does not explain it correctly (it lists some steps as optional but they are not)
  • we could catch the TemplateNotFound error and warn developer that they forgot to build or that build did not succeed

@lokashrinav
Copy link
Author

Hello @krassowski.

Sorry for not being more specific. I've run

git clone https://github.com//jupyterlab.git
cd jupyterlab
pip install -e ".[dev,test]"
jlpm install
jlpm run build

  • When I'm running jlpm run build: core, I get an error: Usage Error: Couldn't find a script named "build:". jlpm run build works though.

@lokashrinav
Copy link
Author

lokashrinav commented May 10, 2024

@krassowski

I fixed the issue. The code didn't work until I ran jlpm build:core. This worked for some reason. jlpm run build:core didn't work for me, so I tried an alternate command.

@krassowski
Copy link
Member

Thanks for the update. Reopening the issue to track documentation improvements.

@krassowski krassowski reopened this May 10, 2024
@JasonWeill JasonWeill removed the status:Needs Triage Applied to new issues that need triage label May 14, 2024
@JasonWeill JasonWeill changed the title 500 : Internal Server Error when running jupyter lab --dev-mode Document need to run "jlpm build:core" before running JupyterLab in dev mode May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants