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

Receiving 403 error when trying to run Jupyter Lab inside colab as a kernel port. #15804

Closed
nnWhisperer opened this issue Feb 15, 2024 · 2 comments
Labels
bug status:Needs Triage Applied to new issues that need triage

Comments

@nnWhisperer
Copy link

Description

I like Jupyterlab's extensions and google colab's ease / cheapness. As best of both worlds, I'm trying to run JupyterLab inside google colab, to be able to open JupyterLab in new window with jupyter lab extensions installed. One may easily reproduce the problem I faced using https://colab.research.google.com/ with the code I provide below. To me it seems that 'ServerApp.allow_remote_access=True' setting isn't considered correctly.

Reproduce

!pip install jupyter-ai
!jupyter server extension list
!jupyter labextension list
import portpicker
port = portpicker.pick_unused_port()
port
from google.colab.output import serve_kernel_port_as_window
serve_kernel_port_as_window(port)

%%capture the_url
from google.colab.output import eval_js
print(eval_js( "google.colab.kernel.proxyPort(" + str(port) + ")" ))

url = the_url.stdout.strip() + 'lab'
print(url)
!jupyter lab --debug --port={port} --ip=0.0.0.0 --core-mode --ServerApp.custom_display_url={url} --ServerApp.allow_remote_access=True --ServerApp.disable_check_xsrf=True

After receiving 200 OKs, 403 errors are received and the page cannot be browsed:

[W 2024-02-15 01:59:02.921 ServerApp] 403 GET /api/sessions?1707962343076= (@127.0.0.1) 3.39ms referer=https://colab.research.google.com/
[W 2024-02-15 01:59:15.853 ServerApp] wrote error: 'Forbidden'
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/tornado/web.py", line 1784, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "/usr/local/lib/python3.10/dist-packages/tornado/web.py", line 3278, in wrapper
url = self.get_login_url()
File "/usr/local/lib/python3.10/dist-packages/jupyter_server/base/handlers.py", line 763, in get_login_url
raise web.HTTPError(403)
tornado.web.HTTPError: HTTP 403: Forbidden

Expected behavior

Upon clicking the url/lab/?token=.... link output from the server, I expect to be able to run jupyterlab but the jupyterlab app doesn't open (no jupyterlab structure is shown but only a black page) and we receive 403 errors on the logs. All we see on the browser tab is that, jupyter lab is loading, the browser title becomes Jupyterlab with its symbol correct and at right below corner a bell sign with number 0 on its left is shown.

Context

  • Operating System and version: Ubuntu 22.04.3 LTS
  • Browser and version: Chrome 121
  • JupyterLab version: 4.1.1
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.
[jupyterlab output.log](https://github.com/jupyterlab/jupyterlab/files/14290641/jupyterlab.output.log)
@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label Feb 15, 2024
Copy link

welcome bot commented Feb 15, 2024

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@JasonWeill
Copy link
Contributor

@nnWhisperer Thank you for your interest! This is an unusual use case, since Google Colab itself is a Jupyter notebook editing environment, and most people using JupyterLab on hosted computing resources do so on a simpler virtual machine, not from within a Jupyter environment. (Disclosure: I work for AWS.)

Because this may be a problem with Jupyter Server, and is not a problem with JupyterLab, I'm closing this issue. I recommend trying to run JupyterLab on a host that is not running another Jupyter notebook editing program at the same time. You can see the server issues page here: https://github.com/jupyter-server/jupyter_server/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug status:Needs Triage Applied to new issues that need triage
Projects
None yet
Development

No branches or pull requests

2 participants