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

No annotation created if cache exists #385

Closed
ishikawa opened this issue Jan 13, 2022 · 7 comments
Closed

No annotation created if cache exists #385

ishikawa opened this issue Jan 13, 2022 · 7 comments
Labels
area: cache duplicate This issue or pull request already exists

Comments

@ishikawa
Copy link

We're facing a problem that the golangci-lint-action correctly works and found some issues in the PR code, but it won't produce any annotations in the PR. After some investigation, we found that there are many "File exists" errors when decompressing its cache. It prevents GitHub Action from creating annotations to the PR. To resolve this problem, we have to opt-out caches by specifying skip-build-cache and skip-pkg-cache.

Of course, the first time there is no cache, so everything works fine.

2022-01-13T04:40:11.2965429Z Requested golangci-lint 'latest', using 'v1.43.0', calculation took 118ms
2022-01-13T04:40:11.2966576Z Installing golangci-lint v1.43.0...
...
2022-01-13T04:40:12.4949233Z Cache Size: ~153 MB (160100096 B)
2022-01-13T04:40:12.4974487Z [command]/usr/bin/tar --use-compress-program zstd -d -xf /home/runner/work/_temp/51388359-0acc-450c-89a5-fd48615b296c/cache.tzst -P -C /home/runner/work/mywork/mywork
2022-01-13T04:40:13.1883899Z ##[error]/usr/bin/tar: ../../../go/pkg/mod/github.com/spf13/viper@v1.10.1/util_test.go: Cannot open: File exists
2022-01-13T04:40:13.1894488Z ##[error]/usr/bin/tar: ../../../go/pkg/mod/github.com/spf13/viper@v1.10.1/viper_go1_15.go: Cannot open: File exists
2022-01-13T04:40:13.1895338Z /usr/bin/tar: ../../../go/pkg/mod/github.com/spf13/viper@v1.10.1/.gitignore: Cannot open: File exists
2022-01-13T04:40:13.1895930Z ##[error]/usr/bin/tar: ../../../go/pkg/mod/github.com/spf13/viper@v1.10.1/viper_go1_16.go: Cannot open: File exists
2022-01-13T04:40:13.1896876Z ##[error]/usr/bin/tar: ../../../go/pkg/mod/github.com/spf13/viper@v1.10.1/internal/testutil/filepath.go: Cannot open: File exists
2022-01-13T04:40:13.1897722Z ##[error]/usr/bin/tar: ../../../go/pkg/mod/github.com/spf13/viper@v1.10.1/internal/testutil/env_go1_16.go: Cannot open: File exists
2022-01-13T04:40:13.1898515Z ##[error]/usr/bin/tar: ../../../go/pkg/mod/github.com/spf13/viper@v1.10.1/internal/testutil/env_go1_17.go: Cannot open: File exists
...

Our workflow settings:

- name: lint
  uses: golangci/golangci-lint-action@v2
  with:
    version: latest
@joaocostamm
Copy link

Same issue for me

@SVilgelm
Copy link
Member

Could you please use the latest version that we released yesterday? One issue with caching was resolved.

- name: lint
  uses: golangci/golangci-lint-action@v3
  with:
    version: latest

@vtopc
Copy link

vtopc commented Jun 27, 2022

@SVilgelm, didn't help me.

@FelipeLema
Copy link

FelipeLema commented Jul 8, 2022

may be related to #496

we're using v3 there

@lucacome
Copy link

lucacome commented Nov 17, 2022

I'm seeing something similar, as in that we don't get annotations

Run golangci/golangci-lint-action@v3
  with:
    only-new-issues: true
    github-token: ***
    skip-cache: false
    skip-pkg-cache: false
    skip-build-cache: false
prepare environment
  Finding needed golangci-lint version...
  Requested golangci-lint 'latest', using 'v1.50.1', calculation took 49ms
  Installing golangci-lint v1.50.1...
  Downloading https://github.com/golangci/golangci-lint/releases/download/v1.50.1/golangci-lint-1.50.1-linux-amd64.tar.gz ...
  Writing patch to /tmp/tmp-1761-sR1sB5fiDf7Y/pull.patch
  /usr/bin/tar xz --overwrite --warning=no-unknown-keyword --overwrite -C /home/runner -f /home/runner/work/_temp/ac93a03b-fe62-4287-8058-968380a24a6f
  Installed golangci-lint into /home/runner/golangci-lint-1.50.1-linux-amd64/golangci-lint in 941ms
  Received 171966464 of 241788661 (71.1%), 163.5 MBs/sec
  Received 241788661 of 241788661 (100.0%), 155.6 MBs/sec
  Cache Size: ~231 MB (241788661 B)
  /usr/bin/tar --use-compress-program unzstd -xf /home/runner/work/_temp/9e869f5e-85bf-4926-9dee-756b9697889d/cache.tzst -P -C /home/runner/work/kubernetes-ingress/kubernetes-ingress
...
  Error: /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/oauth2@v0.0.0-20220909003341-f21342109be1/stackoverflow/stackoverflow.go: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/oauth2@v0.0.0-20220909003341-f21342109be1/vk/vk.go: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/oauth2@v0.0.0-20220909003341-f21342109be1/oauth2.go: Cannot open: File exists
  Error: /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/oauth2@v0.0.0-20220909003341-f21342109be1/fitbit/fitbit.go: Cannot open: File exists
  /usr/bin/tar: ../../../go/pkg/mod/golang.org/x/oauth2@v0.0.0-20220909003341-f21342109be1/CONTRIBUTING.md: Cannot open: File exists
  /usr/bin/tar: Exiting with failure status due to previous errors
  Warning: Failed to restore: Tar failed with error: The process '/usr/bin/tar' failed with exit code 2
  Cache not found for input keys: golangci-lint.cache-2758-0bc2bb025ceba06555192588e80c455eb31482c8, golangci-lint.cache-2758-
  Prepared env in 6239ms

but at the end it says Cache not found 🤔

@bschaatsbergen
Copy link

bschaatsbergen commented Dec 5, 2023

Interesting that this isn't fixed yet, I'm simply copying the workflow file recommended to use in the README and the annotations are not being created.

I can workaround this issue by setting both: skip-pkg-cache and skip-build-cache to true.

@ldez ldez added the duplicate This issue or pull request already exists label May 4, 2024
@ldez
Copy link
Member

ldez commented May 4, 2024

Duplicate of #135

@ldez ldez marked this as a duplicate of #135 May 4, 2024
@ldez ldez closed this as completed May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cache duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

8 participants