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

1.33.0: "File exists" errors when un-taring golangci-lint #135

Open
andig opened this issue Nov 30, 2020 · 51 comments · Fixed by #156
Open

1.33.0: "File exists" errors when un-taring golangci-lint #135

andig opened this issue Nov 30, 2020 · 51 comments · Fixed by #156
Labels
area: cache bug Something isn't working

Comments

@andig
Copy link

andig commented Nov 30, 2020

I'm using the linter action in https://github.com/andig/evcc/pull/497/checks?check_run_id=1474850871:

Go artefacts are already cached:

steps:
- name: Setup
  uses: actions/setup-go@v2
  with:
    go-version: ^1.14
  id: go

- uses: actions/cache@v2
  with:
    path: |
      ~/go/pkg/mod
      **/node_modules
    key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ hashFiles('**/package-lock.json') }}
    restore-keys: |
      ${{ runner.os }}-go-

...

- name: Lint
  uses: golangci/golangci-lint-action@v2
  with:
    version: v1.33

This leads to large amount of errors in the action log:

Installed Go in 79ms
Requested golangci-lint 'v1.33', using 'v1.33.0', calculation took 226ms
Installing golangci-lint v1.33.0...
Downloading https://github.com/golangci/golangci-lint/releases/download/v1.33.0/golangci-lint-1.33.0-linux-amd64.tar.gz ...
Received 92009212 of 92009212 (100.0%), 146.0 MBs/sec
Cache Size: ~88 MB (92009212 B)
/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/1fe13742-cdde-4fcd-88d4-a1bcad1244b3/cache.tzst -P -C /home/runner/work/evcc/evcc
/bin/tar xz --warning=no-unknown-keyword -C /home/runner -f /home/runner/work/_temp/11aa6afa-628a-4b5d-94a5-40d55abea5bd
Error: /bin/tar: ../../../go/pkg/mod/gopkg.in/ini.v1@v1.62.0/ini.go: Cannot open: File exists
Error: /bin/tar: ../../../go/pkg/mod/gopkg.in/ini.v1@v1.62.0/bench_test.go: Cannot open: File exists
...
Error: /bin/tar: ../../../go/pkg/mod/golang.org/x/mod@v0.3.0/modfile/rule.go: Cannot open: File exists
Error: /bin/tar: ../../../go/pkg/mod/golang.org/x/mod@v0.3.0/modfile/print.go: Cannot open: File exists
/bin/tar: Exiting with failure status due to previous errors
Warning: Tar failed with error: The process '/bin/tar' failed with exit code 2
Prepared env in 3125ms
@dahu33
Copy link
Member

dahu33 commented Dec 7, 2020

I have the same issue.

@h4yfans
Copy link

h4yfans commented Dec 8, 2020

Same!

@phillbaker
Copy link

Perhaps installLint should return early if the install path already exists?

return await installLint(versionConfig)

@nicovogelaar
Copy link

A workaround is to run this before:

go clean -modcache

@andig
Copy link
Author

andig commented Jan 19, 2021

Thats not acceptable imho. The expectation of finding a clean modcache is wrong.

@NomNes
Copy link

NomNes commented Jan 21, 2021

I have the same issue, but only on self-hosted runner

@gabizou
Copy link

gabizou commented Jan 23, 2021

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 go generate and protoc. Any advice? I'm struggling to find a happy medium for having code generation and linting in actions.

@andig
Copy link
Author

andig commented Feb 3, 2021

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?

@SVilgelm
Copy link
Member

The issue should be fixed by #156 , but there is an issue with macOs

@SVilgelm SVilgelm linked a pull request Feb 23, 2021 that will close this issue
@steebchen
Copy link

steebchen commented Feb 23, 2021

Thanks to all for fixing this!

@SVilgelm
Copy link
Member

It's released in v2.4.1

@andig
Copy link
Author

andig commented Mar 3, 2021

I'm still seeing these errors using golangci/golangci-lint-action@v2. Do I need to upgrade my build in any way?

@kprav33n
Copy link

kprav33n commented Mar 5, 2021

I tried v2.4.1 and it doesn't seem to fix the issue for me. There are two invocations of tar. One is with --overwrite flag while the other one is not.

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/golangci-lint-action@v2.4.1
        with:
          version: v1.37.1

Here is a snippet from the log.

Run golangci/golangci-lint-action@v2.4.1
  with:
    version: v1.37.1
    github-token: ***
    only-new-issues: false
    skip-go-installation: false
    skip-pkg-cache: false
    skip-build-cache: false
  env:
    GOROOT: /opt/hostedtoolcache/go/1.15.8/x64
