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

Loads of "Error: /usr/bin/tar: ../../../go/pkg/mod/....: Cannot open: File exists #677

Closed
4 tasks done
markusressel opened this issue Feb 15, 2023 · 10 comments
Closed
4 tasks done
Labels
area: cache question Further information is requested

Comments

@markusressel
Copy link

Welcome

  • 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.).
  • Yes, I've tried with the standalone linter if available (e.g., gocritic, go vet, etc.). (https://golangci-lint.run/usage/linters/)

Description of the problem

The github action fails with loads of these errors, probably related to the caching:

Installed golangci-lint into /home/runner/golangci-lint-1.51.1-linux-amd64/golangci-lint in 741ms
  Received 54232198 of 54232198 (100.0%), 70.7 MBs/sec
  Cache Size: ~52 MB (54232198 B)
  /usr/bin/tar -xf /home/runner/work/_temp/53[18](https://github.com/markusressel/fan2go/actions/runs/4188014496/jobs/7258607005#step:6:19)d8a9-780f-42b0-aadb-1bea0530247c/cache.tzst -P -C /home/runner/work/fan2go/fan2go --use-compress-program unzstd
  Error: /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/term@v0.3.0/term_unsupported.go: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/term@v0.3.0/PATENTS: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/term@v0.3.0/term_unix.go: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/term@v0.3.0/term.go: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/term@v0.3.0/term_plan9.go: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/term@v0.3.0/term_unix_other.go: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/term@v0.3.0/terminal_test.go: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/term@v0.3.0/CONTRIBUTING.md: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/term@v0.3.0/term_windows.go: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/term@v0.3.0/term_test.go: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/term@v0.3.0/LICENSE: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/term@v0.3.0/term_unix_bsd.go: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/term@v0.3.0/terminal.go: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/term@v0.3.0/codereview.cfg: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/term@v0.3.0/README.md: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/term@v0.3.0/go.sum: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/term@v0.3.0/go.mod: Cannot open: File exists

Version of golangci-lint

v1.51.1

Configuration file

None

Go environment

Not applicable

Verbose output of running

Not applicable

Code example or link to a public repository

See: https://github.com/markusressel/fan2go/actions/runs/4188111630/jobs/7258832963

@markusressel markusressel added the bug Something isn't working label Feb 15, 2023
@boring-cyborg
Copy link

boring-cyborg bot commented Feb 15, 2023

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@ldez ldez transferred this issue from golangci/golangci-lint Feb 15, 2023
@richja
Copy link

richja commented Feb 20, 2023

Had the same issue. Try to set skip-pkg-cache: true in action config.

@markusressel
Copy link
Author

Thx, although it's more of a workaround than a fix I guess?

zanecodes added a commit to zanecodes/terraform-provider-kerberos that referenced this issue Feb 24, 2023
@ldez ldez added question Further information is requested and removed bug Something isn't working labels Feb 27, 2023
joshuaspence added a commit to paultyng/go-unifi that referenced this issue Feb 27, 2023
joshuaspence added a commit to paultyng/go-unifi that referenced this issue Feb 27, 2023
@emmaLP
Copy link

emmaLP commented Mar 3, 2023

Any update on this issue please?

joshuaspence added a commit to paultyng/terraform-provider-unifi that referenced this issue Mar 8, 2023
joshuaspence added a commit to paultyng/terraform-provider-unifi that referenced this issue Mar 8, 2023
* Add `skip-pkg-cache` go `golangci-lint-action`

See golangci/golangci-lint-action#677.

* Increase `golangci-lint` timeout
randombenj added a commit to aptly-dev/aptly that referenced this issue Mar 9, 2023
jakeyheath added a commit to chanzuckerberg/happy that referenced this issue Mar 15, 2023
jakeyheath added a commit to chanzuckerberg/happy that referenced this issue Mar 15, 2023
* fix: golanglint-ci

golangci/golangci-lint-action#677

* Update cli-ci.yml

* Update provider-ci.yml

* Update shared-ci.yml
@caarlos0
Copy link
Contributor

Are you using actions/setup-go@v4 by any chance? It automatically enables caching now, which I think is what's causing this issue.

@caarlos0
Copy link
Contributor

#704

caarlos0 added a commit to goreleaser/goreleaser that referenced this issue Mar 20, 2023
refs golangci/golangci-lint-action#677

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
caarlos0 added a commit to goreleaser/goreleaser that referenced this issue Mar 20, 2023
refs golangci/golangci-lint-action#677

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
@markusressel
Copy link
Author

markusressel commented Mar 20, 2023

@caarlos0 No I am not, I am still using 3.4.0 see:
https://github.com/markusressel/fan2go/blob/master/.github/workflows/go.yml

EDIT: Sorry I misread, but no, I am also not using setup-go v4, but v3. Again, see the link above.

@caarlos0
Copy link
Contributor

In that case, probably your make test is populating the caches, which golangci-lint-action tries to override.

That's why I usually have another workflow just for linting, so one thing doesn't mess with the other...

@markusressel
Copy link
Author

Indeed, changing the order to ensure that the lint job runs before any test or build step seems to work:

markusressel/fan2go@5e64f3b

@markusressel
Copy link
Author

Upgrading to setup-go@v4 also seems to work, see: markusressel/fan2go#215
Closing this as fixed. Thx!

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

No branches or pull requests

5 participants