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

golangci-lint failed:[error]/bin/tar:xxxx Cannot open: File exists #23

Closed
silenceper opened this issue May 30, 2020 · 8 comments
Closed

Comments

@silenceper
Copy link

silenceper commented May 30, 2020

https://github.com/silenceper/gowatch/pull/18/checks?check_run_id=722754687
ERROR:

Installed Go in 77ms
Primary analysis cache key is 'golangci-lint.cache-2630-859920e3b25ff717a0784f9487e35cf40a5fdc1f', restore keys are 'golangci-lint.cache-2630- | golangci-lint.cache-'
Requested golangci-lint 'v1.26', using 'v1.26.0', calculation took 152ms
Installing golangci-lint v1.26.0...
Downloading https://github.com/golangci/golangci-lint/releases/download/v1.26.0/golangci-lint-1.26.0-linux-amd64.tar.gz ...
/bin/tar xz --warning=no-unknown-keyword -C /home/runner -f /home/runner/work/_temp/896dbb3b-38ba-4b3a-80ae-948886b0a1ea
Cache Size: ~11 MB (11729781 B)
/bin/tar -xz -f /home/runner/work/_temp/c9eac72e-6931-4b7d-9a02-499333b10684/cache.tgz -P -C /home/runner/work/gowatch/gowatch
/bin/tar: ../../../go/pkg/mod/github.com/howeyc/fsnotify@v0.9.0/CONTRIBUTING.md: Cannot open: File exists
##[error]/bin/tar: ../../../go/pkg/mod/github.com/howeyc/fsnotify@v0.9.0/fsnotify_test.go: Cannot open: File exists
##[error]/bin/tar: ../../../go/pkg/mod/github.com/howeyc/fsnotify@v0.9.0/example_test.go: Cannot open: File exists
/bin/tar: ../../../go/pkg/mod/github.com/howeyc/fsnotify@v0.9.0/.gitignore: Cannot open: File exists
##[error]/bin/tar: ../../../go/pkg/mod/github.com/howeyc/fsnotify@v0.9.0/fsnotify_open_darwin.go: Cannot open: File exists
/bin/tar: ../../../go/pkg/mod/github.com/howeyc/fsnotify@v0.9.0/CHANGELOG.md: Cannot open: File exists
/bin/tar: ../../../go/pkg/mod/github.com/howeyc/fsnotify@v0.9.0/LICENSE: Cannot open: File exists

actions config:

name: Go
on: [push,pull_request]
jobs:

  build:
    name: Build
    runs-on: ubuntu-latest
    steps:

      - name: Set up Go 1.x
        uses: actions/setup-go@v2
        with:
          go-version: ^1.13
        id: go

      - name: Check out code into the Go module directory
        uses: actions/checkout@v2

      - name: Get dependencies
        run: |
          go get -v -t -d ./...
          if [ -f Gopkg.toml ]; then
              curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
              dep ensure
          fi
      - name: Lint Go Code
        run: |
          export PATH=$PATH:$(go env GOPATH)/bin # temporary fix. See https://github.com/actions/setup-go/issues/14
          go get -u golang.org/x/lint/golint
          go vet ./...
          golint -set_exit_status $(go list ./...)
      - name: Build
        run: go build -v .

It is no problem to run the golangci-lint run command locally, is my github action configuration wrong?

@bluskript
Copy link

I have the same issue

@jirfag
Copy link
Member

jirfag commented Jun 21, 2020

Hi,

it's because you run go get before running this action: fetched $GOPATH/pkg/mod conflict.

We need to document it better. You can run the action in a separate job, as we recommend in README to fix it.

@h-michael
Copy link

@jirfag Thanks for developing great apps :)
I got the same issue. But I can't do your suggestion.
Because I use this action for private repository applications which depends on private modules.
So I should run go get -t -v ./... with machine user GitHub token before running golangci-lint.
Do I have a solution with this?

@silenceper
Copy link
Author

Hi,

it's because you run go get before running this action: fetched $GOPATH/pkg/mod conflict.

We need to document it better. You can run the action in a separate job, as we recommend in README to fix it.

fixed

@SVilgelm
Copy link
Member

SVilgelm commented Aug 9, 2020

@silenceper Hi, could you provide more details about how you fixed it? I think it can be useful for others

@mojtabacazi
Copy link

mojtabacazi commented Aug 10, 2020

@jirfag @silenceper I just ran into the same issue. I have to run go get to generate mocks and other things required for linter to work. Can you guys please explain how it would work?

@silenceper
Copy link
Author

@silenceper Hi, could you provide more details about how you fixed it? I think it can be useful for others

I remove "Get dependencies" and is works

jacobweinstock added a commit to jacobweinstock/pbnj that referenced this issue Nov 19, 2020
golangci-lint was failing. Upgraded golangci-lint to v2 and
reordered it to first as a modified `go.mod` file was causing errors.
ref: golangci/golangci-lint-action#23 (comment)

Signed-off-by: Jacob Weinstock <jakobweinstock@gmail.com>
misery added a commit to misery/HeatingMqttBridge that referenced this issue May 20, 2021
faruryo added a commit to faruryo/dns-tools that referenced this issue Jun 20, 2021
faruryo added a commit to faruryo/dns-tools that referenced this issue Jun 20, 2021
larsks added a commit to larsks/halberd that referenced this issue Aug 27, 2021
According to golangci/golangci-lint-action#23 we should just let the
action take care of installing go, etc.
mikemrm added a commit to metal-toolbox/hollow-metadataservice that referenced this issue Apr 12, 2023
Seeing issues with running golanglint-ci action, one solution was to
disable package cache.

https://github.com/metal-toolbox/hollow-metadataservice/actions/runs/4683823976/jobs/8299350650?pr=98
golangci/golangci-lint-action#23 (comment)

Signed-off-by: Mike Mason <mimason@equinix.com>
mikemrm added a commit to metal-toolbox/hollow-metadataservice that referenced this issue Apr 12, 2023
Seeing issues with running golanglint-ci action, one solution was to
disable package cache.

https://github.com/metal-toolbox/hollow-metadataservice/actions/runs/4683823976/jobs/8299350650?pr=98
golangci/golangci-lint-action#23 (comment)

Signed-off-by: Mike Mason <mimason@equinix.com>
mikemrm added a commit to metal-toolbox/hollow-metadataservice that referenced this issue Apr 13, 2023
* validate uuid requests

Signed-off-by: Mike Mason <mimason@equinix.com>

* golanglint-ci action skip-pkg-cache

Seeing issues with running golanglint-ci action, one solution was to
disable package cache.

https://github.com/metal-toolbox/hollow-metadataservice/actions/runs/4683823976/jobs/8299350650?pr=98
golangci/golangci-lint-action#23 (comment)

Signed-off-by: Mike Mason <mimason@equinix.com>

---------

Signed-off-by: Mike Mason <mimason@equinix.com>
carhartl added a commit to carhartl/k8s-playground that referenced this issue May 26, 2023
carhartl added a commit to carhartl/helm-chart-playground that referenced this issue May 26, 2023
Choraden added a commit to saucelabs/forwarder that referenced this issue Aug 16, 2023
After the golangci-lint version was bumped, the linter stopped working at the ci [1].

[1] golangci/golangci-lint-action#23
Choraden added a commit to saucelabs/forwarder that referenced this issue Aug 16, 2023
After the golangci-lint version was bumped, the linter stopped working at the ci [1].

[1] golangci/golangci-lint-action#23
Choraden added a commit to saucelabs/forwarder that referenced this issue Aug 16, 2023
After the golangci-lint version was bumped, the linter stopped working at the ci [1].

[1] golangci/golangci-lint-action#23
Choraden added a commit to saucelabs/forwarder that referenced this issue Aug 16, 2023
After the golangci-lint version was bumped, the linter stopped working at the ci [1].

[1] golangci/golangci-lint-action#23
mmatczuk pushed a commit to saucelabs/forwarder that referenced this issue Aug 16, 2023
After the golangci-lint version was bumped, the linter stopped working at the ci [1].

[1] golangci/golangci-lint-action#23
DavidS-ovm added a commit to overmindtech/cli that referenced this issue Aug 25, 2023
DavidS-ovm added a commit to overmindtech/cli that referenced this issue Sep 29, 2023
golangci-lint-action caching conflicts with the setup-go cache and `go get` above. See golangci/golangci-lint-action#23
spivachuk added a commit to canow-co/canow-chain that referenced this issue Oct 3, 2023
- Removed caching from actions/setup-go before golangci/golangci-lint-action within go-lint job of lint GA workflow to avoid golangci/golangci-lint-action#23
oxzi added a commit to Icinga/icinga-notifications that referenced this issue Oct 30, 2023
By using the golangci-lint action after other go commands, conflicting
files during the "prepare environment" phase occurred. This known
issue[0] is easily fixable by putting golangci-lint in its own job.

[0] golangci/golangci-lint-action#23
oxzi added a commit to Icinga/icinga-notifications that referenced this issue Oct 30, 2023
By using the golangci-lint action after other go commands, conflicting
files during the "prepare environment" phase occurred. This known
issue[0] is easily fixable by putting golangci-lint in its own job.

[0] golangci/golangci-lint-action#23
spivachuk added a commit to canow-co/cheqd-node that referenced this issue Dec 12, 2023
- Disabled caching in `actions/setup-go` before `golangci/golangci-lint-action` within `go-lint` job in `Lint` workflow to avoid golangci/golangci-lint-action#23.
- Removed redundant `cache: true` parameter from `actions/setup-go` within all the other jobs.
spivachuk added a commit to canow-co/canow-chain that referenced this issue Dec 12, 2023
- Updated `actions/setup-go` to `v4`.
- Set its `cache` parameter to `false` explicitly within `go-lint` job in `Lint` workflow (to avoid golangci/golangci-lint-action#23) because in `v4` it defaults to `true`.
- Removed redundant `cache: true` parameter from `actions/setup-go` within all the other jobs.
spivachuk added a commit to canow-co/canow-chain that referenced this issue Dec 12, 2023
- Updated `actions/setup-go` to `v4`.
- Set its `cache` parameter to `false` explicitly within `go-lint` job in `Lint` workflow (to avoid golangci/golangci-lint-action#23) because in `v4` it defaults to `true`.
- Removed redundant `cache: true` parameter from `actions/setup-go` within all the other jobs.
spivachuk added a commit to canow-co/cheqd-node that referenced this issue Dec 14, 2023
- Added `Release` GitHub workflow.
- Made `call-build` job dependent on `call-lint` job.
- Disabled caching in `actions/setup-go` before `golangci/golangci-lint-action` to avoid golangci/golangci-lint-action#23.
- Made some minor corrections.
ynm3n added a commit to light-planck/nemmy that referenced this issue Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants