golangci-lint-action: "File exists" errors when un-taring golangci-lint
Follow-up to https://github.com/golangci/golangci-lint-action/issues/135, https://github.com/golangci/golangci-lint-action/pull/156 and #221.
Using v2, I’m still seeing these errors:
- name: Lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.37
Example is in https://github.com/andig/evcc/pull/1075/checks?check_run_id=2655591730
Apart from fixing using tar- why not just use go install instead?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 12
- Comments: 39 (15 by maintainers)
Commits related to this issue
- CI/lint: Skpi pkg cache https://github.com/golangci/golangci-lint-action/issues/244 — committed to taoufik07/terraform-provider-gandi by taoufik07 3 years ago
- CI/lint: Skpi pkg cache golangci/golangci-lint-action#244 — committed to taoufik07/terraform-provider-gandi by taoufik07 3 years ago
- Merge #1509 1509: Update golangci, trying to fix lint r=Kay-Zee a=Kay-Zee This updates the golangci action to just use the latest v2 action, which is recommended for the action. Also, skipping th... — committed to onflow/flow-go by bors[bot] 3 years ago
- Merge #1509 1509: Update golangci, trying to fix lint r=Kay-Zee a=Kay-Zee This updates the golangci action to just use the latest v2 action, which is recommended for the action. Also, skipping th... — committed to onflow/flow-go by bors[bot] 3 years ago
- Merge #1509 1509: Update golangci, trying to fix lint r=Kay-Zee a=Kay-Zee This updates the golangci action to just use the latest v2 action, which is recommended for the action. Also, skipping th... — committed to onflow/flow-go by bors[bot] 3 years ago
- Move linter to an earlier position Refs https://github.com/golangci/golangci-lint-action/issues/244 — committed to evcc-io/evcc by andig 3 years ago
- Updated golangci-lint attempt to fix cache problem There is a problem with the golangci-lint returning many errors like this one: Error: /usr/bin/tar: ... Cannot open: File exists See this issue: ht... — committed to relab/gorums by meling 3 years ago
- ci: Clean up errors in golangci-lint. See https://github.com/golangci/golangci-lint-action/issues/244. — committed to jwalton/kitsch by jwalton 2 years ago
- ci: Clean up errors in golangci-lint. See https://github.com/golangci/golangci-lint-action/issues/244. — committed to jwalton/kitsch by jwalton 2 years ago
- Fix CI https://github.com/golangci/golangci-lint-action/issues/244 — committed to fangyi-zhou/mpst-tracing by fangyi-zhou 2 years ago
- Fix CI (again) https://github.com/golangci/golangci-lint-action/issues/244 — committed to fangyi-zhou/mpst-tracing by fangyi-zhou 2 years ago
- fix(ci) let golangci handle its own go install See https://github.com/golangci/golangci-lint-action/issues/244 golangci-lint action wants to handle its own Go installation. As there is nothing else ... — committed to Kong/kubernetes-testing-framework by rainest 2 years ago
- fix(ci) let golangci handle its own go install See https://github.com/golangci/golangci-lint-action/issues/244 golangci-lint action wants to handle its own Go installation. As there is nothing else ... — committed to Kong/kubernetes-testing-framework by rainest 2 years ago
- fix(ci) let golangci handle its own go install See https://github.com/golangci/golangci-lint-action/issues/244 golangci-lint action wants to handle its own Go installation. As there is nothing else ... — committed to Kong/kubernetes-testing-framework by rainest 2 years ago
- fix(ci) let golangci handle its own go install See https://github.com/golangci/golangci-lint-action/issues/244 golangci-lint action wants to handle its own Go installation. As there is nothing else ... — committed to Kong/kubernetes-testing-framework by rainest 2 years ago
- Move linter to an earlier position Refs https://github.com/golangci/golangci-lint-action/issues/244 — committed to dontbyte/evcc by andig 3 years ago
- fix: golang ci file open errors This commit fixes an issue where `golangci-lint` throws a series of errors claiming to unable to open untarred files. This is supposedly because the tool is supposed t... — committed to therealvio-org/game-off-2022 by therealvio 2 years ago
- fix: golang ci file open errors This commit fixes an issue where `golangci-lint` throws a series of errors claiming to unable to open untarred files. This is supposedly because the tool is supposed t... — committed to therealvio-org/game-off-2022 by therealvio 2 years ago
- lint: Don't use golangci cache Currently we have ~50k lines of tar extraction errors with "File exists" when the golangi-lint-action runs. There doesn't seem to be a clean way around this, other than... — committed to neondatabase/autoscaling by sharnoff a year ago
- lint: Don't use golangci cache (#201) Currently we have ~50k lines of tar extraction errors with "File exists" when the golangi-lint-action runs. There doesn't seem to be a clean way around this, o... — committed to neondatabase/autoscaling by sharnoff a year ago
@maintainers could we please reopen? IMHO we have the bad choices of slow CI due to excessive logging or slow CI due do omitting the caches, both are not good options.
Can confirm, I’ve got the same issue:
Error: /usr/bin/tar: ../../../../home/runner/go/pkg/mod/github.com/google/renameio@v1.0.1/doc.go: Cannot open: File exists Error: /usr/bin/tar: ../../../../home/runner/go/pkg/mod/github.com/google/renameio@v1.0.1/example_test.go: Cannot open: File existsWe cannot do anything within
golangci-lint-action, since the@action/cachelib is maintained by GitHub. As I can see theextractTarfunction is imported frominternalpackage: https://github.com/actions/toolkit/blob/main/packages/cache/src/cache.ts#L5 and the internal implementation does not contain--overwriteflag: https://github.com/actions/toolkit/blob/fcb8c4ca798bd0d81a9b07e2f7dffee8397c4707/packages/cache/src/internal/tar.ts#L57-L86so there is no way to fix the issue within this action, while GitHub Action uses
tarwithout--overwriteflag.I would still recommend to disable the golangci-lint’s cache in case of using your own cache step:
and increase timeout
this action creates a cache for 3 folders:
~/.cache/go-build, can be disabled by settingskip-build-cachetotrue~/go/pkg, can be disable by settingskip-pkg-cachetotrue.cache/golangci-lint, cannot be disable, it is the internal cacheAs a “very hot” solution I have just disabled package caching:
This pops up (again?) in v3
@StevenACoffman I’ve just upgraded to 3.0 and I’m still seeing this in https://github.com/evcc-io/evcc/runs/5343866024?check_suite_focus=true:
Can you please reopen?
Oh, I just noticed that this action runs actions/setup-go itself. I was taking care of that myself before running this action, because I need to run go list first as explained earlier.
Is it possible to influence which version of Go this action installs? I don’t see mention of such a parameter in the action.yaml file.
Is that still the suggested workaround? Imho, without adding it I’m back to the errors (and apparently slow linting times due to excessive logging) while with adding I’m slow due to the missing lint caches.
actions/cache has been updated. https://github.com/golangci/golangci-lint-action/commit/4ef1b2ec49b85244db5924ab1ba5ee23540201fe
Will the v2.5.3 release fix this issue?
Looks like someone tried to fix this upstream for this very package here: https://github.com/actions/toolkit/pull/717 but that PR was superseded by https://github.com/actions/toolkit/pull/807 which was merged on May 21, 2021.
However, the last release of
@actions/cachewas 1.0.7 which was Tuesday, April 13, 2021, prior to the merge of the fix. 😞As a result, this will not be fixed until a new upstream release is cut and this updates to use it, but no other code needs to be changed.