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

[BUG] Infinity token-authenticated request when connected to remote jupyter server #13345

Closed
1 of 2 tasks
Tracked by #12832
zthxxx opened this issue Apr 18, 2023 · 11 comments
Closed
1 of 2 tasks
Tracked by #12832
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster notebook-remote Applies to remote Jupyter Servers

Comments

@zthxxx
Copy link

zthxxx commented Apr 18, 2023

Applies To

  • Notebooks (.ipynb files)
  • Interactive Window and/or Cell Scripts (.py files with #%% markers)

What happened?

When open .ipynb project in VSCode with connected to exist remote jupyter server like jupyter/scipy-notebook,

the VSCode Jupyter extension will cause infinity "token-authenticated request" to jupyter, and can see huge amount of the same messages in logs, even if the .ipynb file or project has been closed, only can be stop by quit or restart VSCode:

...
[I 2023-03-24 05:12:15.820 ServerApp] Generating new user for token-authenticated request: 9da819445a07428ba5b07d4361b37592
[I 2023-03-24 05:12:21.037 ServerApp] Generating new user for token-authenticated request: 331a45f6cce5460687f11897db9e9769
[I 2023-03-24 05:12:26.257 ServerApp] Generating new user for token-authenticated request: fee1b282a03d4b2692cf84019e720206
[I 2023-03-24 05:12:31.461 ServerApp] Generating new user for token-authenticated request: e9f3d5afb7414411bb89f3bdf33db921
[I 2023-03-24 05:12:36.696 ServerApp] Generating new user for token-authenticated request: e37235f5281345478aba2f54432de69a
[I 2023-03-24 05:12:41.896 ServerApp] Generating new user for token-authenticated request: 1d9fdf97ba47469bbdac043b061d76cd
[I 2023-03-24 05:12:47.096 ServerApp] Generating new user for token-authenticated request: 2775f602543e4e91a7b166a48841e8c5
...

After debug by many people work with Jupyter itself, it's seems an issue with VSCode, not with Jupiter Server.

link issues:

VS Code Version

Version: 1.77.3

Jupyter Extension Version

v2023.3.1201040234

Jupyter logs

...
[I 2023-03-24 05:12:15.820 ServerApp] Generating new user for token-authenticated request: 9da819445a07428ba5b07d4361b37592
[I 2023-03-24 05:12:21.037 ServerApp] Generating new user for token-authenticated request: 331a45f6cce5460687f11897db9e9769
[I 2023-03-24 05:12:26.257 ServerApp] Generating new user for token-authenticated request: fee1b282a03d4b2692cf84019e720206
[I 2023-03-24 05:12:31.461 ServerApp] Generating new user for token-authenticated request: e9f3d5afb7414411bb89f3bdf33db921
[I 2023-03-24 05:12:36.696 ServerApp] Generating new user for token-authenticated request: e37235f5281345478aba2f54432de69a
[I 2023-03-24 05:12:41.896 ServerApp] Generating new user for token-authenticated request: 1d9fdf97ba47469bbdac043b061d76cd
[I 2023-03-24 05:12:47.096 ServerApp] Generating new user for token-authenticated request: 2775f602543e4e91a7b166a48841e8c5
[I 2023-03-24 05:12:52.348 ServerApp] Generating new user for token-authenticated request: c4b3a0eab9e34ef0b2e09de1c38db603
[I 2023-03-24 05:12:57.545 ServerApp] Generating new user for token-authenticated request: 6d1cdbaac5c247719aa2ea5c2cac4ca9
[I 2023-03-24 05:13:02.759 ServerApp] Generating new user for token-authenticated request: c84253281c3147c2990d7ba7359b93bb
[I 2023-03-24 05:13:07.959 ServerApp] Generating new user for token-authenticated request: f186b1d4966d4bf886dec3d9f5844ffa
[I 2023-03-24 05:13:13.188 ServerApp] Generating new user for token-authenticated request: 64fcc05713fa441eb9b3bcad5281433c
[I 2023-03-24 05:13:18.384 ServerApp] Generating new user for token-authenticated request: 224e24f08a654dc390ffa2696861caa1
[I 2023-03-24 05:13:23.601 ServerApp] Generating new user for token-authenticated request: aa3bef1b7b004e83889741a0ac3c7158
[I 2023-03-24 05:13:28.808 ServerApp] Generating new user for token-authenticated request: f255c769aa304de2b1a41b9aabbdbd44
[I 2023-03-24 05:13:34.014 ServerApp] Generating new user for token-authenticated request: fa7abb6e35eb42cba3c6e642d18cea6f
[I 2023-03-24 05:13:39.215 ServerApp] Generating new user for token-authenticated request: 46d7ac3d6fff4880a26d0873587dd155
[I 2023-03-24 05:13:44.419 ServerApp] Generating new user for token-authenticated request: 6d23b2e4c9524ea78d7821b3a47f8db2
[I 2023-03-24 05:13:49.624 ServerApp] Generating new user for token-authenticated request: 5405124b3b3244c3bcb0aed218d3277b
...

Coding Language and Runtime Version

Python 3.10.10

Language Extension Version (if applicable)

No response

Anaconda Version (if applicable)

No response

Running Jupyter locally or remotely?

Remote

@zthxxx zthxxx added the bug Issue identified by VS Code Team member as probable bug label Apr 18, 2023
@DonJayamanne DonJayamanne added the notebook-remote Applies to remote Jupyter Servers label Apr 18, 2023
@DonJayamanne
Copy link
Contributor

Thanks for filing this issue, and sorry you are running into this, I will look into this shortly

@DonJayamanne
Copy link
Contributor

Temporary work around

From here jupyter-server/jupyter_server#1245 (comment)

In case somebody from the VSCode looks at this, one theory about what's happening is that when the user is presented with the challenge/response for authentication, the extension holds on to the cookies generated by the server, but when the extension receives a valid response by passing in the token, the extension might not be respecting the sessions cookies set by the server.

So for end users who experience this behavior, the current workaround is to not pass the URL containing the token to VSCode and instead allow the extension to ask them for it – until this issue is resolved upstream.

@DonJayamanne
Copy link
Contributor

@zthxxx please could you provide the steps to repro this issue,

  • Is this in a docker container,
  • are you running jupyter or jupyter lab,
  • What version of Jupyter/jupyter lab are you using
  • It would be great if you could provide all the instructions so we have the same setup (making it easier to repro this issue)
  • Optionally can you provide a docker file

@zthxxx
Copy link
Author

zthxxx commented Apr 19, 2023

@DonJayamanne

  • Is this in a docker container? yes
  • are you running jupyter or jupyter lab? jupyter-lab
  • What version of Jupyter/jupyter lab are you using jupyter/scipy-notebook:latest b1d74c390631
  • Optionally can you provide a docker file? yes

I use docker-compose, that's all my configuration to reproduce

# docker-compose.yml

version: '3.8'

services:
  jupyter-lab:
    # https://jupyter-docker-stacks.readthedocs.io/en/latest/using/selecting.html#jupyter-scipy-notebook
    # https://hub.docker.com/r/jupyter/scipy-notebook
    image: jupyter/scipy-notebook
    container_name: jupyter-lab
    restart: unless-stopped
    environment:
      - GRANT_SUDO=true
      - JUPYTER_TOKEN=${JUPYTER_TOKEN}
    user: root
    ports:
      - 8888:8888
    volumes:
      - ./notebooks:/home/jovyan/notebooks

@DonJayamanne
Copy link
Contributor

@zthxxx are you still running into this issue
I believe we have addressed this issue
Please ensure you have the latest version of VS Code and latest version of Jupyter extension

I use docker-compose, that's all my configuration to reproduce

thanks for the docker file, I have tested this at my end and am unable to repro this issue

Please feel free to re-open this issue or create a new one if this issue persists.

@zthxxx
Copy link
Author

zthxxx commented Jul 20, 2023

Thanks! I'll give it a spin on my local machine.

@zthxxx
Copy link
Author

zthxxx commented Jul 21, 2023

@DonJayamanne Hi, seems like I'm still encountering the same problem. I'm using the pre-release version of the Jupyter VSCode Extension (v2023.7.1001901100).

I'm only open on a project that doesn't involve Notebooks, just Python files.

Same environment I use as below, with jupyter-lab token url (https://my-domain-of-jupyter/?token=xxxxx) as Jupyter Server for Jupyter VSCode Extension

image

When I open the project that doesn't involve Notebooks, the logs(on the left) appear several times, but they don't log indefinitely.

However, when I open just a single .ipynb file in VSCode, it results in infinite logging on my server, even though I'm connected with the Jupyter Extension and I'm not opening more than one file.

@DonJayamanne DonJayamanne reopened this Jul 22, 2023
@DonJayamanne
Copy link
Contributor

Please could you enable logging as follows:

  • Open settings & go into Jupyter->Logging
  • Change the value to verbose
  • Reload VS Code,
  • Attempt to repro the issue & then copy the output from the Jupyter output panel.

I'd like to see what is happening in Jupyter Extension that could be causing these requests

@zthxxx
Copy link
Author

zthxxx commented Jul 24, 2023

@DonJayamanne Thank you, here is the logging after I repro the issue.

vscode-jupyter-13345-230724.log

and my steps here:

  • Open the project that doesn't involve Notebooks, then open a python file
  • Open a notebook project, then open the .ipynb file
  • Run a cell in .ipynb, follow the toast guide of Jupyter Extension to connect the Existing Jupyter Server
  • Reproduced, then do nothing in this project

@DonJayamanne
Copy link
Contributor

@zthxxx a few fixes have gone into the extension in this space.
Please can you install the latest version of VS Code and Jupyter extension and let me know if this still exists.

@DonJayamanne DonJayamanne added the info-needed Issue requires more information from poster label Sep 8, 2023
@DonJayamanne
Copy link
Contributor

Closing this issue as its been over 4 weeks, since the information was requested.
We'll be happy to reopen the issue when the requested information has been provided.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 12, 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 info-needed Issue requires more information from poster notebook-remote Applies to remote Jupyter Servers
Projects
None yet
Development

No branches or pull requests

3 participants