prepare environment
  Finding needed golangci-lint version...
  Setup go stable version spec 1
  Found in cache @ /opt/hostedtoolcache/go/1.16.0/x64
  Added go to the path
  Installing golangci-lint v1.37.1...
  Downloading https://github.com/golangci/golangci-lint/releases/download/v1.37.1/golangci-lint-1.37.1-linux-amd64.tar.gz ...
  Successfully setup go version 1
  go version go1.16 linux/amd64
  
go env
  GO111MODULE=""
  GOARCH="amd64"
  GOBIN=""
  GOCACHE="/home/runner/.cache/go-build"
  GOENV="/home/runner/.config/go/env"
  GOEXE=""
  GOFLAGS=""
  GOHOSTARCH="amd64"
  GOHOSTOS="linux"
  GOINSECURE=""
  GOMODCACHE="/home/runner/go/pkg/mod"
  GONOPROXY=""
  GONOSUMDB=""
  GOOS="linux"
  GOPATH="/home/runner/go"
  GOPRIVATE=""
  GOPROXY="https://proxy.golang.org,direct"
  GOROOT="/opt/hostedtoolcache/go/1.16.0/x64"
  GOSUMDB="sum.golang.org"
  GOTMPDIR=""
  GOTOOLDIR="/opt/hostedtoolcache/go/1.16.0/x64/pkg/tool/linux_amd64"
  GOVCS=""
  GOVERSION="go1.16"
  GCCGO="gccgo"
  AR="ar"
  CC="gcc"
  CXX="g++"
  CGO_ENABLED="1"
  GOMOD="/home/runner/work/mapreduce/mapreduce/go.mod"
  CGO_CFLAGS="-g -O2"
  CGO_CPPFLAGS=""
  CGO_CXXFLAGS="-g -O2"
  CGO_FFLAGS="-g -O2"
  CGO_LDFLAGS="-g -O2"
  PKG_CONFIG="pkg-config"
  GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3333635328=/tmp/go-build -gno-record-gcc-switches"
  
Installed Go in 168ms
/usr/bin/tar xz --overwrite --warning=no-unknown-keyword -C /home/runner -f /home/runner/work/_temp/811fb309-b7a1-454a-a264-8d123d4b2c16
Installed golangci-lint into /home/runner/golangci-lint-1.37.1-linux-amd64/golangci-lint in 798ms
Received 69036137 of 69036137 (100.0%), 73.4 MBs/sec
Cache Size: ~66 MB (69036137 B)
/usr/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/e5fbd38b-6100-403b-884c-492880e5f9c7/cache.tzst -P -C /home/runner/work/mapreduce/mapreduce
Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.25.0/integration_test.go: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.25.0/regenerate.bash: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.25.0/AUTHORS: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.25.0/release.bash: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.25.0/.gitignore: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.25.0/go.mod: Cannot open: File exists

@andig
Copy link
Author

andig commented Mar 5, 2021

Same here using @v2

@kprav33n
Copy link

kprav33n commented Mar 5, 2021

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/golangci-lint-action@v2.4.1
        with:
          version: v1.38.0
          skip-go-installation: true
          skip-pkg-cache: true

@steebchen
Copy link

steebchen commented Mar 14, 2021

I can also confirm that the issue is not solved yet, most likely due to the second invocation of tar.

@SVilgelm Can we please re-open this issue? Thanks.

@lukehinds
Copy link

  • 1 experiencing the same issue.

@JakeCooper
Copy link

@andig
Copy link
Author

andig commented May 23, 2021

Seems due to #221 and should hopefully be fixed now

@sk-
Copy link

sk- commented Jul 8, 2022

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 --overwrite flag.

/usr/bin/tar xz --overwrite --warning=no-unknown-keyword --overwrite -C /home/runner -f /home/runner/work/_temp/e28805ed-42c7-4d53-aa78-baf19cfab942

Shwetha-Acharya added a commit to Shwetha-Acharya/ramen that referenced this issue Jul 26, 2023
Below errors were seen with setup-go@v4 in golangci Lint:
Error: /usr/bin/tar: ../../../go/pkg/mod/sigs.k8s.io/yaml@v1.3.0/yaml_
test.go: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/sigs.k8s.io/yaml@v1.3.0/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

Updates: RamenDR#1000
Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
Shwetha-Acharya added a commit to Shwetha-Acharya/ramen that referenced this issue Jul 27, 2023
Below errors were seen with setup-go@v4 in golangci Lint:
Error: /usr/bin/tar: ../../../go/pkg/mod/sigs.k8s.io/yaml@v1.3.0/yaml_
test.go: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/sigs.k8s.io/yaml@v1.3.0/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

Updates: RamenDR#1000
Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
nirs pushed a commit to RamenDR/ramen that referenced this issue Jul 27, 2023
Below errors were seen with setup-go@v4 in golangci Lint:
Error: /usr/bin/tar: ../../../go/pkg/mod/sigs.k8s.io/yaml@v1.3.0/yaml_
test.go: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/sigs.k8s.io/yaml@v1.3.0/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

Updates: #1000
Signed-off-by: Shwetha K Acharya <sacharya@redhat.com>
orozery added a commit to orozery/clusterlink that referenced this issue Oct 10, 2023
This commit fixes CI linter errors mentioned in:
golangci/golangci-lint-action#135

Signed-off-by: Or Ozeri <oro@il.ibm.com>
orozery added a commit to orozery/clusterlink that referenced this issue Oct 10, 2023
This commit fixes CI linter errors mentioned in:
golangci/golangci-lint-action#135

Signed-off-by: Or Ozeri <oro@il.ibm.com>
justinsb added a commit to justinsb/k8s-config-connector that referenced this issue Feb 27, 2024
justinsb added a commit to justinsb/k8s-config-connector that referenced this issue Feb 27, 2024
justinsb added a commit to justinsb/k8s-config-connector that referenced this issue Feb 27, 2024
@rafapaulin
Copy link

this is still happening on v4 :(

leodido added a commit to listendev/lstn that referenced this issue Mar 21, 2024
See golangci/golangci-lint-action#135

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
leodido added a commit to listendev/lstn that referenced this issue Mar 21, 2024
See golangci/golangci-lint-action#135

Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
@kyrylo
Copy link

kyrylo commented Mar 26, 2024

Same, I installed golangci-lint-action in a fresh project, and my run doesn't work.

This project in its current state is not usable for me, unfortunately 😕

x · kyrylo@1473ccd 2024-03-26 09-43-34

@siburny
Copy link

siburny commented Apr 5, 2024

It appears there is some confusion regarding this issue. There are two different TAR executions that happen during the run:
one that untars the packages and build cache and one that untars the golangci-lint itself. While the latter one was indeed fixed to include the --overwrite the parameter, the former wasn't. This is because they use two different caching packages: @actions/cache and @actions/tool-cache respectively.

I created a PR to fix @actions/cache package to overwrite the files as well: actions/toolkit#1704

AnnaShaleva added a commit to nspcc-dev/neo-go that referenced this issue Apr 18, 2024
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/protobuf@v1.31.0/LICENSE: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/.github/workflows/test.yml: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/README.md: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/annotation_test.go: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/retention_test.go: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/main.go: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/imports/fmt/m.proto: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/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/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.pb.go: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/imports/test_import_all.proto: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/imports/test_import_a1m2.proto: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/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/protobuf@v1.31.0/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/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/imports/test_b_1/m1.proto: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/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/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/imports/test_import_all.pb.go: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/imports/test_import_a1m1.proto: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/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/protobuf@v1.31.0/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/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/imports/test_a_1/m1.proto: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/imports/test_a_1/m2.proto: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/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/protobuf@v1.31.0/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/protobuf@v1.31.0/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/protobuf@v1.31.0/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/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/extensions/ext/ext.proto: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/extensions/ext/ext.pb.go: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/extensions/extra/extra.pb.go: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/extensions/extra/extra.proto: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.proto: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/extensions/proto3/ext3.pb.go: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/extensions/base/base.proto: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/extensions/base/base.pb.go: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/proto2/fields.pb.go: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/proto2/nested_messages.proto: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/proto2/proto2.proto: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/proto2/enum.proto: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/proto2/enum.pb.go: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/proto2/proto2.pb.go: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/proto2/fields.proto: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/proto2/nested_messages.pb.go: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/import_public/b.pb.go: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.31.0/cmd/protoc-gen-go/testdata/import_public/a.proto: Cannot open: File exists
...
```

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
yjian118 added a commit to Wind-River/cloud-platform-deployment-manager that referenced this issue Apr 26, 2024
Below errors were seen with setup-go@v4 in golangci Lint:
Error: /usr/bin/tar: ../../../go/pkg/mod/sigs.k8s.io/yaml@v1.3.0/yaml_
test.go: Cannot open: File exists
/usr/bin/tar: ../../../go/pkg/mod/sigs.k8s.io/yaml@v1.3.0/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
@ldez
Copy link
Member

ldez commented Apr 29, 2024

FYI the caches related to modules and Go build have been removed: #1029

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cache bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.