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

github.com/go-jose/go-jose/v4 is not in your go.mod file (go mod tidy) #3675

Open
khanakia opened this issue Feb 1, 2025 · 4 comments
Assignees

Comments

@khanakia
Copy link

khanakia commented Feb 1, 2025

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

Version Information
  • Run go version to get version of Go from the VS Code integrated terminal.
    • go version go1.23.2 darwin/arm64
  • Run gopls -v version to get version of Gopls from the VS Code integrated terminal.
Build info
----------
golang.org/x/tools/gopls v0.17.1
    golang.org/x/tools/[email protected] h1:Mt/DSfnnSe3dyf6MH/dZZ0iww+viHNhAFc4rEYDiOAw=
    github.com/BurntSushi/[email protected] h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs=
    github.com/google/[email protected] h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
    golang.org/x/exp/[email protected] h1:1P7xPZEwZMoBoz0Yze5Nx2/4pxj6nw9ZqHWXqP0iRgQ=
    golang.org/x/[email protected] h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
    golang.org/x/[email protected] h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
    golang.org/x/[email protected] h1:TCDqnvbBsFapViksHcHySl/sW4+rTGNIAoJJesHRuMM=
    golang.org/x/[email protected] h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug=
    golang.org/x/[email protected] h1:kgwdasJRsdDWYgWcEgMF424DiXwwXHSb3V8xVTi//i8=
    golang.org/x/[email protected] h1:SP0mPeg2PmGCu03V+61EcQiOjmpri2XijexKdzv8Z1I=
    honnef.co/go/[email protected] h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I=
    mvdan.cc/[email protected] h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU=
    mvdan.cc/xurls/[email protected] h1:lyBNOm8Wo71UknhUs4QTFUNNMyxy2JEIaKKo0RWOh+8=
go: go1.23.2
  • Run code -v or code-insiders -v to get version of VS Code or VS Code Insiders.
1.96.4
cd4ee3b1c348a13bafd8f9ad8060705f6d4b9cba
arm64
  • Check your installed extensions to get the version of the VS Code Go extension
    • 0.44.0
  • Run Ctrl+Shift+P (Cmd+Shift+P on Mac OS) > Go: Locate Configured Go Tools command.
# Tools Configuration


## Environment

GOBIN: undefined
toolsGopath: 
gopath: /Volumes/D/khanakia/go
GOROOT: /usr/local/go
PATH: /Volumes/D/khanakia/.bun/bin:/Volumes/D/khanakia/.yarn/bin:/Volumes/D/khanakia/.config/yarn/global/node_modules/.bin:/opt/homebrew/opt/ruby/bin:/opt/homebrew/opt/[email protected]/bin:/opt/homebrew/opt/[email protected]/sbin:/opt/homebrew/opt/[email protected]/bin:/Volumes/D/khanakia/.deno/bin:/Volumes/D/khanakia/Library/pnpm:/Volumes/D/khanakia/.nvm/versions/node/v22.12.0/bin:/Volumes/D/www/flutter/flutter/bin:/Volumes/D/khanakia/Library/Android/sdk/platform-tools:/Volumes/D/khanakia/Library/Android/sdk/platform-tools/bin:/Volumes/D/khanakia/Library/Android/sdk/tools/bin:/Volumes/D/khanakia/Library/Android/sdk/tools:/Volumes/D/khanakia/.composer/vendor/bin:/Library/Frameworks/Python.framework/Versions/3.12/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/Library/Frameworks/Python.framework/Versions/3.11/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin:/usr/local/go/bin:/Volumes/D/khanakia/.cargo/bin:/Volumes/D/khanakia/go/bin:/opt/homebrew/lib/ruby/gems/3.3.0/bin:/usr/local/go/bin:/Applications/Postgres.app/Contents/Versions/17/bin:/Volumes/D/khanakia/.pub-cache/bin:/Volumes/D/khanakia/.local/bin:/Volumes/D/i2/bin/nvim-macos/bin:/Volumes/D/khanakia/.cache/lm-studio/bin

## Tools

	go:	/usr/local/go/bin/go: go version go1.23.2 darwin/arm64

	gopls:	/Volumes/D/khanakia/go/bin/gopls	(version: v0.17.1 built with go: go1.23.2)
	gotests:	/Volumes/D/khanakia/go/bin/gotests	(version: v1.6.0 built with go: go1.23.1)
	gomodifytags:	/Volumes/D/khanakia/go/bin/gomodifytags	(version: v1.16.0 built with go: go1.23.1)
	impl:	/Volumes/D/khanakia/go/bin/impl	(version: v1.1.0 built with go: go1.23.1)
	goplay:	/Volumes/D/khanakia/go/bin/goplay	(version: v1.0.0 built with go: go1.23.1)
	dlv:	/Volumes/D/khanakia/go/bin/dlv	(version: v1.23.0 built with go: go1.23.1)
	staticcheck:	/Volumes/D/khanakia/go/bin/staticcheck	(version: v0.5.1 built with go: go1.23.1)

## Go env

Workspace Folder (saasfly_api): /Volumes/D/www/projects/khanakia/saasfly/saasfly_api

	GO111MODULE='on'
	GOARCH='arm64'
	GOBIN=''
	GOCACHE='/Volumes/D/khanakia/Library/Caches/go-build'
	GOENV='/Volumes/D/khanakia/Library/Application Support/go/env'
	GOEXE=''
	GOEXPERIMENT=''
	GOFLAGS=''
	GOHOSTARCH='arm64'
	GOHOSTOS='darwin'
	GOINSECURE=''
	GOMODCACHE='/Volumes/D/khanakia/go/pkg/mod'
	GONOPROXY='github.com/theuxm'
	GONOSUMDB='github.com/theuxm'
	GOOS='darwin'
	GOPATH='/Volumes/D/khanakia/go'
	GOPRIVATE='github.com/theuxm'
	GOPROXY='https://proxy.golang.org,direct'
	GOROOT='/usr/local/go'
	GOSUMDB='sum.golang.org'
	GOTMPDIR=''
	GOTOOLCHAIN='auto'
	GOTOOLDIR='/usr/local/go/pkg/tool/darwin_arm64'
	GOVCS=''
	GOVERSION='go1.23.2'
	GODEBUG=''
	GOTELEMETRY='local'
	GOTELEMETRYDIR='/Volumes/D/khanakia/Library/Application Support/go/telemetry'
	GCCGO='gccgo'
	GOARM64='v8.0'
	AR='ar'
	CC='clang'
	CXX='clang++'
	CGO_ENABLED='1'
	GOMOD='/dev/null'
	GOWORK='/Volumes/D/www/projects/khanakia/saasfly/saasfly_api/go.work'
	CGO_CFLAGS='-O2 -g'
	CGO_CPPFLAGS=''
	CGO_CXXFLAGS='-O2 -g'
	CGO_FFLAGS='-O2 -g'
	CGO_LDFLAGS='-O2 -g'
	PKG_CONFIG='pkg-config'
	GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/sk/k6vkn27d2xbcxcj1ll6dvwjw0000gn/T/go-build1905123601=/tmp/go-build -gno-record-gcc-switches -fno-common'
	

Share the Go related settings you have added/edited

Run Preferences: Open Settings (JSON) command to open your settings.json file.
Share all the settings with the go. or ["go"] or gopls prefixes.

 "go.toolsEnvVars": {
    "GO111MODULE": "on"
  },

Describe the bug

I am getting this error github.com/go-jose/go-jose/v4 is not in your go.mod file (go mod tidy) and when I try to run these commands

go clean -modcache
go clean -cache

then issue seems to be fixed for a while and then it comes again and I tried everything

  • I am using go workspace
  • I ran into the module directory cd saas && go mo tidy and then cd .. && go work vendor but still same issue

Steps to reproduce the behavior:

I am using go workspace and I have a module exists in go.mod file

Screenshots or recordings

If applicable, add screenshots or recordings to help explain your problem.

Check VIDEO Here: https://www.youtube.com/watch?v=ULb7VB1ANrw

Image

Image

@gopherbot gopherbot added this to the Untriaged milestone Feb 1, 2025
@findleyr
Copy link
Member

findleyr commented Feb 7, 2025

Hi @khanakia, if you're able to go back and forth a bit, I can help you track this down.

When it happens, can you do the following?

  • Run Go: Start language server's maintainer interface
  • Click on Session 1
  • Share the summary of Views that you see.
  • Click on the overlay for go.mod in question. Does it contain the require?

Are you saying that after you fix these from the command line, they come back, randomly?

@khanakia
Copy link
Author

khanakia commented Feb 7, 2025

It just happens random and also it happened today so what I did is

go clean -modcache
go clean -cache
go work vendor

and then error is gone

I will have to wait for it to happen again and then I will follow the above steps to debug as you suggested

@khanakia
Copy link
Author

khanakia commented Feb 10, 2025

@findleyr Got the error again and i followed the steps and below is the output from the language server's maintainer interface

Image

I can see the module listed in go.mod file

github.com/aws/aws-sdk-go-v2/config v1.29.6
Main Info Memory Profiling Metrics RPC Trace Analysis
Session 1
From: Cache 1
Views
ID: 1
Type: GoWork
Root: file:///myproject
Folder: myproject:file:///
Overlays
file:///myproject/saas/cmd/test/main.go
file:///myproject/vendor/entgo.io/contrib/entgql/annotation.go
file:///myproject/gqlsa/main.go
file:///myproject/saas/pkg/awsfn/awsfn.go
file:///myproject/saas/pkg/medialibrary/medialibrary.go
file:///myproject/vendor/entgo.io/ent/schema/field/field.go
file:///myproject/saas/go.mod
file:///myproject/gqlsa/internal/handlers/handlers.go
file:///myproject/saas/schema/storage_disk.go

go.mod file

Here is the go.mod file from the Interfance
Overlay 77fc2ed2eb50dc4cf8f480323486e0f9bd9b997854c4cd274fcb9fe899c1ae64
URI: file:///myproject/saas/go.mod
Identifier: 77fc2ed2eb50dc4cf8f480323486e0f9bd9b997854c4cd274fcb9fe899c1ae64
Version: 1
Kind: go.mod
Contents
module saas

go 1.23.2

replace (
	configmgr => ../configmgr
	github.com/ubgo/filepathutil => ../filepathutil
	gql => ../gql
	gqlsa => ../gqlsa
	lace => ../lace
)

require (
	configmgr v0.0.0-00010101000000-000000000000
	entgo.io/contrib v0.6.0
	entgo.io/ent v0.14.2-0.20241231052425-fc57ede2fe0d
	github.com/99designs/gqlgen v0.17.62
	github.com/cohesivestack/valgo v0.4.1
	github.com/fatih/color v1.18.0
	github.com/gin-gonic/gin v1.10.0
	github.com/golang-jwt/jwt v3.2.2+incompatible
	github.com/google/uuid v1.6.0
	github.com/gosimple/slug v1.15.0
	github.com/hashicorp/go-multierror v1.1.1
	github.com/invopop/jsonschema v0.13.0
	github.com/kkdai/twitter v0.1.0
	github.com/lib/pq v1.10.9
	github.com/matoous/go-nanoid/v2 v2.1.0
	github.com/nats-io/nats.go v1.38.0
	github.com/spf13/cast v1.7.1
	github.com/spf13/cobra v1.8.1
	github.com/ubgo/goutil v0.1.3
	github.com/uptrace/bun v1.2.7
	github.com/uptrace/bun/dialect/pgdialect v1.2.7
	github.com/vektah/gqlparser/v2 v2.5.21
	github.com/xhit/go-simple-mail/v2 v2.16.0
	golang.org/x/crypto v0.31.0
	golang.org/x/oauth2 v0.24.0
	gql v0.0.0-00010101000000-000000000000
	gqlsa v0.0.0-00010101000000-000000000000
	lace v0.0.0-00010101000000-000000000000
)

require (
	github.com/aws/aws-sdk-go-v2 v1.36.1
	github.com/aws/aws-sdk-go-v2/config v1.29.6
	github.com/aws/aws-sdk-go-v2/credentials v1.17.59
	github.com/aws/aws-sdk-go-v2/service/s3 v1.76.0
	github.com/go-jose/go-jose/v4 v4.0.4
	github.com/go-openapi/inflect v0.21.0
	github.com/mat/besticon v3.12.0+incompatible
	github.com/ubgo/filepathutil v0.0.0-00010101000000-000000000000
	golang.org/x/image v0.23.0
)

require (
	ariga.io/atlas v0.29.1 // indirect
	cloud.google.com/go/compute/metadata v0.6.0 // indirect
	github.com/agext/levenshtein v1.2.3 // indirect
	github.com/agnivade/levenshtein v1.2.0 // indirect
	github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
	github.com/apple/pkl-go v0.9.0 // indirect
	github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.8 // indirect
	github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.28 // indirect
	github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.32 // indirect
	github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.32 // indirect
	github.com/aws/aws-sdk-go-v2/internal/ini v1.8.2 // indirect
	github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.32 // indirect
	github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.12.2 // indirect
	github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.5.6 // indirect
	github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.12.13 // indirect
	github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.18.13 // indirect
	github.com/aws/aws-sdk-go-v2/service/sso v1.24.15 // indirect
	github.com/aws/aws-sdk-go-v2/service/ssooidc v1.28.14 // indirect
	github.com/aws/aws-sdk-go-v2/service/sts v1.33.14 // indirect
	github.com/aws/smithy-go v1.22.2 // indirect
	github.com/bahlo/generic-list-go v0.2.0 // indirect
	github.com/bmatcuk/doublestar v1.3.4 // indirect
	github.com/buger/jsonparser v1.1.1 // indirect
	github.com/bytedance/sonic v1.12.6 // indirect
	github.com/bytedance/sonic/loader v0.2.1 // indirect
	github.com/cloudwego/base64x v0.1.4 // indirect
	github.com/cloudwego/iasm v0.2.0 // indirect
	github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
	github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
	github.com/gabriel-vasile/mimetype v1.4.8 // indirect
	github.com/getsentry/sentry-go v0.31.1 // indirect
	github.com/gin-contrib/sse v1.0.0 // indirect
	github.com/go-playground/locales v0.14.1 // indirect
	github.com/go-playground/universal-translator v0.18.1 // indirect
	github.com/go-playground/validator/v10 v10.23.0 // indirect
	github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
	github.com/goccy/go-json v0.10.4 // indirect
	github.com/google/go-cmp v0.6.0 // indirect
	github.com/gorilla/websocket v1.5.3 // indirect
	github.com/gosimple/unidecode v1.0.1 // indirect
	github.com/hashicorp/errwrap v1.1.0 // indirect
	github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
	github.com/hashicorp/hcl/v2 v2.23.0 // indirect
	github.com/inconshreveable/mousetrap v1.1.0 // indirect
	github.com/jackc/pgpassfile v1.0.0 // indirect
	github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
	github.com/jackc/pgx/v5 v5.7.2 // indirect
	github.com/jackc/puddle/v2 v2.2.2 // indirect
	github.com/jinzhu/inflection v1.0.0 // indirect
	github.com/json-iterator/go v1.1.12 // indirect
	github.com/klauspost/compress v1.17.11 // indirect
	github.com/klauspost/cpuid/v2 v2.2.9 // indirect
	github.com/leodido/go-urn v1.4.0 // indirect
	github.com/mailru/easyjson v0.9.0 // indirect
	github.com/mattn/go-colorable v0.1.13 // indirect
	github.com/mattn/go-isatty v0.0.20 // indirect
	github.com/mitchellh/go-wordwrap v1.0.1 // indirect
	github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
	github.com/modern-go/reflect2 v1.0.2 // indirect
	github.com/mrjones/oauth v0.0.0-20190623134757-126b35219450 // indirect
	github.com/nats-io/nkeys v0.4.9 // indirect
	github.com/nats-io/nuid v1.0.1 // indirect
	github.com/pelletier/go-toml/v2 v2.2.3 // indirect
	github.com/pkg/errors v0.9.1 // indirect
	github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
	github.com/puzpuzpuz/xsync/v3 v3.4.0 // indirect
	github.com/russross/blackfriday/v2 v2.1.0 // indirect
	github.com/sosodev/duration v1.3.1 // indirect
	github.com/spf13/pflag v1.0.5 // indirect
	github.com/stretchr/testify v1.10.0 // indirect
	github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect
	github.com/toorop/go-dkim v0.0.0-20240103092955-90b7d1423f92 // indirect
	github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
	github.com/ugorji/go/codec v1.2.12 // indirect
	github.com/urfave/cli/v2 v2.27.5 // indirect
	github.com/valyala/bytebufferpool v1.0.0 // indirect
	github.com/valyala/fasttemplate v1.2.2 // indirect
	github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
	github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
	github.com/wk8/go-ordered-map/v2 v2.1.9-0.20240816141633-0a40785b4f41 // indirect
	github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 // indirect
	github.com/zclconf/go-cty v1.16.0 // indirect
	go.uber.org/multierr v1.11.0 // indirect
	go.uber.org/zap v1.27.0 // indirect
	golang.org/x/arch v0.12.0 // indirect
	golang.org/x/exp v0.0.0-20250103183323-7d7fa50e5329 // indirect
	golang.org/x/mod v0.22.0 // indirect
	golang.org/x/net v0.33.0 // indirect
	golang.org/x/sync v0.10.0 // indirect
	golang.org/x/sys v0.28.0 // indirect
	golang.org/x/text v0.21.0 // indirect
	golang.org/x/tools v0.28.0 // indirect
	google.golang.org/protobuf v1.36.1 // indirect
	gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
	gopkg.in/yaml.v3 v3.0.1 // indirect
)

@melkus
Copy link

melkus commented Feb 12, 2025

I have similar issue with my workspace. It appeared maybe half an year ago, but now it is permanent.
The only workaround that works for me is to open a single project instead of workspace.

My workspace has shared projects with replace statements in project go.mod like this:
replace bitbucket.org/myAccount/myLibrary => ../myLibrary

I am not ready to share my code, but maybe I will return later with more details if I can create a snippet to reproduce.

@jba jba modified the milestones: Untriaged, vscode-go/backlog Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants