Skip to content

Cache fails for Pull Request re-runs with "No scopes with read permission were found on the request." #208

Closed

Description

@jcornaz

In pull requests we often get:

[warning]No scopes with read permission were found on the request.

And the build runs without cache.

Please note that I'm talking about pull request build triggered when pushing a commit (or opening the PR). So this issue is not explained by #129.

Activity

  1. added
    bug
    on Mar 6, 2020
  2. joshmgross commented on Mar 6, 2020

    @joshmgross
    Contributor

    Can you provide an example of when this occurs?
    Do you see it on the first PR run, or when re-running a PR?

  3. jcornaz commented on Mar 6, 2020

    @jcornaz
    Author

    Can you provide an example of when this occurs?

    Not really sorry. I am not allowed to share that sources. I'll try to create a simple reproducer if I can.

    Do you see it on the first PR run, or when re-running a PR?

    If I look at the latest occurrence of the problem, it was when pushing a new commit to a PR already built.

  4. jcornaz commented on Mar 6, 2020

    @jcornaz
    Author

    In the hope it helps, here is more information:

    • We configured action/checkout to build the HEAD of the PR branch (not the merge commit).
          - uses: actions/checkout@v2
            with:
              ref: ${{ github.event.pull_request.head.sha }}
    • Here is how we configure the workflow to run on build requests:
    on:
      pull_request:
        branches:
          - master
        paths-ignore:
          - '**/*.md'
    • The workflow is composed of multiple jobs, all using the same cache key.
      • One initial job. runs alone
      • The next jobs run all in parallel and use matrix strategies. That causes ~ 20 concurrent fetches of the same cache.
  5. bxq2011hust commented on Mar 8, 2020

    @bxq2011hust

    I have the same problem.
    Sometimes a pr runs without cache and GitHub Action output.

    [warning]No scopes with read permission were found on the request.

    Today I meet the problem after I cancel and rerun. Here is the link
    https://github.com/FISCO-BCOS/FISCO-BCOS/pull/1402/checks?check_run_id=493039648

     Run actions/cache@v1 0s
    [warning]No scopes with read permission were found on the request.
    Run actions/cache@v1
    [warning]No scopes with read permission were found on the request.
      Run actions/cache@v1 1s
    [warning]No scopes with read permission were found on the request.
    Run actions/cache@v1
    [warning]No scopes with read permission were found on the request.
  6. joshmgross commented on Mar 9, 2020

    @joshmgross
    Contributor

    @bxq2011hust Thanks! I believe there's a bug that re-running a PR will use a different ref (https://github.community/t5/GitHub-Actions/GITHUB-REF-is-inconsistent/td-p/48129). This fails our validation as we currently only allow caching on PRs that use refs/pulls/* type refs.

    @jcornaz can you confirm if all of these cache failures were from re-running a failed PR?

  7. Raul6469 commented on Mar 9, 2020

    @Raul6469

    Hi! I do have the same error message, however it also happens sometimes when I run a workflow for the first time, not necessarily after a re-run. Unfortunately, it looks like this issue happens quite randomly...

  8. joshmgross commented on Mar 9, 2020

    @joshmgross
    Contributor

    @Raul6469 could you provide a workflow file or an example run where this occurs?

  9. Raul6469 commented on Mar 10, 2020

    @Raul6469

    I cannot give a link to a run since it's from a private repo, but here is one of the four jobs of the workflow. When the cache issue happens, it happens for all jobs of the workflow. Workflow is triggered on pull_request events.

    And after some thought, I'm not 100% sure that the issue happened without a rerun 🤔 I'll let you know if it happens again

      lint:
        name: 'Lint'
    
        runs-on: ubuntu-latest
    
        timeout-minutes: 5
    
        steps:
        - uses: actions/checkout@v1
    
        - name: Use Node.js 8
          uses: actions/setup-node@v1
          with:
            node-version: 8
    
        - name: Cache npm
          id: node_modules
          uses: actions/cache@v1
          with:
            path: ~/.npm
            key: node-${{ hashFiles('**/package-lock.json') }}
            restore-keys: |
              node-
    
        - name: Install dependencies
          run: npm i
    
        - name: Run linter
          run: npm run lint -- --quiet
  10. jcornaz commented on Mar 10, 2020

    @jcornaz
    Author

    @joshmgross I found a pull request that encountered this issue on the first build of the pull request.

    So no, these cache failures don't happen only when re-running a failed PR.

  11. joshmgross commented on Mar 10, 2020

    @joshmgross
    Contributor

    @jcornaz or @Raul6469, if you can give me the Run ID then I can look up the relevant info on my end.

    You should see this value in the URL of a run. For example, the run https://github.com/actions/cache/actions/runs/45076896 has a Run ID of 45076896

  12. jcornaz commented on Mar 10, 2020

    @jcornaz
    Author

    @joshmgross, Here is the run id of the PR I mentioned encountering the issue on the first build: 489954217.

  13. joshmgross commented on Mar 10, 2020

    @joshmgross
    Contributor

    @jcornaz Can you confirm that 489954217 is the correct number? It's a little larger than I'd expect

  14. jcornaz commented on Mar 10, 2020

    @jcornaz
    Author

    @jcornaz Can you confirm that 489954217 is the correct number? It's a little larger than I'd expect

    Yes it is correct. if I go to https://github.com/REPO_OWNER/REPO/runs/489954217 i get the log of the concerned run.

  15. sjackman commented on Mar 30, 2020

    @sjackman

    I've also experienced this error.

    [warning]No scopes with read permission were found on the request.
    …
    Post job cleanup.
    [warning]No scopes with write permission were found on the request.
    

    @joshmgross See for example run ID 540544450

  16. 18 remaining items

  17. added a commit that references this issue on Apr 16, 2020
  18. joshmgross commented on May 19, 2020

    @joshmgross
    Contributor

    👋 Hey all, thank you for your patience. Pull Request re-runs should now have the correct GitHub Ref and work with this action.

  19. ahsanfarooq3423 commented on May 12, 2022

    @ahsanfarooq3423

    In the hope it helps, here is more information:

    • We configured action/checkout to build the HEAD of the PR branch (not the merge commit).
          - uses: actions/checkout@v2
            with:
              ref: ${{ github.event.pull_request.head.sha }}
    • Here is how we configure the workflow to run on build requests:
    on:
      pull_request:
        branches:
          - master
        paths-ignore:
          - '**/*.md'
    • The workflow is composed of multiple jobs, all using the same cache key.

      • One initial job. runs alone
      • The next jobs run all in parallel and use matrix strategies. That causes ~ 20 concurrent fetches of the same cache.

    Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions