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

Stale workflow fails to override cache. #1131

Open
1 of 5 tasks
mshima opened this issue Jan 29, 2024 · 4 comments
Open
1 of 5 tasks

Stale workflow fails to override cache. #1131

mshima opened this issue Jan 29, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@mshima
Copy link

mshima commented Jan 29, 2024

Description:
We have a stale workflow: https://github.com/jhipster/generator-jhipster/blob/main/.github/workflows/stale.yml

At first run it successfully generates a cache entry.

After that, the cache is never updated and is reused, so cached entries are never analyzed again.
See builds 599-605 at https://github.com/jhipster/generator-jhipster/actions/workflows/stale.yml

See 2 consecutive days have same cached issue numbers:
https://github.com/jhipster/generator-jhipster/actions/runs/7689412024/job/20951825772
https://github.com/jhipster/generator-jhipster/actions/runs/7682085625/job/20936000418

The error reported is:
Warning: Error delete _state: [403] Resource not accessible by integration

Are we missing a configuration? A permission maybe? There is no info in the docs.

Action version:
v9

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Repro steps:
Links above.

Expected behavior:
A new cache should be written at every run.

Actual behavior:
New cache are not been overridden

@mshima mshima added bug Something isn't working needs triage labels Jan 29, 2024
@HarithaVattikuti
Copy link

Hello @mshima
Thank you for creating this issue. We will investigate it and get back to you as soon as we have some feedback.

@csuermann
Copy link

Looks like issues already processed in previous runs never get closed due to the cache.

.github/workflows/stale.yaml:

name: 'Close stale issues'
on:
  workflow_dispatch:
  schedule:
    - cron: '30 1 * * *'
permissions:
  issues: write

jobs:
  stale:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/stale@v9
        with:
          stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
          days-before-stale: 30
          days-before-close: 5
Run actions/stale@v9
Cache Size: ~0 MB (307 B)
/usr/bin/tar -xf /home/runner/work/_temp/f4844f75-67b0-4546-8244-42b90d2f9d54/cache.tzst -P -C /home/runner/work/xxx --use-compress-program unzstd
Cache restored successfully
state: restored with info about 12 issue(s)
Starting the stale action process...
Processing the batch of issues  #1  containing  11  issues...
[#239] Issue #239
[#238] Issue #238
[#237] Issue #237
[#235] Issue #235
[#234] Issue #234
[#231]            issue skipped due being processed during the previous run
[#229]            issue skipped due being processed during the previous run
[#227]            issue skipped due being processed during the previous run
[#222]            issue skipped due being processed during the previous run
[#221]            issue skipped due being processed during the previous run
[#219]            issue skipped due being processed during the previous run
Batch  #1  processed.
No more issues found to process. Exiting...
Statistics:
Processed issues: 5
Fetched items: 11
Operations performed: 2
Github API rate used: 2
Github API rate remaining: 997; reset at: Wed Feb 07 2024 02:59:48 GMT+0000 (Coordinated Universal Time)
state: persisting info about 0 issue(s)
Warning: Error delete _state: [403] Resource not accessible by integration
the state will be removed
Received 307 of 307 (100.0%), 0.0 MBs/sec

@mshima
Copy link
Author

mshima commented Feb 7, 2024

As workaround:

  • manually delete the cache.
  • make sure every run processes every issue so cache is not created.

@anomiex
Copy link

anomiex commented Feb 22, 2024

I think the docs are missing that the actions: write permission is needed.

I saw the "Error delete _state: [403] Resource not accessible by integration" error here in a test repo while trying to reproduce a different issue, and based on the docs for the API used I added that permission and the error went away.

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

No branches or pull requests

4 participants