Closed boltonidze closed 3 weeks ago
@boltonidze are you using VS Code in your browser?
Yes, that's true. We are deploying it to k8s with Juperyhub. After this the flow is the same as for Jupyterhub - users can open a bowser and run their own servers (pods) with VSCode. The problem is that we have GitHub Pull Request plugin, but when users refresh the page in his browser, they have to re-login to GitHub again.
@TylerLeonhardt do you know why this might happen?
@boltonidze when the user refreshes their page, are they re-connecting to the same container instance or is a fresh container instance?
Also, can you share how you're deploying VS Code and where you are getting it from so we're sure you're using a supported thing?
Also, can you share the server logs? As in, the logs where you are executing the VS Code CLI.
@TylerLeonhardt Users re-connect to the same container (pod), we don't kill it.
Server last logs are below:
[02:06:08] [192.168.200.27][b4da9d4c][ExtensionHostConnection] The client has reconnected.
[02:06:08] [192.168.200.27][ec28d682][ManagementConnection] The client has reconnected.
[02:06:08] [192.168.200.27][1d3bdfcd][ExtensionHostConnection] The client has reconnected.
[02:06:08] [192.168.200.27][88101802][ManagementConnection] The client has reconnected.
[02:22:31] Error: read ETIMEDOUT
at TCP.onStreamRead (node:internal/stream_base_commons:217:20) {
errno: -110,
code: 'ETIMEDOUT',
syscall: 'read'
}
[02:22:31] [192.168.200.27][ec28d682][ManagementConnection] The client has disconnected, will wait for reconnection 3h before disposing...
[02:22:39] Error: read ETIMEDOUT
at TCP.onStreamRead (node:internal/stream_base_commons:217:20) {
errno: -110,
code: 'ETIMEDOUT',
syscall: 'read'
}
[02:22:39] [192.168.200.27][88101802][ManagementConnection] The client has disconnected, will wait for reconnection 3h before disposing...
[05:22:38] [192.168.200.27][ec28d682][ManagementConnection] The reconnection grace time of 3h has expired, so the connection will be disposed.
[05:22:41] [192.168.200.27][b4da9d4c][ExtensionHostConnection] <132127> Extension Host Process exited with code: 0, signal: null.
[05:22:43] [192.168.200.27][1d3bdfcd][ExtensionHostConnection] <132138> Extension Host Process exited with code: 0, signal: null.
[05:22:46] [192.168.200.27][88101802][ManagementConnection] The reconnection grace time of 3h has expired, so the connection will be disposed.
[08:05:56] [192.168.200.27][b4da9d4c][ExtensionHostConnection] Unknown reconnection token (seen before).
[08:05:56] [192.168.200.27][1d3bdfcd][ExtensionHostConnection] Unknown reconnection token (seen before).
[08:06:47] [192.168.200.27][ec28d682][ManagementConnection] Unknown reconnection token (seen before).
[08:06:48] [192.168.200.27][88101802][ManagementConnection] Unknown reconnection token (seen before).
[18:30:13] [192.168.200.27][d34b831c][ManagementConnection] New connection established.
[18:30:13] [192.168.200.27][2b1651d7][ExtensionHostConnection] New connection established.
[18:30:13] [192.168.200.27][2b1651d7][ExtensionHostConnection] <185200> Launched Extension Host Process.
[18:32:05] [192.168.200.27][d34b831c][ManagementConnection] The client has disconnected gracefully, so the connection will be disposed.
[18:32:05] [192.168.200.27][2b1651d7][ExtensionHostConnection] <185200> Extension Host Process exited with code: 0, signal: null.
[18:32:06] [192.168.200.27][06a52610][ManagementConnection] New connection established.
[18:32:06] [192.168.200.27][a7d64611][ExtensionHostConnection] New connection established.
[18:32:06] [192.168.200.27][a7d64611][ExtensionHostConnection] <185421> Launched Extension Host Process.
I opened VSCode at 18:30:13 after long-time of inactivity and logged into GitHub for GitHub Pull Request Plugin. After that I refreshed the page at 18:32:05 and GitHub Pull Request Plugin started asking for login again.
Also, can you share how you're deploying VS Code and where you are getting it from so we're sure you're using a supported thing?
Can you answer this one too? How are you deploying and what are you running exactly to start the server.
@TylerLeonhardt Yes, sure.
We deployed with jupyter-hub helm chart. But we patched the original jupyterhub/k8s-hub:1.2.0 image to redirect to IP-address of pod instead of /user/<_username_>.
We patched it because Configurable http proxy (this is a component of jupyter-hub that proxy different HTTP-connection to different machines depending on the prefix path of input request) changes path in requests from /user/<_username_>/<_something_> -> /<_something_>, but CHP can't change body of HTML-files which can contains something like this
<script async="" src="/user/<_username_>/lab/extensions/catboost-widget/static/remoteEntry.ebd57709384ca584b1c0.js"></script>
The rest of the deployment is the same as for jupyterhub. We use "https://aka.ms/install-vscode-server/setup.sh" script to install vscode inside the contauner. When VSCode server starts, we use the following script to install extensions:
set -eo pipefail
set +x
echo `pwd`
whoami
ls -la
if ! [ -d installed_plugins ]; then
mkdir installed_plugins
fi
if ! [ -f installed_plugins/dbt_ext ]; then
code-server serve-local --install-extension innoverio.vscode-dbt-power-user --verbose --accept-server-license-terms >> installed_plugins/dbt_ext
fi
if ! [ -f installed_plugins/sqlfluff_ext ]; then
code-server serve-local --install-extension dorzey.vscode-sqlfluff --verbose --accept-server-license-terms >> installed_plugins/sqlfluff_ext
fi
if ! [ -f installed_plugins/github_ext ]; then
code-server serve-local --install-extension GitHub.vscode-pull-request-github --verbose --accept-server-license-terms >> installed_plugins/github_ext
fi
and the server itself starts with:
/usr/local/bin/code-server serve-local --accept-server-license-terms --without-connection-token --host 0.0.0.0 --verbose --port 8888
Hi @boltonidze 👋 that code-server
is really old. Now we have this built-in to the code
CLI itself:
https://code.visualstudio.com/blogs/2022/12/07/remote-even-better#_enhanced-code-cli
We should have a working scenario where your secrets are stored properly in the browser so that login persists so please give that a try and let us know how it goes.
This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.
Happy Coding!
Hello!
We deploy our VSCode in k8s with jupyterhub (instead of running jupyterlab we run vscode pod for each user). Pod with vscode lives endless. Everything work fine, but after refresh the page GitHub pull request plugin ask to login again.
I try to understand is it possible to avoid login to GitHub after each page refresh?
In logs I see
But after refresh a page token is missing again: