Skip to content

Error: "invalid version of the configuration" #5608

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

Closed
6 of 7 tasks
thockin opened this issue Mar 24, 2025 · 5 comments
Closed
6 of 7 tasks

Error: "invalid version of the configuration" #5608

thockin opened this issue Mar 24, 2025 · 5 comments
Labels
question Further information is requested

Comments

@thockin
Copy link

thockin commented Mar 24, 2025

Welcome

  • Yes, I'm using a binary release within 2 latest releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've read the typecheck section of the FAQ.
  • Yes, I've tried with the standalone linter if available (e.g., gocritic, go vet, etc.).
  • I agree to follow this project's Code of Conduct

How did you install golangci-lint?

go install

Description of the problem

I get an error about config version, but I cannot find any docs about it:

$ go run github.com/golangci/golangci-lint/v2/cmd/[email protected] run -v
INFO golangci-lint has version v2.0.0 built with go1.24.1 from (unknown, modified: ?, mod sum: "h1:RQWk8VCuMQv9bBDy3x23yds2yf9aRZ86C9MWGIdNRuU=") on (unknown) 
INFO [config_reader] Config search paths: [./ /home/thockin/src/git-sync-v4 /home/thockin/src /home/thockin /home /] 
INFO [config_reader] Used config file .golangci.yaml 
INFO maxprocs: Leaving GOMAXPROCS=6: CPU quota undefined 
Error: invalid version of the configuration: ""
Failed executing command with error: invalid version of the configuration: ""
exit status 3

Version of golangci-lint

$ go run github.com/golangci/golangci-lint/v2/cmd/[email protected] --version
golangci-lint has version v2.0.0 built with go1.24.1 from (unknown, modified: ?, mod sum: "h1:RQWk8VCuMQv9bBDy3x23yds2yf9aRZ86C9MWGIdNRuU=") on (unknown)

Configuration

$ cat .golangci.yaml 
run:
  timeout: 30m

Go environment

$ go version && go env 
go version go1.24.1 linux/amd64
AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/thockin/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/thockin/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build1274681100=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/home/thockin/src/git-sync-v4/go.mod'
GOMODCACHE='/home/thockin/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/thockin/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go1.24.1'
GOSUMDB='sum.golang.org'
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/thockin/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go1.24.1/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.24.1'
GOWORK=''
PKG_CONFIG='pkg-config'

Verbose output of running

$ go run github.com/golangci/golangci-lint/v2/cmd/[email protected] cache clean

$ go run github.com/golangci/golangci-lint/v2/cmd/[email protected] run -v
INFO golangci-lint has version v2.0.0 built with go1.24.1 from (unknown, modified: ?, mod sum: "h1:RQWk8VCuMQv9bBDy3x23yds2yf9aRZ86C9MWGIdNRuU=") on (unknown) 
INFO [config_reader] Config search paths: [./ /home/thockin/src/git-sync-v4 /home/thockin/src /home/thockin /home /] 
INFO [config_reader] Used config file .golangci.yaml 
INFO maxprocs: Leaving GOMAXPROCS=6: CPU quota undefined 
Error: invalid version of the configuration: ""
Failed executing command with error: invalid version of the configuration: ""
exit status 3

A minimal reproducible example or link to a public repository

Doesn't get this far

Validation

  • Yes, I've included all information above (version, config, etc.).

Supporter

@thockin thockin added the bug Something isn't working label Mar 24, 2025
@ldez ldez added question Further information is requested and removed bug Something isn't working labels Mar 24, 2025
@ldez
Copy link
Member

ldez commented Mar 24, 2025

Hello,

the field version should be added: https://golangci-lint.run/product/migration-guide/#version

version: "2"

I recommend using the migration command: https://golangci-lint.run/product/migration-guide/#command-migrate

@ldez ldez closed this as completed Mar 24, 2025
@thockin
Copy link
Author

thockin commented Mar 24, 2025

This does not seem to be in any of the examples or reference configs

@ldez
Copy link
Member

ldez commented Mar 24, 2025

The field is inside the reference file:

But I can add an extra section about it.

@ldez
Copy link
Member

ldez commented Mar 24, 2025

I created a PR #5609

@thockin
Copy link
Author

thockin commented Mar 24, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants