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

non-exist package should not cause problem #1092

Closed
chinglinwen opened this issue Jan 14, 2021 · 5 comments
Closed

non-exist package should not cause problem #1092

chinglinwen opened this issue Jan 14, 2021 · 5 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@chinglinwen
Copy link

chinglinwen commented Jan 14, 2021

The issue is come from here: golang/go#36899 (comment) , as stamblerre suggest, I'm not sure what's the real problems though.

It's true, that cfg package is not exist, it's somewhat old package exist once, now deleted. or changed naas to example.com/naas I can't remember. and it should not cause problem I think.

Params: {"type":1,"message":"2021/01/14 12:41:22 warning: diagnose go.mod: err: exit status 1: stderr: go: finding module for package example.com/naas/pkg/cfg\nexample.com/naas/example/test imports\n\texample.com/naas/pkg/cfg: cannot find module providing package example.com/naas/pkg/cfg: module example.com/naas/pkg/cfg: reading https://goproxy.io/example.com/naas/pkg/cfg/@v/list: 404 Not Found\n\tserver response:\n\tnot found: go list -m -json -versions example.com/naas/pkg/cfg@latest\n\t: go list -m example.com/naas/pkg/cfg: unrecognized import path \"example.com/naas/pkg/cfg\" (parse https://example.com/naas/pkg/cfg?go-get=1: no go-import meta tags ())\n\n\tdirectory=/home/wen/gocode/src/example.com/naas\n\tsnapshot=1\n"}

What version of Go, VS Code & VS Code Go extension are you using?

  • Run go version to get version of Go
    • go version go1.15 linux/amd64
  • Run gopls -v version to get version of Gopls if you are using the language server.
Build info
----------
golang.org/x/tools/gopls master
    golang.org/x/tools/gopls@v0.6.2 h1:c3zVKbg4zEOayCwgV/RCA3ucNriOyzfTv22fBW+D1EQ=
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/google/go-cmp@v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/mod@v0.4.0 h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8=
    golang.org/x/sync@v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
    golang.org/x/tools@v0.0.0-20210102185154-773b96fafca2 h1:crjwvdT+rSAILpNOKhk/BNmefsucqGTeeRX2YBK/6Jg=
    golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
    honnef.co/go/tools@v0.1.0 h1:AWNL1W1i7f0wNZ8VwOKNJ0sliKvOF/adn0EHenfUh+c=
    mvdan.cc/gofumpt@v0.0.0-20210102162653-179728cc0722 h1:BmHL9mnhlnM7UNAgL4UVuyKrUsYUDglfhqKlDUJIRqA=
    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders
vscode on windows with remote linux
$ code -v
1.52.1
ea3859d4ba2f3e577a159bc91e3074c5d85c0523
x64
  • Check your installed extensions to get the version of the VS Code Go extension
    • v0.20.2
  • Run go env to get the go development environment details
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/wen/.cache/go-build"
GOENV="/home/wen/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/wen/gocode/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/wen/gocode"
GOPRIVATE=""
GOPROXY="https://goproxy.cn,direct"
GOROOT="/home/wen/soft/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/wen/soft/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/wen/gocode/src/example.com/naas/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build271146774=/tmp/go-build -gno-record-gcc-switches"

Share the Go related settings you have added/edited

https://mclo.gs/qvXjrfB

Describe the bug

A clear and concise description of what the bug.

It may relate to #236

However I try with extreme case that full of undefined names ( and no such import etc), in that way, it will show the saving box ( about 10 seconds I guess ), and got three times vscode disconnect(auto reconnect though).

A clear and concise description of what you expected to happen.

not sure if relate to this issue, if it relate, here's the expected to happen.

  • The saving box gone(so needs faster timeout? I'm not sure), no more discconect.

Steps to reproduce the behavior:

  • create a directory named afinalizer
  • with this content: https://mclo.gs/quI970t
  • under $GOPATH/src/example.com/pkg/afinalizer ( if it relate)

try save and close(sometimes close not responding) etc

logs: https://mclo.gs/QM2qthv

Screenshots or recordings

image

@stamblerre
Copy link
Contributor

Thanks for filing this new issue. One thing to try might be to reinstall gopls, because the version number you shared is a little unexpected (it should say v0.6.2, not master at the top). Can you please try running GO111MODULE=on go get golang.org/x/tools/gopls@v0.6.2?

@hyangah may be able to shed more light on the nature of the error message, but it looks like that you are still using that nonexistent package in your code. See this error message, for example:

[Trace - 12:41:19.646 PM] Received notification 'textDocument/publishDiagnostics'.
310 | Params: {"uri":"file:///home/wen/gocode/src/example.com/naas/example/test/test.go","diagnostics":[{"range":{"start":{"line":13,"character":1},"end":{"line":13,"character":27}},"severity":1,"source":"compiler","message":"could not import example.com/naas/pkg/cfg (no required module provides package \"example.com/naas/pkg/cfg\")"}]}
311

Do the issues go away after restarting gopls or do they persist?

@chinglinwen
Copy link
Author

@stamblerre It's stranges that after do go get golang.org/x/tools/gopls@v0.6.2, it seems, it close fast as I expect about 1 seconds, though saving box happen sometimes ( not all times as before ).

And I can see the format works now(format in one second), even it's not valid code ( afinalizer.go ).

after above go get command, I don't find the build info changed though (https://www.diffchecker.com/yfjJOx9I)

$ gopls -v version
Build info
----------
golang.org/x/tools/gopls master
    golang.org/x/tools/gopls@v0.6.2 h1:c3zVKbg4zEOayCwgV/RCA3ucNriOyzfTv22fBW+D1EQ=
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/google/go-cmp@v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M=
    github.com/sergi/go-diff@v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0=
    golang.org/x/mod@v0.4.0 h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8=
    golang.org/x/sync@v0.0.0-20201207232520-09787c993a3a h1:DcqTD9SDLc+1P/r1EmRBwnVsrOwW+kk2vWf9n+1sGhs=
    golang.org/x/tools@v0.0.0-20210102185154-773b96fafca2 h1:crjwvdT+rSAILpNOKhk/BNmefsucqGTeeRX2YBK/6Jg=
    golang.org/x/xerrors@v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE=
    honnef.co/go/tools@v0.1.0 h1:AWNL1W1i7f0wNZ8VwOKNJ0sliKvOF/adn0EHenfUh+c=
    mvdan.cc/gofumpt@v0.0.0-20210102162653-179728cc0722 h1:BmHL9mnhlnM7UNAgL4UVuyKrUsYUDglfhqKlDUJIRqA=
    mvdan.cc/xurls/v2@v2.2.0 h1:NSZPykBXJFCetGZykLAxaL6SIpvbVy/UFEniIfHAa8A=

here some logs, if it helpful
as it works now ( no delay anymore ), I try reload window to see if it happens again, and even I do reload, it works too.

https://mclo.gs/qvm81pF

currently I have no other case to try to see if saving got issue again.

hope this help someone else too.

@chinglinwen
Copy link
Author

chinglinwen commented Jan 14, 2021

Saving box still shows up, so above comment is false positive?

[Error - Received] 17:59:00.391 PM #4571 JSON RPC cancelled
[Trace - 17:59:00.391 PM] Received response 'textDocument/codeLens - (4572)' in 131931ms.
Result: null
[Trace - 17:59:00.392 PM] Received response 'textDocument/codeLens - (4573)' in 131419ms.
Result: null

full logs: https://mclo.gs/czb4gkr

@hyangah
Copy link
Contributor

hyangah commented Feb 10, 2021

@chinglinwen Sorry for being late. Do you still experience the issue? I didn't have a chance to look into the logs but found they are no longer accessible.

Recently we rewrote our troubleshooting guide - please follow the instruction and share the traces if you still need help. If you manage to address the issue or no longer can reproduce the issue, feel free to close the issue.

@hyangah hyangah added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Feb 10, 2021
@chinglinwen
Copy link
Author

I've try reproduce again, can't reproduce the issue, so closing it.

@golang golang locked and limited conversation to collaborators Feb 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants