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

Unable to connect using kernelpicker and existing jupyter server (notebook 7.x) #14215

Closed
Yoyokrazy opened this issue Aug 29, 2023 · 9 comments · Fixed by #14340 or #14391
Closed

Unable to connect using kernelpicker and existing jupyter server (notebook 7.x) #14215

Yoyokrazy opened this issue Aug 29, 2023 · 9 comments · Fixed by #14340 or #14391
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug notebook-remote Applies to remote Jupyter Servers verified Verification succeeded

Comments

@Yoyokrazy
Copy link
Contributor

Testing #14200

After using same steps, but on vsc insiders desktop, win64, was able to connect to the existing jupyter serverproperly and execute code.

Steps Taken:

  • go to insiders.vscode.dev
  • open directory, and create newfile.ipynb
  • make sure I have jupyter pre-release installed.

  • in powershell, navigate to directory
  • activate venv
  • run python -m jupyter lab --NotebookApp.allow_origin='*'
  • copy URL given into new tab
    • jupyter lab opens as expected, can run cells and execute code in notebook, verified an active kernel.
  • return to insiders.vscode.dev
    • open notebook created earlier
    • click select kernel
    • click 'Existing Jupyter Server...'
    • 🐛 Paste URL copied from terminal (the same that was confirmed to work in the browser already), get 404'd

(.venv)  milively    new-empty   3.10.11  
╰─❯❯❯ python -m jupyter lab --NotebookApp.allow_origin='*'
[I 2023-08-29 16:11:38.775 ServerApp] Package jupyterlab took 0.0000s to import
[I 2023-08-29 16:11:38.803 ServerApp] Package jupyter_lsp took 0.0274s to import
[W 2023-08-29 16:11:38.803 ServerApp] A `_jupyter_server_extension_points` function was not found in jupyter_lsp. 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 2023-08-29 16:11:38.813 ServerApp] Package jupyter_server_terminals took 0.0106s to import
[I 2023-08-29 16:11:38.814 ServerApp] Package notebook took 0.0000s to import
[I 2023-08-29 16:11:38.816 ServerApp] Package notebook_shim took 0.0000s to import
[W 2023-08-29 16:11:38.816 ServerApp] A `_jupyter_server_extension_points` function was not found in notebook_shim. 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 2023-08-29 16:11:38.817 ServerApp] jupyter_lsp | extension was successfully linked.
[I 2023-08-29 16:11:38.825 ServerApp] jupyter_server_terminals | extension was successfully linked.
[W 2023-08-29 16:11:38.827 LabApp] 'allow_origin' has moved from NotebookApp to ServerApp. This config will be passed to ServerApp. Be sure to update your config before our next release.
[I 2023-08-29 16:11:38.838 ServerApp] jupyterlab | extension was successfully linked.
[I 2023-08-29 16:11:38.848 ServerApp] notebook | extension was successfully linked.
[I 2023-08-29 16:11:39.182 ServerApp] notebook_shim | extension was successfully linked.
[I 2023-08-29 16:11:39.211 ServerApp] notebook_shim | extension was successfully loaded.
[I 2023-08-29 16:11:39.213 ServerApp] jupyter_lsp | extension was successfully loaded.
[I 2023-08-29 16:11:39.214 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[I 2023-08-29 16:11:39.217 LabApp] JupyterLab extension loaded from C:\Users\milively\Documents\_dev_work\new-empty\.venv\lib\site-packages\jupyterlab
[I 2023-08-29 16:11:39.218 LabApp] JupyterLab application directory is C:\Users\milively\Documents\_dev_work\new-empty\.venv\share\jupyter\lab
[I 2023-08-29 16:11:39.219 LabApp] Extension Manager is 'pypi'.
[I 2023-08-29 16:11:39.220 ServerApp] jupyterlab | extension was successfully loaded.
[I 2023-08-29 16:11:39.224 ServerApp] notebook | extension was successfully loaded.
[I 2023-08-29 16:11:39.226 ServerApp] Serving notebooks from local directory: C:\Users\milively\Documents\_dev_work\new-empty
[I 2023-08-29 16:11:39.226 ServerApp] Jupyter Server 2.7.2 is running at:
[I 2023-08-29 16:11:39.226 ServerApp] http://localhost:8888/lab?token=cc1e4ff51b34acb5b9b19f7d56b538c0a6a340529cd80beb
[I 2023-08-29 16:11:39.226 ServerApp]     http://127.0.0.1:8888/lab?token=cc1e4ff51b34acb5b9b19f7d56b538c0a6a340529cd80beb
[I 2023-08-29 16:11:39.226 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 2023-08-29 16:11:39.277 ServerApp]

    To access the server, open this file in a browser:
        file:///C:/Users/milively/AppData/Roaming/jupyter/runtime/jpserver-972-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/lab?token=cc1e4ff51b34acb5b9b19f7d56b538c0a6a340529cd80beb
        http://127.0.0.1:8888/lab?token=cc1e4ff51b34acb5b9b19f7d56b538c0a6a340529cd80beb
[W 2023-08-29 16:11:39.311 ServerApp] Could not determine npm prefix: [WinError 2] The system cannot find the file specified
[I 2023-08-29 16:11:39.355 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 2023-08-29 16:11:47.375 LabApp] Build is up to date
[W 2023-08-29 16:11:53.655 ServerApp] Notebook tpi.ipynb is not trusted
[I 2023-08-29 16:11:53.831 ServerApp] Kernel started: 2ebf4136-f9c4-4e9a-8df3-c985a0052c5a
[I 2023-08-29 16:11:54.882 ServerApp] Connecting to kernel 2ebf4136-f9c4-4e9a-8df3-c985a0052c5a.
[I 2023-08-29 16:11:54.928 ServerApp] Connecting to kernel 2ebf4136-f9c4-4e9a-8df3-c985a0052c5a.
[I 2023-08-29 16:11:54.952 ServerApp] Connecting to kernel 2ebf4136-f9c4-4e9a-8df3-c985a0052c5a.
[W 2023-08-29 16:11:55.036 ServerApp] Got events for closed stream <zmq.eventloop.zmqstream.ZMQStream object at 0x0000026DCEC70610>
[W 2023-08-29 16:12:16.453 ServerApp] 404 OPTIONS /hub/api (@127.0.0.1) 11.19ms referer=None
[W 2023-08-29 16:12:16.453 ServerApp] 404 GET /hub/api (@127.0.0.1) 0.00ms referer=None
[W 2023-08-29 16:12:26.244 ServerApp] 404 OPTIONS /hub/api (@::1) 2.38ms referer=None
[W 2023-08-29 16:12:26.246 ServerApp] 404 GET /hub/api (@::1) 2.02ms referer=None
[W 2023-08-29 16:12:30.543 ServerApp] 404 OPTIONS /hub/api (@::1) 1.03ms referer=None
[W 2023-08-29 16:12:30.545 ServerApp] 404 GET /hub/api (@::1) 1.04ms referer=None
[I 2023-08-29 16:13:13.014 ServerApp] Starting buffering for 2ebf4136-f9c4-4e9a-8df3-c985a0052c5a:9eb9583b-ae9f-4d97-bc2d-91e3cbde794c
[W 2023-08-29 16:13:14.607 ServerApp] Notebook tpi.ipynb is not trusted
[I 2023-08-29 16:13:14.662 ServerApp] Connecting to kernel 2ebf4136-f9c4-4e9a-8df3-c985a0052c5a.
[I 2023-08-29 16:14:04.632 ServerApp] Starting buffering for 2ebf4136-f9c4-4e9a-8df3-c985a0052c5a:195695a3-f50c-4a1c-a488-be4f80d1b2cb
[W 2023-08-29 16:14:05.862 ServerApp] 400 GET /api/contents/newfile.ipynb?type=notebook&content=1&1693350845842 
[W 2023-08-29 16:14:05.874 ServerApp] 400 GET /api/contents/newfile.ipynb?type=notebook&content=1&1693350845842 (417817ef69ba4a2baca0940099858436@127.0.0.1) 16.92ms referer=http://127.0.0.1:8888/lab/tree/newfile.ipynb
[I 2023-08-29 16:14:33.240 ServerApp] Connecting to kernel 2ebf4136-f9c4-4e9a-8df3-c985a0052c5a.
[I 2023-08-29 16:14:33.377 ServerApp] Starting buffering for 2ebf4136-f9c4-4e9a-8df3-c985a0052c5a:dee24ef7-842b-47dc-96fe-6b1c55e3a674
[I 2023-08-29 16:14:33.638 LabApp] Build is up to date
[W 2023-08-29 16:14:37.923 ServerApp] Notebook newfile.ipynb is not trusted
[I 2023-08-29 16:14:38.031 ServerApp] Kernel started: 392c25fa-41f8-4424-9c95-b2acf7c9cb67
[I 2023-08-29 16:14:39.059 ServerApp] Connecting to kernel 392c25fa-41f8-4424-9c95-b2acf7c9cb67.
[I 2023-08-29 16:14:43.526 ServerApp] Saving file at /newfile.ipynb
[W 2023-08-29 16:15:00.720 ServerApp] 404 OPTIONS /hub/api (@127.0.0.1) 2.29ms referer=None
[W 2023-08-29 16:15:00.722 ServerApp] 404 GET /hub/api (@127.0.0.1) 2.19ms referer=None
[W 2023-08-29 16:15:07.503 ServerApp] 404 GET /hub/api (@127.0.0.1) 1.01ms referer=None
[I 2023-08-29 16:15:07.506 JupyterNotebookApp] 302 GET /tree? (@127.0.0.1) 0.00ms
[W 2023-08-29 16:15:08.646 ServerApp] 404 GET /hub/api (@127.0.0.1) 1.00ms referer=None
[I 2023-08-29 16:15:08.651 JupyterNotebookApp] 302 GET /tree? (@127.0.0.1) 1.00ms
[W 2023-08-29 16:15:08.692 ServerApp] 404 GET /hub/api (@127.0.0.1) 1.00ms referer=None
[I 2023-08-29 16:15:08.695 JupyterNotebookApp] 302 GET /tree? (@127.0.0.1) 1.00ms
[W 2023-08-29 16:16:03.192 ServerApp] 404 OPTIONS /hub/api (@127.0.0.1) 1.02ms referer=None
[W 2023-08-29 16:16:03.195 ServerApp] 404 GET /hub/api (@127.0.0.1) 1.00ms referer=None
[W 2023-08-29 16:16:20.494 ServerApp] 404 OPTIONS /hub/api (@127.0.0.1) 1.04ms referer=None
[W 2023-08-29 16:16:20.495 ServerApp] 404 GET /hub/api (@127.0.0.1) 0.98ms referer=None
@DonJayamanne
Copy link
Contributor

DonJayamanne commented Aug 29, 2023

Paste URL copied from terminal (the same that was confirmed to work in the browser already), get 404'd

@Yoyokrazy I'm not following you, whats the error message you get in VS Code?
Plese can you share the error message in VS Code (or a screenshot of that error).
Or is the 404 the error you can see in the terminal?

return to insiders.vscode.dev
open notebook created earlier
click select kernel
click 'Existing Jupyter Server...'
🐛 Paste URL copied from terminal (the same that was confirmed to work in the browser already), get 404'd

I'm a little confused, based on your comments this used to work in the browser already.
But insiders.vscode.dev is already the browser, so where are you now?

@DonJayamanne DonJayamanne added info-needed Issue requires more information from poster bug Issue identified by VS Code Team member as probable bug labels Aug 29, 2023
@DonJayamanne
Copy link
Contributor

Never mind, I can replicate this.

@DonJayamanne DonJayamanne added notebook-remote Applies to remote Jupyter Servers notebook-kernel-remote and removed info-needed Issue requires more information from poster labels Aug 29, 2023
@rebornix rebornix changed the title Unable to connect using kernelpicker and existing jupyter server. Unable to connect using kernelpicker and existing jupyter server (notebook 7.x) Sep 12, 2023
@Yoyokrazy
Copy link
Contributor Author

Closing as fixed in previous release, currently working in stable 🎉

@DonJayamanne DonJayamanne added this to the September 2023 milestone Sep 13, 2023
@DonJayamanne
Copy link
Contributor

Opening to make the code more resilient (future proof, rather than harcoding tree or lab in the paths)

@DonJayamanne DonJayamanne reopened this Sep 19, 2023
@andreamah andreamah added verified Verification succeeded and removed verified Verification succeeded labels Sep 28, 2023
@roblourens roblourens added the verification-steps-needed Steps to verify are needed for verification label Sep 28, 2023
@amunger amunger added the verified Verification succeeded label Sep 28, 2023
@roblourens roblourens removed the verification-steps-needed Steps to verify are needed for verification label Sep 28, 2023
@roblourens
Copy link
Member

Anything to verify, since it seems the only change this month was stronger code?

@roblourens
Copy link
Member

Oops it loaded the verified label after submitting that comment.

@amunger
Copy link
Contributor

amunger commented Sep 28, 2023

Looks like I'm hitting this still - the endpoint works in desktop, but not for insiders.vscode.dev

server was started with jupyter lab --NotebookApp.allow_origin='*'

image

@amunger amunger reopened this Sep 28, 2023
@amunger amunger added verification-found Issue verification failed and removed verified Verification succeeded labels Sep 28, 2023
@DonJayamanne
Copy link
Contributor

@amunger @rebornix
Please can you test this again with the latest bits

Will need this PR (#14391) and insiders released.

  • Start codespaces
  • Install jupyter in codespaces with python (usual way)
  • Using port forwarding output panel forward the jpyter por (generallllly 8888)
  • Ensure the port is public
  • Copy the URL and ensure the token is also in the url as follows https://jupyter-server-....-8888.app.github.dev/?token=<token>
  • Paste that url into the kernel picker and try again

If this still does not work for local host we can create a separate issue, else this issue never gets resolved (this original issue was to do with a different reason for conections)

@Yoyokrazy Yoyokrazy added verified Verification succeeded and removed verification-found Issue verification failed labels Sep 29, 2023
@Yoyokrazy
Copy link
Contributor Author

Yoyokrazy commented Sep 29, 2023

verified as working with the steps listed above from @DonJayamanne, found issue mentioned below.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug notebook-remote Applies to remote Jupyter Servers verified Verification succeeded
Projects
None yet
6 participants