-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
1.33.0: "File exists" errors when un-taring golangci-lint #135
Comments
I have the same issue. |
Same! |
Perhaps golangci-lint-action/src/run.ts Line 19 in 54a84d4
|
A workaround is to run this before: go clean -modcache |
Thats not acceptable imho. The expectation of finding a clean modcache is wrong. |
I have the same issue, but only on self-hosted runner |
I'm running into this issue after having something like this as a run file (using protoc to generate models) name: "golangci-lint report"
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: '3.14'
- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
.go/cache
./gen
key: ${{ runner.os }}-${{ hashFiles('./go.mod') }}
- name: Add protoc to path
run: |
echo "$GOPATH"
echo "$GOPATH/bin" >> $GITHUB_PATH
echo "$PATH"
go get -u github.com/golang/protobuf/protoc-gen-go
- name: Setup generated code
run: |
make setup
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.34
args: -v --timeout=5m
The trouble is that our makefile does set up the code generation with both |
It seems the issue has been around for some time and accepted as being an issue with the linter action: linter expects module cache as clean which is not reasonable. Workarounds like cleaning the module cache appear undesirable regarding performance. Is there anything missing in terms of transparency or input to move this into fixing? |
The issue should be fixed by #156 , but there is an issue with macOs |
Thanks to all for fixing this! |
It's released in v2.4.1 |
I'm still seeing these errors using |
I tried v2.4.1 and it doesn't seem to fix the issue for me. There are two invocations of Here is my configuration name: Code sanity
on:
push:
tags:
- v*
branches:
- master
- main
- wip
pull_request:
jobs:
default:
name: Code sanity
runs-on: ubuntu-20.04
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.15'
- name: Install protobuf compiler
run: sudo apt-get install protobuf-compiler
- name: Install protobuf and grpc generators
run: go install google.golang.org/protobuf/cmd/protoc-gen-go google.golang.org/grpc/cmd/protoc-gen-go-grpc
- name: Generate protobuf and grpc bindings
run: go generate
- name: Run linting
uses: golangci/[email protected]
with:
version: v1.37.1 Here is a snippet from the log.
|
Same here using @v2 |
As a workaround, I'm forcing the action not to use pkg cache. This solves my issue for now. This leverages the fix that was put in #154 - name: Run linting
uses: golangci/[email protected]
with:
version: v1.38.0
skip-go-installation: true
skip-pkg-cache: true |
|
Seems due to #221 and should hopefully be fixed now |
This issue does not seem to be resolved. We are using v3 and we still have the cache issue even though we see that the tar command is being invoked with the
|
This seems to cause double caching. golangci/golangci-lint-action#135
This seems to cause double caching. golangci/golangci-lint-action#135
This seems to cause double caching. golangci/golangci-lint-action#135
this is still happening on v4 :( |
See golangci/golangci-lint-action#135 Signed-off-by: Leonardo Di Donato <[email protected]>
See golangci/golangci-lint-action#135 Signed-off-by: Leonardo Di Donato <[email protected]>
It appears there is some confusion regarding this issue. There are two different TAR executions that happen during the run: I created a PR to fix |
Ref. golangci/golangci-lint-action#135. Otherwies we've got a set of errors on attempt to setup linter: ``` Run golangci/golangci-lint-action@v4 with: version: latest github-token: *** only-new-issues: false skip-cache: false skip-pkg-cache: false skip-build-cache: false install-mode: binary prepare environment Checking for go.mod: go.mod Received 125829120 of 781115092 (16.1%), 119.8 MBs/sec Received 331350016 of 781115092 (42.4%), 157.8 MBs/sec Received 541065216 of 781115092 (69.3%), 171.9 MBs/sec Received 738197504 of 781115092 (94.5%), 175.8 MBs/sec Cache Size: ~745 MB (781115092 B) /usr/bin/tar -xf /home/runner/work/_temp/6de9500e-163b-4dda-a82b-d6b2ee7b1625/cache.tzst -P -C /home/runner/work/neo-go/neo-go --use-compress-program unzstd Received 781115092 of 781115092 (100.0%), 148.8 MBs/sec /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/LICENSE: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/.github/workflows/test.yml: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/README.md: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/annotation_test.go: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/retention_test.go: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/main.go: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/fmt/m.proto: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/test_import_a1m2.pb.go: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/test_import_all.proto: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/test_import_a1m2.proto: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/test_b_1/m2.pb.go: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/test_b_1/m1.pb.go: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/test_b_1/m1.proto: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/test_b_1/m2.proto: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/test_import_all.pb.go: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.proto: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/test_a_1/m2.pb.go: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.pb.go: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.proto: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/test_a_1/m2.proto: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/test_a_2/m3.proto: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/test_a_2/m4.pb.go: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/test_a_2/m4.proto: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/imports/test_a_2/m3.pb.go: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/extensions/ext/ext.proto: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/extensions/extra/extra.proto: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.proto: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/extensions/base/base.proto: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/proto2/fields.pb.go: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/proto2/nested_messages.proto: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/proto2/proto2.proto: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/proto2/enum.proto: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/proto2/enum.pb.go: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/proto2/proto2.pb.go: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/proto2/fields.proto: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/import_public/b.pb.go: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/[email protected]/cmd/protoc-gen-go/testdata/import_public/a.proto: Cannot open: File exists ... ``` Signed-off-by: Anna Shaleva <[email protected]>
Below errors were seen with setup-go@v4 in golangci Lint: Error: /usr/bin/tar: ../../../go/pkg/mod/sigs.k8s.io/[email protected]/yaml_ test.go: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/sigs.k8s.io/[email protected]/LICENSE: Cannot open: File exists Disabling Cache with golangci solves the problem and makes sure that we are in a reecent setup-go as well. Cache can be enabled once the resultant issue is fixed in golangci lint action repo. Issue that is to be tracked: golangci/golangci-lint-action#135
FYI the caches related to modules and Go build have been removed: #1029 |
The problem was related to Go modules cache, we stopped caching those elements, so the problem should be fixed now. |
Hi, I still have that problem.
|
You should use the v6 of the |
I'm using the linter action in https://github.com/andig/evcc/pull/497/checks?check_run_id=1474850871:
Go artefacts are already cached:
This leads to large amount of errors in the action log:
The text was updated successfully, but these errors were encountered: