Skip to content

Random run failure, results in a warning, no linter executed, 0 status code #888

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
3 tasks done
pierrre opened this issue Dec 13, 2019 · 4 comments
Closed
3 tasks done
Labels
bug Something isn't working

Comments

@pierrre
Copy link
Contributor

pierrre commented Dec 13, 2019

Thank you for creating the issue!

  • Yes, I'm using a binary release within 2 latest major releases. Only such installations are supported.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).

Please include the following information:

Version of golangci-lint
$ golangci-lint --version
golangci-lint has version 1.21.0 built from 645e794 on 2019-10-15T18:16:56Z
Config file
$ cat .golangci.yml
run:
  timeout: "10m"
linters:
  disable-all: true
  enable:
    - "bodyclose"
    - "deadcode"
    - "depguard"
    - "errcheck"
    - "gocritic"
    - "gocyclo"
    - "gofmt"
    - "goimports"
    - "golint"
    - "govet"
    - "ineffassign"
    - "megacheck"
    - "misspell"
    - "nakedret"
    - "structcheck"
    - "unconvert"
    - "unparam"
    - "varcheck"
linters-settings:
  depguard:
    list-type: blacklist
    include-go-root: true
    packages:
      - errors
      - reflect
      - unsafe
      - github.com/pkg/errors
  gocyclo:
    min-complexity: 10
  govet:
    enable-all: true
    settings:
      printf:
        funcs:
          - "(github.com/XXX/golang-libraries/errors).Newf"
          - "(github.com/XXX/golang-libraries/errors).WithMessagef"
          - "(github.com/XXX/golang-libraries/errors).Wrapf"
issues:
  exclude-use-default: false
  max-issues-per-linter: 0
  max-same-issues: 0
Go environment
$ go version && go env
go version go1.13.5 linux/amd64
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/pierre/.cache/go-build"
GOENV="/home/pierre/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/pierre/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/pierre/.gimme/versions/go1.13.5.src"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/pierre/.gimme/versions/go1.13.5.src/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/pierre/gosrc/github.com/XXX/golang-libraries/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-build476918749=/tmp/go-build -gno-record-gcc-switches"
Verbose output of running
$ golangci-lint run -v
none, sorry

Sometimes, when I run golangci-lint I get this strange error.

WARN [runner] Can't run linter goanalysis_metalinter: findcall: analysis skipped: errors in package: [/home/travis/gopath/src/github.com/XXX/golang-libraries/mgotest/mgotest.go:66:28: cannot use context.Background() (value of type context.Context) as context.Context value in argument to mgo.ParseURL: wrong type for method Deadline /home/travis/gopath/src/github.com/XXX/golang-libraries/mgotest/mgotest.go:72:32: cannot use context.Background() (value of type context.Context) as context.Context value in argument to mgo.DialWithInfo: wrong type for method Deadline /home/travis/gopath/src/github.com/XXX/golang-libraries/mgotest/mgotest.go:58:23: cannot use context.Background() (value of type context.Context) as context.Context value in argument to db.DropDatabase: wrong type for method Deadline]

But there is actually nothing wrong in my code.
It compiles perfectly fine.
If I run golangci-lint again, it works fine.
If I flush the golangci-lint cache and run it again, it works fine.
I can't reproduce the issue, it happens randomly (including on my CI server), but I saw it many times in the past few months.

The problem is worse, when it happens:

  • It displays a warning message (but no one will read it on the CI, see below)
  • No linter is actually executed, so it will not detect any error, if any
  • It exits with the status 0

It's a huge issue on my CI server, because a build may appear as positive, but it actually didn't run anything.

Is it possible to fail (return a non 0 status) for this issue ?
At least it will notify me that I must run the build again.

Is it possible to fix this issue ?

I don't have any verbose output, because it happens randomly, and I can't reproduce it reliably.
If it's really needed, I could enable the verbose output on all my projects/build, but I can't guarantee when I will be able to give you new logs.

@tpounds tpounds added the bug Something isn't working label Dec 30, 2019
@ernado
Copy link
Member

ernado commented Jan 7, 2020

Related to #885

@pierrre
Copy link
Contributor Author

pierrre commented Feb 4, 2020

#885 is fixed.
Does it mean that this issue is also fixed ?

@ernado
Copy link
Member

ernado commented Feb 4, 2020

Yes, please try the latest version and check

@pierrre
Copy link
Contributor Author

pierrre commented Feb 4, 2020

I think it was already fixed in the previous version.
I'm closing this issue.
Thank you ! 👍

@pierrre pierrre closed this as completed Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants