-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Can't run linter goanalysis_metalinter: failed prerequisites #827
Comments
I feel like this is related #824 |
Hi I met same problem. $ golangci-lint run -v main.go
INFO [config_reader] Config search paths: [./ /home/ibmadmin/github.ibm.com/spectrum-virtualize-exporter /home/ibmadmin/github.ibm.com /home/ibmadmin /home /]
INFO [config_reader] Used config file .golangci.yml
INFO [lintersdb] Active 30 linters: [deadcode depguard dogsled dupl errcheck funlen gochecknoinits goconst gocritic gocyclo gofmt goimports golint gosec gosimple govet ineffassign interfacer lll misspell nakedret scopelint staticcheck structcheck stylecheck typecheck unconvert unparam varcheck whitespace]
INFO [loader] Go packages loading at mode 575 (name|types_sizes|deps|exports_file|files|imports|compiled_files) took 322.014245ms
INFO [runner/filename_unadjuster] Pre-built 0 adjustments in 671.191µs
INFO [runner/goanalysis_metalinter/goanalysis] analyzers took 2.392766ms with top 10 stages: fact_deprecated: 458.401µs, buildssa: 114.037µs, inspect: 112.347µs, printf: 54.367µs, ctrlflow: 49.075µs, fact_purity: 43.913µs, depguard: 25.28µs, unparam: 23.584µs, S1034: 22.43µs, SA1001: 20.957µs
WARN [runner] Can't run linter goanalysis_metalinter: S1008: failed prerequisites: inspect@command-line-arguments, isgenerated@command-line-arguments
INFO [runner] processing took 6.1µs with stages: max_same_issues: 1.653µs, skip_dirs: 680ns, cgo: 596ns, nolint: 586ns, skip_files: 320ns, max_from_linter: 304ns, exclude: 278ns, filename_unadjuster: 265ns, identifier_marker: 248ns, path_prettifier: 179ns, path_shortener: 172ns, diff: 167ns, uniq_by_line: 165ns, source_code: 163ns, max_per_file_from_linter: 159ns, autogenerated_exclude: 93ns, exclude-rules: 72ns
INFO [runner] linters took 521.726734ms with stages: goanalysis_metalinter: 521.624518ms
INFO File cache stats: 0 entries of total size 0B
INFO Memory: 10 samples, avg is 88.4MB, max is 134.8MB
INFO Execution took 880.10069ms $ go version
go version go1.12.9 linux/amd64 $ golangci-lint version
golangci-lint has version 1.21.0 built from 645e794 on 2019-10-15T18:16:56Z |
i am also seeing the same issue ... any workaround will be helpful... |
+1 same problem
|
same error. Rerun the command then the problem go away. |
confirm
|
+1 same error
|
same here:
$ golangci-lint run .
WARN [runner] Can't run linter goanalysis_metalinter: assign: failed prerequisites: inspect@pactado/securer
WARN [runner] Can't run linter unused: buildssa: analysis skipped: errors in package: [/home/alvarolm/dev/assets/go/src/pr/main.go:39:25: ReadFile not declared by package ioutil] $ golangci-lint run .
WARN [runner] Can't run linter goanalysis_metalinter: SA4001: failed prerequisites: inspect@pactado/securer
WARN [runner] Can't run linter unused: buildssa: analysis skipped: errors in package: [/home/alvarolm/dev/assets/go/src/pr/main.go:39:25: ReadFile not declared by package ioutil] |
+1 same problem
|
This issue appears to be introduce with commit 95ec0cf. |
This comment has been minimized.
This comment has been minimized.
The current recommended installation steps use githubusercontent.com instead of goreleaser.com. There has been a reported issue in which the installer code differed between the two sites. golangci/golangci-lint#575 Additionally, pin to a specific tagged version of the install script to ensure reproducible installations of the tool. Use version 1.19.1. The latest two releases (1.21.0, 1.20.0) have a flaky bug (at least on macOS) that prevents the linter to run while still exiting with code 0 (success). ``` ~/s/sentry-go ❯❯❯ golangci-lint run WARN [runner] Can't run linter goanalysis_metalinter: assign: failed prerequisites: [email protected]/getsentry/sentry-go/echo ~/s/sentry-go ❯❯❯ golangci-lint run WARN [runner] Can't run linter goanalysis_metalinter: interfacer: failed prerequisites: [email protected]/getsentry/sentry-go/echo ``` See - golangci/golangci-lint#866 - golangci/golangci-lint#827
The current recommended installation steps use githubusercontent.com instead of goreleaser.com. There has been a reported issue in which the installer code differed between the two sites. golangci/golangci-lint#575 Additionally, pin to a specific tagged version of the install script to ensure reproducible installations of the tool. Use version 1.19.1. The latest two releases (1.21.0, 1.20.0) have a flaky bug (at least on macOS) that prevents the linter to run while still exiting with code 0 (success). ``` ~/s/sentry-go ❯❯❯ golangci-lint run WARN [runner] Can't run linter goanalysis_metalinter: assign: failed prerequisites: [email protected]/getsentry/sentry-go/echo ~/s/sentry-go ❯❯❯ golangci-lint run WARN [runner] Can't run linter goanalysis_metalinter: interfacer: failed prerequisites: [email protected]/getsentry/sentry-go/echo ``` See - golangci/golangci-lint#866 - golangci/golangci-lint#827
The current recommended installation steps use githubusercontent.com instead of goreleaser.com. There has been a reported issue in which the installer code differed between the two sites. golangci/golangci-lint#575 Additionally, pin to a specific tagged version of the install script to ensure reproducible installations of the tool. Use version 1.19.1. The latest two releases (1.21.0, 1.20.0) have a flaky bug (at least on macOS) that prevents the linter to run while still exiting with code 0 (success). ``` ~/s/sentry-go ❯❯❯ golangci-lint run WARN [runner] Can't run linter goanalysis_metalinter: assign: failed prerequisites: [email protected]/getsentry/sentry-go/echo ~/s/sentry-go ❯❯❯ golangci-lint run WARN [runner] Can't run linter goanalysis_metalinter: interfacer: failed prerequisites: [email protected]/getsentry/sentry-go/echo ``` See - golangci/golangci-lint#866 - golangci/golangci-lint#827
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
v1.19.1 is ok for me |
This comment has been minimized.
This comment has been minimized.
also happens on
|
Any solution to this issue. It still keeps failing on using v1.22.2 for gitlab CI/CD. |
This comment has been minimized.
This comment has been minimized.
This definitely seems like a widespread issue. Can some of you seeing the problem provide links to public repositories that can reliably reproduce the issue? Also, any links to public CI failures would be helpful as well. Having a way to reproduce the problem should make it easier to diagnose the root cause. |
UpdateI'm trying to build the code first and found the code is not compilable. After fixing those uncompilable part, I don't see this problem happen again, and can report the linter messages.
|
We have also been seeing this intermittently. It will fail at random and the succeed on the same commit once re-run. |
Sharing how I resolved mine. Aside from there is something that I had to fix in my project folder, it also has something to do with golangci-lint behaviour. It wasn't consistent with its error. I am using golangci-lint v1.22.2. Here are the steps I performed:
It was a weird and painful ordeal. Anyone have an idea what's going on? |
we are also seeing this issue -via golangci-lint-actions- when updating gonum/plot to use Gioui (that uses cgo under the hood to interact with the graphics layer of the OS) anything we could do on our end? |
FYI, golangci-lint-actions was failing to analyze the CGo dependencies b/c while the build GitHub Action did have all the required C/C++ packages installed, the golangci-lint GitHub Action didn't (they are executed in distinct environments/containers). adding a run-step with the appropriate |
This is still happening with 1.28, both locally and on CI: local:
It is an intermittent issue, rerunning always solves this type of problem. Could we please reopen this issue? |
According to comment above it is still an issue. |
Below is what finally fixed the issue for me. I found that my IDE (IntelliJ IDEA) was actually putting in a Basically, my IDE was messing with my |
Bumping go required bumping golangci-lint due to the following error: level=warning msg="[runner] Can't run linter goanalysis_metalinter: SA1023: failed prerequisites: [email protected]/gravitational/robotest/lib/loc" Which is discussed here: golangci/golangci-lint#827 Bumping golangci-lint in turn required tweaking (or removing) a test that would never run: lib/ssh/ssh_test.go:86:6: func `testEnv` is unused (unused) I chose to enable the test, as ssh_test.go is not run regularly, and I don't fully understand the impact of removing the env parameter from RunAndParse. Better to let someone sort it out when they try to execute ssh_test.go and have more context available.
Bumping go required bumping golangci-lint due to the following error: level=warning msg="[runner] Can't run linter goanalysis_metalinter: SA1023: failed prerequisites: [email protected]/gravitational/robotest/lib/loc" Which is discussed here: golangci/golangci-lint#827 Bumping golangci-lint in turn required tweaking (or removing) a test that would never run: lib/ssh/ssh_test.go:86:6: func `testEnv` is unused (unused) I chose to enable the test, as ssh_test.go is not run regularly, and I don't fully understand the impact of removing the env parameter from RunAndParse. Better to let someone sort it out when they try to execute ssh_test.go and have more context available.
docker run --rm -v /appdir:/app -w /app golangci/golangci-lint:v1.22.2 golangci-lint run -v |
you have to use a more recent version: v1.35.2 |
I am still facing this issue. (version: logs
Any work-around for this? |
@Harkishen-Singh edit: I found your PR timescale/promscale#445 |
In fact the error is clear:
the symbol The problem is related to an incompatibility between the version of $ go mod why github.com/containerd/containerd/sys
# github.com/containerd/containerd/sys
github.com/timescale/promscale/pkg/internal/testhelpers
github.com/testcontainers/testcontainers-go
github.com/docker/docker/pkg/archive
github.com/containerd/containerd/sys So the problem is not related to golangci-lint. You can see the problem like that: $ go test ./pkg/internal/testhelpers/
# github.com/docker/docker/pkg/archive
../../../../pkg/mod/github.com/docker/[email protected]+incompatible/pkg/archive/archive_unix.go:84:5: undefined: "github.com/containerd/containerd/sys".RunningInUserNS
FAIL github.com/timescale/promscale/pkg/internal/testhelpers [build failed]
FAIL
|
For everybody, The error that begins with Because golangci-lint requires that your code compile to be analyzed. I close this issue. Please report any unexpected errors reported by failed prerequisites as separate issues, thanks! |
Sometimes, when running golangci-lint on https://github.com/cozy/cozy-stack, I have a warning about
failed_prerequisites
:Please include the following information:
Version of golangci-lint
Config file
Go environment
Verbose output of running
The text was updated successfully, but these errors were encountered: