Skip to content

Golangci-lint exit with code 137 #552

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
idanl21 opened this issue Aug 15, 2022 · 10 comments
Closed

Golangci-lint exit with code 137 #552

idanl21 opened this issue Aug 15, 2022 · 10 comments
Labels
question Further information is requested

Comments

@idanl21
Copy link

idanl21 commented Aug 15, 2022

Hey!
I'm running your GitHub lint action that worked great! but now somehow I started to get that golangci-lint exit with code 137 error that was caused by Out Of Mem error.
My conf

      version: v1.45
      working-directory: opensearch-operator
      args: --timeout=6m --skip-dirs="(^|/)responses($|/)"
@matzew
Copy link

matzew commented Aug 22, 2022

We notice the same:

Killed
  
  Error: golangci-lint exit with code 137

@matzew
Copy link

matzew commented Aug 26, 2022

golangci/golangci-lint-action@v3

seems not to have this issue

@ldez ldez added the question Further information is requested label Sep 6, 2022
@ldez
Copy link
Member

ldez commented Sep 6, 2022

Hello, the context of this issue is not clear, can you provide more information (Go version, action version, etc.)?

@karl-johan-grahn
Copy link

karl-johan-grahn commented Oct 30, 2022

We also started getting this out of nowhere. Similar to @matzew it was resolved by upgrading from golangci-lint-action@v2 to v3

@marcus-vw
Copy link

We have been facing the same issue, even with golangci-lint-action@v3.
Our workflow failed when we used golangci/golangci-lint-action@v3 with golangci-lint version 1.50.1. We could fix the workflow by using golangci-lint-1.51.0. The action was changed as seen below:

      - name: lint
        uses: golangci/golangci-lint-action@v3
        with:
          version: v1.51.0  # use 1.51.0 instead of v1.50.1
          args: --timeout 10m
          skip-pkg-cache: true  # don't cache or restore ~/go/pkg.
          skip-build-cache: true # don't cache or restore ~/.cache/go-build

@derekwilling
Copy link

derekwilling commented Sep 28, 2023

I am still seeing this issue with the following:

level=info msg="[lintersdb] Active 16 linters: [errcheck errorlint gci gocritic godot gosec gosimple govet ineffassign misspell nonamedreturns staticcheck typecheck unconvert unused whitespace]"
  level=info msg="[loader] Go packages loading at mode 575 (imports|name|exports_file|deps|files|types_sizes|compiled_files) took 2m43.333695121s"
  level=info msg="[runner/filename_unadjuster] Pre-built 0 adjustments in 1.349223312s"
  Killed
  
  Error: golangci-lint exit with code 137
  Ran golangci-lint in 48[39](https://github.com/APP/actions/runs/1/job/1?pr=1#step:9:41)37ms

The action is defined:

      - name: Run golangci-lint
        uses: golangci/golangci-lint-action@v3
        with:
          version: v1.53
          args: --verbose --timeout 15m --out-${NO_FUTURE}format colored-line-number # https://github.com/golangci/golangci-lint-action/issues/119
          only-new-issues: true
          skip-pkg-cache: true
          skip-build-cache: true

@ldez
Copy link
Member

ldez commented May 9, 2024

This issue seems related to the fact of using a golangci-lint version that does not support the Go version used in your CI.

  • v1.56.0 -> go <= 1.22
  • v1.54.0 -> go <= 1.21
  • v1.51.0 -> go <= 1.20
  • v1.48.0 -> go <= 1.19
  • v1.45.0 -> go <= 1.18

@JFDValente
Copy link

JFDValente commented Oct 7, 2024

I just updated my project to go 1.23, and I got this problem, which version do you recommend I use to solve it? Using version 1.60.3 it still gives the same error

@ldez
Copy link
Member

ldez commented Oct 8, 2024

https://golangci-lint.run/welcome/faq/#which-go-versions-are-supported

Basically, it's because you are using a golangci-lint binary that is not compiled with go1.23.

The official binaries are compiled with go1.23 since v1.60.0.

To check that:

$ golangci-lint version
golangci-lint has version 1.61.0 built with go1.23.1 from a1d6c560 on 2024-09-09T17:44:42Z

Also go1.23 should be installed inside your CI.

@zhangyangyu
Copy link

zhangyangyu commented Mar 18, 2025

I am using go 1.24 and golangci-lint 1.64.7(the latest) and could still get the error. Seems it needs lots of memory and OOM. So I add GOMEMLIMIT to solve it.

- name: golangci lint
  uses: golangci/golangci-lint-action@v6
  with:
    version: v1.64.7
    args: --verbose
    skip-cache: true
  env:
    GOMEMLIMIT: "6GiB"

6GiB for GitHub Linux runner has a memory cap 7GiB.

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

8 participants