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

Failed to install/upgrade extensions remotely with "read ECONNRESET" error notification #5848

Closed
hsinyinfu opened this issue Nov 10, 2021 · 9 comments
Assignees
Labels
info-needed Issue requires more information from poster ssh Issue in vscode-remote SSH

Comments

@hsinyinfu
Copy link

  • VSCode Version: 1.62.1
  • Local OS Version: Windows10 20H2 19042.1083
  • Remote OS Version: Ubuntu 18.04.2 LTS
  • Remote Extension/Connection Type: SSH

Steps to Reproduce:

  1. Upgrade VSCode to 1.62.1 version
  2. Open a remote connection to the remote host from remote-ssh extension view container
  3. In the new-opened remote VSCode window, install a new extension or upgrade an existing extension from VSCode Extensions UI
  4. There is an error notification shown in the bottom right with "read ECONNRESET" message and failed to install or upgrade an extension on the remote host

Does this issue occur when you try this locally?: No
Does this issue occur when you try this locally and all extensions are disabled?: No

I have tried and confirmed that both installation and portable 1.61.2 VSCode worked correctly,
but failed to install/upgrade extensions on the remote server in both installation and portable 1.62.1 VSCode.

  • Logs:
    There is no output in the Log(remote extension server) view.
    Below is the logs shown in Log(remote server) view:

[2021-11-10 19:08:55.051] [remoteagent] [info]

[2021-11-10 19:08:55.051] [remoteagent] [info] Extension host agent started.
[2021-11-10 19:08:55.293] [remoteagent] [info] [127.0.0.1][9ba67d80][ManagementConnection] New connection established.
[2021-11-10 19:08:55.310] [remoteagent] [info] [127.0.0.1][73105604][ExtensionHostConnection] New connection established.
[2021-11-10 19:08:55.473] [remoteagent] [info] Deleted from disk ms-toolsai.jupyter-renderers /proj/srv_gerrit/.vscode-server/extensions/ms-toolsai.jupyter-renderers-1.0.3
[2021-11-10 19:08:55.742] [remoteagent] [error] ptyHost was unable to resolve shell environment {}
[2021-11-10 19:08:55.742] [remoteagent] [error] ExtensionHostConnection#buildUserEnvironment resolving shell environment failed {}
[2021-11-10 19:08:55.752] [remoteagent] [info] [127.0.0.1][73105604][ExtensionHostConnection] <17791> Launched Extension Host Process.
[2021-11-10 19:08:55.856] [remoteagent] [error] ExtensionHostConnection#buildUserEnvironment resolving shell environment failed {}
[2021-11-10 19:08:57.187] [remoteagent] [error] ExtensionHostConnection#buildUserEnvironment resolving shell environment failed {}
[2021-11-10 19:08:57.590] [remoteagent] [error] ExtensionHostConnection#buildUserEnvironment resolving shell environment failed {}
[2021-11-10 19:08:57.989] [remoteagent] [error] ExtensionHostConnection#buildUserEnvironment resolving shell environment failed {}
[2021-11-10 19:09:17.677] [remoteagent] [error] RequestService#request resolving shell environment failed {}
[2021-11-10 19:09:17.741] [remoteagent] [error] RequestService#request resolving shell environment failed {}
[2021-11-10 19:09:17.754] [remoteagent] [error] RequestService#request resolving shell environment failed {}
[2021-11-10 19:09:46.635] [remoteagent] [info] [127.0.0.1][9ba67d80][ManagementConnection] The client has disconnected gracefully, so the connection will be disposed.
[2021-11-10 19:09:47.651] [remoteagent] [info] [127.0.0.1][73105604][ExtensionHostConnection] <17791> Extension Host Process exited with code: 0, signal: null.
[2021-11-10 19:09:47.652] [remoteagent] [info] Last EH closed, waiting before shutting down
[2021-11-10 19:11:21.560] [remoteagent] [info] Got delay-shutdown request while in shutdown timeout, delaying
[2021-11-10 19:11:21.561] [remoteagent] [info] Cancelling previous shutdown timeout
[2021-11-10 19:11:21.625] [remoteagent] [info] [127.0.0.1][e7f47583][ManagementConnection] New connection established.
[2021-11-10 19:11:21.626] [remoteagent] [info] [127.0.0.1][1ebc144c][ExtensionHostConnection] New connection established.
[2021-11-10 19:11:21.627] [remoteagent] [error] ExtensionHostConnection#buildUserEnvironment resolving shell environment failed {}
[2021-11-10 19:11:21.633] [remoteagent] [info] [127.0.0.1][1ebc144c][ExtensionHostConnection] <17955> Launched Extension Host Process.
[2021-11-10 19:11:22.714] [remoteagent] [error] ExtensionHostConnection#buildUserEnvironment resolving shell environment failed {}
[2021-11-10 19:11:23.199] [remoteagent] [error] ExtensionHostConnection#buildUserEnvironment resolving shell environment failed {}
[2021-11-10 19:11:23.601] [remoteagent] [error] ExtensionHostConnection#buildUserEnvironment resolving shell environment failed {}
[2021-11-10 19:11:24.112] [remoteagent] [error] ExtensionHostConnection#buildUserEnvironment resolving shell environment failed {}
[2021-11-10 19:11:27.635] [remoteagent] [error] RequestService#request resolving shell environment failed {}
[2021-11-10 19:11:27.646] [remoteagent] [error] RequestService#request resolving shell environment failed {}
[2021-11-10 19:11:42.488] [remoteagent] [error] ExtensionHostConnection#buildUserEnvironment resolving shell environment failed {}
[2021-11-10 19:14:28.396] [remoteagent] [error] RequestService#request resolving shell environment failed {}
[2021-11-10 19:14:28.455] [remoteagent] [error] RequestService#request resolving shell environment failed {}
[2021-11-10 19:14:28.472] [remoteagent] [error] RequestService#request resolving shell environment failed {}
[2021-11-10 19:15:04.047] [remoteagent] [error] RequestService#request resolving shell environment failed {}
[2021-11-10 19:15:04.080] [remoteagent] [error] RequestService#request resolving shell environment failed {}
[2021-11-10 19:15:08.560] [remoteagent] [error] RequestService#request resolving shell environment failed {}
[2021-11-10 19:15:08.671] [remoteagent] [error] RequestService#request resolving shell environment failed {}
[2021-11-10 19:15:36.148] [remoteagent] [error] RequestService#request resolving shell environment failed {}
[2021-11-10 19:15:36.180] [remoteagent] [error] RequestService#request resolving shell environment failed {}
[2021-11-10 19:16:21.562] [remoteagent] [info] New EH opened, aborting shutdown
[2021-11-10 19:20:50.790] [remoteagent] [info] [127.0.0.1][e7f47583][ManagementConnection] The client has disconnected gracefully, so the connection will be disposed.
[2021-11-10 19:20:51.812] [remoteagent] [info] [127.0.0.1][1ebc144c][ExtensionHostConnection] <17955> Extension Host Process exited with code: 0, signal: null.
[2021-11-10 19:20:51.812] [remoteagent] [info] Last EH closed, waiting before shutting down
[2021-11-10 19:22:07.110] [remoteagent] [info] Got delay-shutdown request while in shutdown timeout, delaying
[2021-11-10 19:22:07.111] [remoteagent] [info] Cancelling previous shutdown timeout
[2021-11-10 19:22:07.157] [remoteagent] [info] [127.0.0.1][3bcafff4][ManagementConnection] New connection established.
[2021-11-10 19:22:07.172] [remoteagent] [info] [127.0.0.1][47ebdaae][ExtensionHostConnection] New connection established.
[2021-11-10 19:22:07.175] [remoteagent] [error] ExtensionHostConnection#buildUserEnvironment resolving shell environment failed {}
[2021-11-10 19:22:07.185] [remoteagent] [info] [127.0.0.1][47ebdaae][ExtensionHostConnection] <18774> Launched Extension Host Process.
[2021-11-10 19:22:08.066] [remoteagent] [error] ExtensionHostConnection#buildUserEnvironment resolving shell environment failed {}
[2021-11-10 19:22:08.683] [remoteagent] [error] ExtensionHostConnection#buildUserEnvironment resolving shell environment failed {}
[2021-11-10 19:22:09.090] [remoteagent] [error] ExtensionHostConnection#buildUserEnvironment resolving shell environment failed {}
[2021-11-10 19:22:09.543] [remoteagent] [error] ExtensionHostConnection#buildUserEnvironment resolving shell environment failed {}
[2021-11-10 19:22:15.771] [remoteagent] [error] ExtensionHostConnection#buildUserEnvironment resolving shell environment failed {}
[2021-11-10 19:22:29.602] [remoteagent] [error] RequestService#request resolving shell environment failed {}
[2021-11-10 19:22:29.653] [remoteagent] [error] RequestService#request resolving shell environment failed {}
[2021-11-10 19:22:29.665] [remoteagent] [error] RequestService#request resolving shell environment failed {}

@tanhakabir
Copy link

Seeing this error RequestService#request resolving shell environment failed {} which was related to this bug: microsoft/vscode#136791

We have a fix for this out on VS Code Insiders now and will have the fix out on stable on Thursday. Could you let me know if you still see an issue on VS Code Insiders?

@tanhakabir tanhakabir added ssh Issue in vscode-remote SSH info-needed Issue requires more information from poster labels Nov 10, 2021
@hsinyinfu
Copy link
Author

I just tried on the latest portable insider version (1.63.0-insider), and it still failed to install extensions on the remote host.
This time it showed "Error while installing xxx extension. Please check the log for more details." in the error notification.
And here is what shown in the Log(Window) view:

[2021-11-11 11:07:51.201] [renderer4] [info] Invoking resolveAuthority(ssh-remote)
[2021-11-11 11:07:51.215] [renderer4] [info] Starting extension host with pid 13436.
[2021-11-11 11:07:51.216] [renderer4] [info] [LocalProcessExtensionHost]: IExtensionHostStarter.start() took 13 ms.
[2021-11-11 11:07:51.617] [renderer4] [error] [Extension Host] (node:13436) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use Code - Insiders --trace-deprecation ... to show where the warning was created)
[2021-11-11 11:08:15.489] [renderer4] [info] resolveAuthority(ssh-remote) returned '127.0.0.1:50842' after elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime} ms
[2021-11-11 11:08:45.780] [renderer4] [error] ["Error: read ECONNRESET"," at TLSWrap.onStreamRead (internal/stream_base_commons.js:209:20)"]
[2021-11-11 11:08:45.813] [renderer4] [error] read ECONNRESET: Error: read ECONNRESET
at TLSWrap.onStreamRead (internal/stream_base_commons.js:209:20)

@tanhakabir
Copy link

@alexdima any idea behind [Extension Host] (node:13436) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.?

@alexdima
Copy link
Member

@tanhakabir probably microsoft/vscode#82524 (I just searched our issue tracker for "Buffer.alloc")

@hsinyinfu
Copy link
Author

hsinyinfu commented Nov 11, 2021

I'm not sure if the Buffer() error is the root cause.
The error message seems to be printed only once, when the remote connection and newly opened VSCode window was ready.
I tried to install a "local" extension in the remote VSCode window in 1.62.1 installation version, and it worked well, although the error message still shown in the Log(Window) view.
However, in 1.61.2 VSCode, the Buffer() error message was also printed when the connection was ready, but both the local and remote extensions were all installed correctly.

The steps (Use 1.62.1 installation version):

  1. Open a remote connection VSCode window
  2. Check the Log(Window) view, the Buffer() error message was printed.
[2021-11-11 16:40:54.355] [renderer5] [info] Starting extension host with pid 18232.
[2021-11-11 16:40:54.356] [renderer5] [info] [LocalProcessExtensionHost]: IExtensionHostStarter.start() took 27 ms.
[2021-11-11 16:40:54.735] [renderer5] [error] [Extension Host] (node:18232) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
  1. Install "Debugger for Firefox" extension from the marketplace in the remote VSCode window (This extension would be installed in the local machine instead of the remote one)
  2. The extension were installed successfully on the local machine.
  3. Install "Python" extension from the marketplace in the remote VSCode window (This extension would be installed in the remote server)
  4. Failed, the following error message was printed in Log(Window):
[2021-11-11 11:08:45.780] [renderer4] [error] ["Error: read ECONNRESET"," at TLSWrap.onStreamRead (internal/stream_base_commons.js:209:20)"]
[2021-11-11 11:08:45.813] [renderer4] [error] read ECONNRESET: Error: read ECONNRESET
at TLSWrap.onStreamRead (internal/stream_base_commons.js:209:20)

@tanhakabir tanhakabir self-assigned this Nov 12, 2021
@tanhakabir
Copy link

And I'm guessing this isn't specific to "Debugger for Firefox" vs "Python"? As in they both fail?

I can't seem to reproduce this on my machine.

Would you be able to try these debugging steps? https://stackoverflow.com/questions/63673860/vscode-extension-deprecation-warning-buffer-how-to-diagnose/68413237#68413237

@hsinyinfu
Copy link
Author

hsinyinfu commented Nov 12, 2021

Yes, I think this is not specific to "Debugger for Firefox" and "Python".
I just use the two extensions for testing and as example.

I just tried in the new 1.62.2 version,
and I found that although the Buffer() and read ECONNRESET were still printed in the Log(Window) view,
but no error notification was shown in the bottom right,
and the remote extensions can be downloaded and upgraded.

  • Here is the logs after the remote connection was ready:
    [2021-11-12 10:00:03.652] [renderer4] [info] Starting extension host with pid 16396.
    [2021-11-12 10:00:03.653] [renderer4] [info] [LocalProcessExtensionHost]: IExtensionHostStarter.start() took 26 ms.
    [2021-11-12 10:00:04.038] [renderer4] [error] [Extension Host] (node:16396) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    (Use Code --trace-deprecation ... to show where the warning was created)

  • Here is the logs when I click the "install" button to install a new extension on the remote server:
    [2021-11-12 10:00:35.452] [renderer4] [error] Error while installing 'eg2.vscode-npm-script' extension in the remote server. read ECONNRESET
    [2021-11-12 10:00:35.453] [renderer4] [info] Downloading the 'eg2.vscode-npm-script' extension locally and install
    [2021-11-12 10:00:36.297] [renderer4] [info] Downloaded extension: eg2.vscode-npm-script /c:/Users/MTK236~1.DOM/AppData/Local/Temp/15de6fe8-e109-489d-a6ac-32b688459223
    [2021-11-12 10:00:38.420] [renderer4] [info] Successfully installed 'eg2.vscode-npm-script' extension

I'll do the debugging steps in both 1.62.1 and 1.62.2 to check if anything different and update the results.

@tanhakabir
Copy link

Okay cool! I think with microsoft/vscode#82524 it seems the warnings have been an issue for awhile and can be tracked in that issue. But if it's not blocking that's good!

I close this issue now since it seems like microsoft/vscode#82524 can track the rest.

@tanhakabir
Copy link

Thanks so much for doing all that debugging with us!

@github-actions github-actions bot locked and limited conversation to collaborators Dec 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster ssh Issue in vscode-remote SSH
Projects
None yet
Development

No branches or pull requests

3 participants