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

Go devfile LS Not working without updating Go language server plugin to the experimental version. #16113

Closed
5 of 23 tasks
ScrewTSW opened this issue Feb 24, 2020 · 25 comments
Closed
5 of 23 tasks
Labels
area/languages Issues related to Language extensions or plugins integration. kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.

Comments

@ScrewTSW
Copy link
Member

ScrewTSW commented Feb 24, 2020

Describe the bug

Go devfile is showing notification about updating the version of Go vsix plugin and a warning regarding development tools missing in the path installation.

Che version

7.9.0-SNAPSHOT

  • latest
  • nightly
  • other: please specify

Steps to reproduce

  • Open a Go getting started devfile
  • Open any .go script
  • Next to the notifications in the bottom bar on a right side you will see a notification about missing development tools and outdated plugin

Expected behavior

No errors/warnings are present

Runtime

  • kubernetes (include output of kubectl version)
  • Openshift (include output of oc version) 4.3, 4.2
  • minikube (include output of minikube version and kubectl version)
  • minishift (include output of minishift version and oc version)
  • docker-desktop + K8S (include output of docker version and kubectl version)
  • other: (please specify)

Screenshots

Screenshot_20200255_161009_closeup

image

Installation method

  • chectl -a operator -p openshift --ssl --self-signed-cert
  • che-operator
  • minishift-addon
  • I don't know

Environment

  • my computer
    • Windows
    • Linux
    • macOS
  • Cloud
    • Amazon
    • Azure
    • GCE
    • other (please specify) ocp42.codereadyqe.com
  • other: please specify
@ScrewTSW ScrewTSW added the kind/bug Outline of a bug - must adhere to the bug report template. label Feb 24, 2020
@che-bot che-bot added the status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. label Feb 24, 2020
@ibuziuk ibuziuk added severity/P2 Has a minor but important impact to the usage or development of the system. area/languages Issues related to Language extensions or plugins integration. team/languages and removed status/need-triage An issue that needs to be prioritized by the curator responsible for the triage. See https://github. labels Feb 24, 2020
@ibuziuk
Copy link
Member

ibuziuk commented Feb 24, 2020

@ScrewTSW how this affects UX with Go, other than warning?

@tolusha
Copy link
Contributor

tolusha commented Feb 25, 2020

It is interesting to check Go LS features if they still work.

@ScrewTSW
Copy link
Member Author

@ibuziuk @tolusha No. The error highlighting and code completion only work once the GO.vsix plugin is updated. But even after updating the vsix plugin, the toolchain is saying that the binary is missing.

@ScrewTSW
Copy link
Member Author

ScrewTSW commented Feb 25, 2020

Strange thing is that it's a one-time thing per deployment.
Once you do the update through theia, the stacks always work correctly - with the updated plugin the error highlighting and code completion works correctly.

I will try to reinstall che again and capture a screenshot of the message.

@ibuziuk ibuziuk added severity/P1 Has a major impact to usage or development of the system. and removed severity/P2 Has a minor but important impact to the usage or development of the system. labels Feb 25, 2020
@ibuziuk
Copy link
Member

ibuziuk commented Feb 25, 2020

Setting P1 after discussion with Tibor, looks like Go devfile is broken atm

@ScrewTSW
Copy link
Member Author

Pre update:
Screenshot_20200225_161507
Screenshot_20200225_161009
Update log:

Installing 1 tool at /go/bin
  gopls
Starting building the current package at /projects/src/github.com/golang/example/outyet
Not able to determine import path of current package by using cwd: /projects/src/github.com/golang/example/outyet and Go workspace: /projects/src
Starting building the current package at /projects/src/github.com/golang/example/outyet
Not able to determine import path of current package by using cwd: /projects/src/github.com/golang/example/outyet and Go workspace: /projects/src
Installing golang.org/x/tools/cmd/gopls FAILED
1 tools failed to install.
gopls:
Error: Command failed: /usr/local/go/bin/go get -u -v golang.org/x/tools/cmd/gopls
Fetching https://golang.org/x/tools/cmd/gopls?go-get=1
https fetch failed: Get https://golang.org/x/tools/cmd/gopls?go-get=1: x509: certificate signed by unknown authority
package golang.org/x/tools/cmd/gopls: unrecognized import path "golang.org/x/tools/cmd/gopls" (https fetch: Get https://golang.org/x/tools/cmd/gopls?go-get=1: x509: certificate signed by unknown authority)
Fetching https://golang.org/x/tools/cmd/gopls?go-get=1
https fetch failed: Get https://golang.org/x/tools/cmd/gopls?go-get=1: x509: certificate signed by unknown authority
package golang.org/x/tools/cmd/gopls: unrecognized import path "golang.org/x/tools/cmd/gopls" (https fetch: Get https://golang.org/x/tools/cmd/gopls?go-get=1: x509: certificate signed by unknown authority)
Installing golang.org/x/tools/cmd/gopls FAILED
1 tools failed to install.
gopls:
Error: Command failed: /usr/local/go/bin/go get -u -v golang.org/x/tools/cmd/gopls
Fetching https://golang.org/x/tools/cmd/gopls?go-get=1
https fetch failed: Get https://golang.org/x/tools/cmd/gopls?go-get=1: x509: certificate signed by unknown authority
package golang.org/x/tools/cmd/gopls: unrecognized import path "golang.org/x/tools/cmd/gopls" (https fetch: Get https://golang.org/x/tools/cmd/gopls?go-get=1: x509: certificate signed by unknown authority)
Fetching https://golang.org/x/tools/cmd/gopls?go-get=1
https fetch failed: Get https://golang.org/x/tools/cmd/gopls?go-get=1: x509: certificate signed by unknown authority
package golang.org/x/tools/cmd/gopls: unrecognized import path "golang.org/x/tools/cmd/gopls" (https fetch: Get https://golang.org/x/tools/cmd/gopls?go-get=1: x509: certificate signed by unknown authority)
Installing golang.org/x/tools/cmd/gopls FAILED
1 tools failed to install.
gopls:
Error: Command failed: /usr/local/go/bin/go get -u -v golang.org/x/tools/cmd/gopls
Fetching https://golang.org/x/tools/cmd/gopls?go-get=1
https fetch failed: Get https://golang.org/x/tools/cmd/gopls?go-get=1: x509: certificate signed by unknown authority
package golang.org/x/tools/cmd/gopls: unrecognized import path "golang.org/x/tools/cmd/gopls" (https fetch: Get https://golang.org/x/tools/cmd/gopls?go-get=1: x509: certificate signed by unknown authority)
Fetching https://golang.org/x/tools/cmd/gopls?go-get=1
https fetch failed: Get https://golang.org/x/tools/cmd/gopls?go-get=1: x509: certificate signed by unknown authority
package golang.org/x/tools/cmd/gopls: unrecognized import path "golang.org/x/tools/cmd/gopls" (https fetch: Get https://golang.org/x/tools/cmd/gopls?go-get=1: x509: certificate signed by unknown authority)
Installing golang.org/x/tools/cmd/gopls FAILED
1 tools failed to install.
gopls:
Error: Command failed: /usr/local/go/bin/go get -u -v golang.org/x/tools/cmd/gopls
Fetching https://golang.org/x/tools/cmd/gopls?go-get=1
https fetch failed: Get https://golang.org/x/tools/cmd/gopls?go-get=1: x509: certificate signed by unknown authority
package golang.org/x/tools/cmd/gopls: unrecognized import path "golang.org/x/tools/cmd/gopls" (https fetch: Get https://golang.org/x/tools/cmd/gopls?go-get=1: x509: certificate signed by unknown authority)
Fetching https://golang.org/x/tools/cmd/gopls?go-get=1
https fetch failed: Get https://golang.org/x/tools/cmd/gopls?go-get=1: x509: certificate signed by unknown authority
package golang.org/x/tools/cmd/gopls: unrecognized import path "golang.org/x/tools/cmd/gopls" (https fetch: Get https://golang.org/x/tools/cmd/gopls?go-get=1: x509: certificate signed by unknown authority)
/projects/src/github.com/golang/example/outyet>Finished running tool: /usr/local/go/bin/go build -o /tmp/vscode-goPfiPhe/go-code-check .
/projects/src/github.com/golang/example/outyet/main.go:20: syntax error: non-declaration statement outside function body
/projects/src/github.com/golang/example/outyet>Finished running tool: /usr/local/go/bin/go build -o /tmp/vscode-goPfiPhe/go-code-check .
/projects/src/github.com/golang/example/outyet/main.go:20: syntax error: non-declaration statement outside function body

After "Reload"
Screenshot_20200225_161826
Screenshot_20200225_161736

@ScrewTSW ScrewTSW changed the title Go devfile showing warnings about missing development tools on PATH Go devfile Not working without updating Go language server to the experimental version. Feb 25, 2020
@JPinkney
Copy link
Contributor

I thought a solution to this might be setting the che go plugin preference go.useLanguageServer: true in the devfile (it would get rid of the popup) but for some reason the golang language server features only work on the first go file opened (which is an issue in itself regardless)

@amisevsk
Copy link
Contributor

From my experience with this plugin on the vscode side, gopls leaves a lot to be desired but is required for module projects, so should be enabled by default in the plugin if possible.

Which analysis tools are missing? They should be added to the go sidecar, since /go is not persisted.

@ScrewTSW
Copy link
Member Author

ScrewTSW commented Feb 26, 2020

@amisevsk I think it was refering to gopls as a missing tool from the toolchain

@amisevsk
Copy link
Contributor

@ScrewTSW gopls is only required when the "experimental" language server is enabled; since the analysis tools popup appears before it's enabled, it suggests that something else is missing. If you get the notification again, it should output which analysis tools its installing.

Either way, I'm +1 on adding gopls to the golang sidecar.

@JPinkney
Copy link
Contributor

JPinkney commented Feb 26, 2020

I just tried on che.openshift.io and it looks like the problem is that it's missing golangci-lint. I'm guessing this issue was introduced when the preference was changed in the devfile? https://github.com/eclipse/che-devfile-registry/blob/master/devfiles/go/devfile.yaml#L19.

If I start a workspace and remove that preference the Analysis Tools Missing error doesn't pop up.

Edit: It looks like golangci-lint and gopls are both installed in the dockerfile: https://github.com/che-dockerfiles/che-sidecar-go/blob/1.12.9/Dockerfile#L72

@amisevsk
Copy link
Contributor

amisevsk commented Feb 28, 2020

golangci-lint is installed, except the binary ends up in /usr/local/go/src/bin instead of /usr/local/go/bin, leaving it outside of the path (note this directory is not standard and is created during the golangci-lint install). The script used to install it outputs to ./bin for the current working directory.

@Katka92
Copy link
Contributor

Katka92 commented Mar 11, 2020

Hi guys, is there any progress on that issue? This issue is still present in 7.10.0-SNAPSHOT.

@Ohrimenko1988
Copy link
Contributor

Can somebody describe what to do if notifications with update suggestions missed?
Do we have any way to update LS except notification confirmation?

@ScrewTSW
Copy link
Member Author

The notification appears with every workspace startup until the plugin is updated.

@Ohrimenko1988
Copy link
Contributor

@ScrewTSW Could you please describe steps for updating LS if update suggestions missed?

@ScrewTSW
Copy link
Member Author

@Ohrimenko1988

  • restart workspace
  • open a .go file
  • wait for LS initialization and notification pop-up:
    Screenshot_20200312_162253
  • click "Update"
  • wait for installation, new notification will pop-up:
    Screenshot_20200312_162310
  • click "Reload"

@amisevsk
Copy link
Contributor

The fix for this issue would be to add it to the che-sidecar-go image (go get gopls) during the build. Then we could update the settings in the plugin to use the lang server, removing the prompt.

If you miss the prompt, nothing bad happens (provided all the regular tools are installed), but it will return if you try to work on a project that uses go modules.

@Ohrimenko1988
Copy link
Contributor

@amisevsk But the title of this issue "Go devfile Not working without updating Go language server to the experimental version." and according to this I suppose if you missed notification the Go language server will not work. Am I right?

@ScrewTSW ScrewTSW changed the title Go devfile Not working without updating Go language server to the experimental version. Go devfile LS Not working without updating Go language server to the experimental version. Mar 13, 2020
@ScrewTSW ScrewTSW changed the title Go devfile LS Not working without updating Go language server to the experimental version. Go devfile LS Not working without updating Go language server plugin to the experimental version. Mar 13, 2020
@ScrewTSW
Copy link
Member Author

@amisevsk But the title of this issue "Go devfile Not working without updating Go language server to the experimental version." and according to this I suppose if you missed notification the Go language server will not work. Am I right?

fixed the issue name

@ScrewTSW
Copy link
Member Author

ScrewTSW commented Mar 13, 2020

@rhopp found out that the problem, and why after update the LS works across the same workspace type after deletion/restarts is that what fixes the language server is a simple user preference setting:

"go.useLanguageServer": true

After setting that preference the golang devfile LS works correctly

@ericwill
Copy link
Contributor

@rhopp found out that the problem, and why after update the LS works across the same workspace type after deletion/restarts is that what fixes the language server is a simple user preference setting:

"go.useLanguageServer": true

After setting that preference the golang devfile LS works correctly

So this is what's required to fix this issue, just the one setting? Or updating the Go LS plugin also needs to happen?

@ScrewTSW
Copy link
Member Author

"go.useLanguageServer": true

I've created a new user, opened swagger and pushed

{
  "theia-user-preferences": "{\"application.confirmExit\":\"never\",\"workbench.iconTheme\":\"theia-file-icons\",\"go.useLanguageServer\":true}",
  "temporary": "false",
  "codenvy:created": "1584108807687"
}

to the preferences endpoint and then tried to open a new golang devfile.

the fix seems to be working even on newly created users that haven't been touched previously.

@ericwill ericwill mentioned this issue Mar 13, 2020
50 tasks
ericwill added a commit to eclipse-che/che-devfile-registry that referenced this issue Mar 24, 2020
Fixes issue where Che will complaing about the Go LS
not being up to date.

See eclipse-che/che#16113

Signed-off-by: Eric Williams <ericwill@redhat.com>
@ericwill
Copy link
Contributor

I believe the work here is done.

@MichalMaler
Copy link
Contributor

But the error highlighting isn't working yet. (Info from Tibor Dancs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/languages Issues related to Language extensions or plugins integration. kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

No branches or pull requests

10 participants