Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Go tools (gopls) stop working via Remote SSH after update to 0.11.5 #2767

Closed
halega opened this issue Sep 20, 2019 · 15 comments
Closed

Go tools (gopls) stop working via Remote SSH after update to 0.11.5 #2767

halega opened this issue Sep 20, 2019 · 15 comments

Comments

@halega
Copy link

halega commented Sep 20, 2019

I'm using "Remote - SSH" plugin to work on a Go project. I have Windows host and VirtualBox with Ubuntu VM.

Steps to Reproduce:

  1. Open VSCode on Windows, install Remote - SSH plugin and connect to Ubuntu.
  2. Do remote install of Go 0.11.5 and install all Go tools (installation completed sucessfully).
  3. Open any *.go file.

Expected
gopls started on Ubuntu machine and VSCode language features work as expected.

Actual
gopls not started and nothing works: no tooltips, no completion, etc.

Comments
All works with local projects on Windows.
vscode-go 0.11.4 worked in Remote-SSH.

Version: 1.38.1 (user setup)
Commit: b37e54c98e1a74ba89e03073e5a3761284e3ffb0
Date: 2019-09-11T13:35:15.005Z
Electron: 4.2.10
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Windows_NT x64 10.0.18362

gopls version
golang.org/x/tools/gopls v0.1.7
golang.org/x/tools/gopls@v0.1.7 h1:YwKf8t9h69++qCtVmc2q6fVuetFXmmu9LKoPMYLZid4=

golang-vo version 0.11.5

@halega
Copy link
Author

halega commented Sep 20, 2019

Reverted remote vscode-go to 0.11.4. All works again.

@stamblerre
Copy link
Contributor

Thank you for the issue report. @1yefuwang1 and @enix223, I'll continue the discussion of #2768 here. Can you add a bit more information about your remote machines?

@ramya-rao-a: Are you aware of any tools for debugging extensions running remotely? My best idea right now is that I can add some more debug logging to my version of the extension, package a new .vsix file, and ask someone to install it remotely and inspect the logs.

@stamblerre
Copy link
Contributor

Well, FWIW, I added a few log statements and rebuilt the extension on my fork (https://github.com/stamblerre/vscode-go/blob/master/Go-0.11.5.vsix). If you can download this file onto your remote machine, go to the Extensions menu and click the "..." in the top right corner, you will see the "Install from VSIX" option. If you select Go-0.11.5.vsix file I linked, you'll get the version of the extension with log statements. After reloading the VSCode window, you should see some logs from the extension (you can look at them using "View: Toggle Developer Tools"). If you could share those logs, that might at least help us begin understanding the problem.

@halega
Copy link
Author

halega commented Sep 20, 2019

For clean setup I created a VM with Ubuntu Server 18.04.4 in the cloud (any VPS provider is fine). Installed Go and connect to it from VSCode via Remote - SSH from Windows machine. Install remote Go 0.11.5 and gopls. And it doesn't work. Downgraded to the version 0.11.4 and it start working.

@stamblerre I'll try your build.

@roblourens
Copy link
Member

You can actually debug a remote extension similarly to how they are debugged locally in the Extension Development Host. Clone the extension to the remote host and open that folder with the Remote-SSH extension. Then the extension debug launch config should work as normal.

@halega
Copy link
Author

halega commented Sep 21, 2019

Here's log.

10.64.48.17:8080 - it's our corporate HTTP proxy server.

 ERR read ECONNRESET: Error: read ECONNRESET
	at TCP.onStreamRead (internal/stream_base_commons.js:111:27)
console.ts:137 [Extension Host] rejected promise not handled within 1 second: Error: connect ETIMEDOUT 10.64.48.17:8080
mainThreadExtensionService.ts:64 [[object Object]]connect ETIMEDOUT 10.64.48.17:8080
mainThreadExtensionService.ts:65 Error: connect ETIMEDOUT 10.64.48.17:8080
	at Request.request [as _callback] (/home/aws/.vscode-server/extensions/ms-vscode.go-0.11.5/node_modules/web-request/index.js:61)
	at self.callback (/home/aws/.vscode-server/extensions/ms-vscode.go-0.11.5/node_modules/request/request.js:185)
	at Request.emit (events.js:182)
	at Request.onRequestError (/home/aws/.vscode-server/extensions/ms-vscode.go-0.11.5/node_modules/request/request.js:881)
	at ClientRequest.emit (events.js:187)
	at onerror (/home/aws/.vscode-server/bin/b37e54c98e1a74ba89e03073e5a3761284e3ffb0/node_modules/agent-base/index.js:100)
	at callbackError (/home/aws/.vscode-server/bin/b37e54c98e1a74ba89e03073e5a3761284e3ffb0/node_modules/agent-base/index.js:122)
	at process._tickCallback (internal/process/next_tick.js:68)

On a computer outside corporate network vscode-go 0.11.5 works.

@halega
Copy link
Author

halega commented Sep 21, 2019

Figured out that plugin 0.11.5 stop working after updating gopls to v0.1.7. It works with previous version (version v0.1.6-cmd.gopls, built in $GOPATH mode). And Go plugin 0.11.5 successfully detect of older version of gopls:

image

Steps to reproduce:

  1. Remove gopls on remote Linux host.
  2. Install Go 0.11.4 and install gopls.
  3. Reload VSCode and open remote Go project.
    • gopls works (version v0.1.6-cmd.gopls, built in $GOPATH mode)
  4. Update Go plugin to 0.11.5 and reload VSCode.
    • gopls works (version v0.1.6-cmd.gopls, built in $GOPATH mode)
    • Plugin detects that there's outdated version of gopls and asks to update.
  5. Click 'Update'. And reload VSCode.
    • gopls stop working (golang.org/x/tools/gopls v0.1.7)
    • logs contains errors (see above)

It seems that Go 0.11.5 only doesn't work with gopls v0.1.7 when there's a proxy.

@stamblerre
Copy link
Contributor

Are you seeing this behavior with the new beta version of the extension that Ramya pushed (https://github.com/microsoft/vscode-go/releases/tag/latest)? There really shouldn't be anything with gopls v0.1.7 that would change the behavior of VSCode-Go (it only contained a few minor bug fixes).

@halega
Copy link
Author

halega commented Sep 21, 2019

0.11.6-beta.1 also doesn't work.

I see that there're outgoing connections to the corporate proxy from inside VM in VirtualBox:

image

When I use VM with Linux as remote machine in the cloud (that is outside of corporate network where there's a proxy), it tries to connect to the proxy host from VM anyway. I see the same errors in log:

mainThreadExtensionService.ts:65 Error: getaddrinfo ENOTFOUND hqproxy...

@halega
Copy link
Author

halega commented Sep 21, 2019

No, after some timeout 0.11.6-beta.1 start working:

In logs:

Unable to determine latest gopls version: Error: connect ETIMEDOUT 10.64.48.17:8080

@halega
Copy link
Author

halega commented Sep 21, 2019

Yes, 0.11.6-beta.1 works with gopls v0.1.7 (need to wait some timeout until connection to the proxy fail). Thanks a lot!

P.S. It's still strage that remote plugin on linux uses proxy settings from Windows host. Proxy has domain authentication that's why it fails on linux host in VirtualBox (or in the cloud where there's no proxy at all).
And why there's no problem with gopls v0.1.6?

@kidlj
Copy link

kidlj commented Sep 21, 2019

I got this error output in Log(window) with go-extension 0.11.5:

[2019-09-21 15:22:42.293] [renderer1] [error] Bad progress location: workbench.view.remote: Error: Bad progress location: workbench.view.remote
    at Proxy.withProgress (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:5216:256)
    at $.t.instantiationService.createInstance.e [as withProgress] (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:4886:700)
    at $.getChildren (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:4892:195)
    at X.<anonymous> (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1026:201)
    at Generator.next (<anonymous>)
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:35:566
    at new Promise (<anonymous>)
    at n (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:35:343)
    at a.createCancelablePromise (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1026:138)
    at Object.l [as createCancelablePromise] (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:128:804)
    at X.doGetChildren (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1026:110)
    at X.<anonymous> (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1025:740)
    at Generator.next (<anonymous>)
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:35:566
    at new Promise (<anonymous>)
    at n (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:35:343)
    at X.doRefreshNode (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1025:527)
    at X.<anonymous> (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1025:385)
    at Generator.next (<anonymous>)
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:35:566
    at new Promise (<anonymous>)
    at n (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:35:343)
    at X.doRefreshSubTree (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1025:316)
    at X.<anonymous> (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1025:163)
    at Generator.next (<anonymous>)
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:35:566
    at new Promise (<anonymous>)
    at n (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:35:343)
    at X.refreshNode (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1024:971)
    at X.<anonymous> (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1024:731)
    at Generator.next (<anonymous>)
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:35:566
    at new Promise (<anonymous>)
    at n (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:35:343)
    at X.refreshAndRenderNode (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1024:684)
    at X.<anonymous> (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1022:62)
    at Generator.next (<anonymous>)
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:35:566
    at new Promise (<anonymous>)
    at n (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:35:343)
    at X.updateChildren (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1021:821)
    at Promise.all.Array.from.map.e (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:4891:237)
    at Array.map (<anonymous>)
    at K.<anonymous> (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:4891:228)
    at Generator.next (<anonymous>)
    at file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:35:566
    at new Promise (<anonymous>)
    at n (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:35:343)
    at K.doRefresh (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:4891:8)
    at K._register.themeService.onDidFileIconThemeChange (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:4883:666)
    at d.fire (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:107:468)
    at V.doSetFileIconTheme (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:4622:717)
    at e (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:4621:711)
    at R (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:4611:724)
    at i.ensureLoaded.then.e (file:///Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:4621:698)

@kidlj
Copy link

kidlj commented Sep 21, 2019

From Developer Tools view I got this. It seems to connect to an internet address to determine something, if this is the reason of gopls not starting, I'm sorry to say that, almost every google/github/golang.org/aws/azure server is blocked in China.

image

@ramya-rao-a
Copy link
Contributor

Thanks @halega & @kidlj

@kidlj For the time being, can try the latest beta version? It has the fix to not block the starting of the language server when failing to connect to the proxy.

@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Sep 21, 2019

Hello all,

I have just released an update(0.11.6) where we have replaced the outgoing call with known hard-coded value of the latest version for gopls. This should fix the problem reported here.

I have logged an issue #2776 to discuss next steps on how to make this check better, please feel free to provide your thoughts there.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants