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

x/tools/gopls: Your workspace is misconfigured: <package> has no metadata. #38201

Closed
adambkaplan opened this issue Apr 1, 2020 · 9 comments
Closed
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@adambkaplan
Copy link

Please answer these questions before submitting your issue. Thanks!

What did you do?

VS Code Go extension, attempts to compile the openshift/origin repo. Fails to compile the test/extended package with error in $subject.

What did you expect to see?

Successful compilation

What did you see instead?

"Your workspace is misconfigured" message. This did not exist in prior versions of gopls.

Build info

golang.org/x/tools/gopls v0.3.4
    golang.org/x/tools/gopls@v0.3.4 h1:4GC7q/pXQ/tsxHBGVdsMdlB4gCxVC06m/7rIXg1Px4E=
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/sergi/go-diff@v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
    golang.org/x/mod@v0.1.1-0.20191105210325-c90efee705ee h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E=
    golang.org/x/sync@v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
    golang.org/x/tools@v0.0.0-20200316194252-fafb6e2e8a4a h1:hKrQy/q8/Xivoqgw6nGiz1jqpn1WGBLDcWLZwW0983E=
    golang.org/x/xerrors@v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
    honnef.co/go/tools@v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U=
    mvdan.cc/xurls/v2@v2.1.0 h1:KaMb5GLhlcSX+e+qhbRJODnUUBvlw01jt4yrjFIHAuA=

Go info

go version go1.13.6 darwin/amd64

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/adkaplan/Library/Caches/go-build"
GOENV="/Users/adkaplan/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/adkaplan/Code/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.13.6/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.13.6/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/9t/cygcxsp53ql6ll02zlrzls2c0000gn/T/go-build556182079=/tmp/go-build -gno-record-gcc-switches -fno-common"
@gopherbot gopherbot added this to the Unreleased milestone Apr 1, 2020
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Apr 1, 2020
@gopherbot
Copy link

Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here.

@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Apr 1, 2020
@stamblerre
Copy link
Contributor

I'm not able to reproduce this. Can you share the output of gopls -rpc.trace -v check path/to/file.go?

@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.4.0 Apr 1, 2020
@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Apr 1, 2020
@stamblerre stamblerre modified the milestones: gopls/v0.4.0, gopls/v0.5.0 Apr 2, 2020
@maxhawkins
Copy link

I'm also getting this error. What part of the check command do you need to see? I can't post the whole thing because it's an internal project.

I can't seem to reproduce the issue after the one time it happened, and I don't see anything interesting in the check command.

I believe this happened when I opened a new _test.go file in an existing package.

@stamblerre
Copy link
Contributor

This warning should've been removed in gopls/v0.4.0 so upgrading should resolve this issue. #38358 will probably resolve the issue that you saw, @maxhawkins. Going to close this as a result.

@adambkaplan
Copy link
Author

I likewise haven't seen this issue crop up since updating gopls to v0.4.0

@stamblerre stamblerre modified the milestones: gopls/v0.5.0, gopls/v0.4.1 May 13, 2020
@henryas
Copy link

henryas commented Sep 8, 2020

I have been having this problem lately. I have updated my go tools but the problem persists. Here is my error message:

The code in the workspace failed to compile (see the error message below). If you believe this is a mistake, please file an issue: https://github.com/golang/go/issues/new. github.com/henryas/gobootstrap/components/texts [github.com/henryas/gobootstrap/components/texts.test] has no metadata

I wonder what that github.com/henryas/gobootstrap/components/texts.test is all about. I write the tests inside the package texts as under package texts_test. Is this the root of the problem?

I wonder whether everybody else is having this problem.

Thanks.

Henry

@stamblerre
Copy link
Contributor

@henryas: There's no problem with the structure of your code, this is a gopls bug. Please try updating to gopls at master and let me know if that fixes the issue: GO111MODULE=on go get golang.org/x/tools/gopls@master golang.org/x/tools@master.

@henryas
Copy link

henryas commented Sep 9, 2020

@stamblerre Many thanks. It fixed the problem.

@zlesnr
Copy link

zlesnr commented Sep 18, 2020

Upgrading resolved the issue for me as well.

@golang golang locked and limited conversation to collaborators Sep 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

6 participants