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

VS Code Extension crashes with modified hosts file #3135

Closed
pinguin999 opened this issue Feb 8, 2021 · 5 comments
Closed

VS Code Extension crashes with modified hosts file #3135

pinguin999 opened this issue Feb 8, 2021 · 5 comments
Labels
Milestone

Comments

@pinguin999
Copy link

Describe the bug
The VS Code Extension crash on start. With his error:

events.js:292 throw er; // Unhandled 'error' event ^[Error: connect ECONNREFUSED 0.0.0.0:443 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)Emitted 'error' event on ClientRequest instance at: at TLSSocket.socketErrorListener (_http_client.js:426:9) at TLSSocket.emit (events.js:315:20) at emitErrorNT (internal/streams/destroy.js:92:8) at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) at processTicksAndRejections (internal/process/task_queues.js:84:21)] { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '0.0.0.0', port: 443}

To Reproduce
Steps to reproduce the behavior:

  1. Install https://winhelp2002.mvps.org/hosts2.htm host file
  2. Open a Flutter Project in VS Code -> Crash

Expected behavior
No Crash ^^

Versions (please complete the following information):

  • VS Code version: Version: 1.53.0
    Commit: 8490d3dde47c57ba65ec40dd192d014fd2113496
    Date: 2021-02-03T16:01:04.046Z (5 days ago)
    Electron: 11.2.1
    Chrome: 87.0.4280.141
    Node.js: 12.18.3
    V8: 8.7.220.31-electron.0
    OS: Darwin x64 20.3.0
  • Dart extension version: 3.19.2
  • Dart/Flutter SDK version: VS Code Flutter version 3.19.0
    Flutter 1.22.6 • channel stable • https://github.com/flutter/flutter.git
    Framework • revision 9b2d32b605 (2 weeks ago) • 2021-01-22 14:36:39 -0800
    Engine • revision 2f0af37152
    Tools • Dart 2.10.5
@DanTup
Copy link
Member

DanTup commented Feb 8, 2021

When you say crash, are you seeing something more than this just being listed in the Developer Tools Console? This is likely the analytics request failing (you can disable this entirely with the "Dart: Allow Analytics" setting in your VS Code user settings), but it shouldn't cause any issues beyond an error being printed (although I can't actually repro that on macOS right now).

If you're seeing other things failing, could you describe exactly what, or attach a screenshot showing what's not working?

Thanks!

@DanTup DanTup added the awaiting info Requires more information from the customer to progress label Feb 8, 2021
@pinguin999
Copy link
Author

pinguin999 commented Feb 8, 2021

Hi @DanTup thanks, that looks like it's working.

The error only shows the "Extension host terminated unexpectedly." pop-up.
Maybe add a try/catch around analytics.

Here is my full console log:
´´´

Some messages have been moved to the Issues panel.
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1747 Overwriting grammar scope name to file mapping for scope source.sql.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/sql/syntaxes/sql.tmLanguage.json.
New grammar file: file:///Users/pinguin/.vscode/extensions/ms-mssql.mssql-1.10.1/syntaxes/SQL.plist
register @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1747
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1747 Overwriting grammar scope name to file mapping for scope source.yaml.
Old grammar file: file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/extensions/yaml/syntaxes/yaml.tmLanguage.json.
New grammar file: file:///Users/pinguin/.vscode/extensions/redhat.vscode-yaml-0.14.0/syntaxes/yaml.tmLanguage.json
register @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1747
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Congratulations, your extension "git tags" is now active!
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Monkey Patch is active.
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Application Directory: /Applications/Visual Studio Code.app/Contents/Resources/app/out
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] Application Main CSS: /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.main.css
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] tags refreshed with remote
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:618 ERR connect ECONNREFUSED 0.0.0.0:443: Error: connect ECONNREFUSED 0.0.0.0:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:60 [Extension Host] swdc-vscode: Loaded softwaredotcom.swdc-vscode v2.4.7
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1734 Extension host terminated unexpectedly. Code: 1 Signal: null
_onExtensionHostCrashed @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1734
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:618 ERR Extension host terminated unexpectedly. The following extensions were running: vscode.microsoft-authentication, mechatroner.rainbow-csv, vscode.configuration-editing, vscode.json-language-features, vscode.typescript-language-features, vscode.debug-auto-launch, vscode.git, 2gua.rainbow-brackets, howardzuo.vscode-git-tags, iocave.monkey-patch, spikespaz.vscode-smoothtype, vadimcn.vscode-lldb, voldemortensen.rainbow-tags, vscode.github, iocave.customize-ui, Dart-Code.dart-code, ms-vscode.js-debug, Dart-Code.flutter, vscode.emmet, vscode.merge-conflict, vscode.testing-editor-contributions, ms-vscode-remote.remote-containers, ms-vscode-remote.remote-wsl, softwaredotcom.swdc-vscode, vscode.github-authentication
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:738 Extension host terminated unexpectedly.
onDidChangeNotification @ /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:738
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:618 ERR Error: No authentication provider 'github' is currently registered.
at s.getSessions (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1550)
at async hi.getAccounts (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1891)
at async hi.update (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1891)
at async hi.initialize (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1891)
at async hi.waitAndInitialize (/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1891)
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:618 WARN Settings Sync: Accounts are not initialized
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:618 ERR No authentication provider 'github' is currently registered.: Error: No authentication provider 'github' is currently registered.
at s.getSessions (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1550:8969)
at async o (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1837:4861)
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2658 Extension Host
/Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2658 events.js:292 throw er; // Unhandled 'error' event ^[Error: connect ECONNREFUSED 0.0.0.0:443 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)Emitted 'error' event on ClientRequest instance at: at TLSSocket.socketErrorListener (_http_client.js:426:9) at TLSSocket.emit (events.js:315:20) at emitErrorNT (internal/streams/destroy.js:92:8) at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) at processTicksAndRejections (internal/process/task_queues.js:84:21)] { errno: 'ECONNREFUSED', code: 'ECONNREFUSED', syscall: 'connect', address: '0.0.0.0', port: 443}

´´´

If you need any more informations I am happy to help.

@DanTup
Copy link
Member

DanTup commented Feb 9, 2021

There is already error handling around analytics, so I'm not sure why it's being logged like this. I'll test it out on Windows to see if I can repro and improve (and perhaps also disable analytics for a session after a number of failures).

@DanTup DanTup added this to the v3.20.0 milestone Feb 9, 2021
@DanTup DanTup removed the awaiting info Requires more information from the customer to progress label Feb 9, 2021
@DanTup DanTup closed this as completed in 29f32e0 Feb 17, 2021
@DanTup
Copy link
Member

DanTup commented Feb 17, 2021

I was still unable to repro this on either macOS or Windows, however I was able to hook an additional error handler that wasn't being caught before. If the unhandled error was for some reason causing your extension host to terminate (something nodejs has been threatening to do for a while, though didn't seem to be occurring for me) this should resolve it.

I also made analytics disable for the whole session upon any error, so if they are blocked or there's no connection, it won't keep trying to send them for the session.

@pinguin999
Copy link
Author

Sounds good. Can you ping me here when the update is live. So I can give you feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants