Skip to content

Very long execution of post action/cache@v1 #95

Closed

Description

@Komar0ff

Problem

The average step time is about 4-6 hours🤕
Unfortunately, the reason why the step is being performed for so long is not clear. Logs do not open

Снимок экрана 2019-11-14 в 14 44 18

Workflow:

...
steps:
  - uses: actions/checkout@v1
  - uses: actions/setup-node@v1
       with:
         node-version: '12.x'
  - uses: actions/cache@v1
      with:
        path: node_modules
        key: node-${{ hashFiles('**/package-lock.json') }}
  - name: Setup npm
    run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc
  - name: Bootstrap
    run: npm i
...

Any idea what might have gone wrong?

Activity

  1. joshmgross commented on Nov 14, 2019

    @joshmgross
    Contributor

    Hey @Komar0ff, sorry you're hitting this. We had some service issues the past couple of days, and it's possible that your run was affected by this.

    Do you repeatedly see this issue? If so, could you link me to an example run?

  2. added
    bug
    on Nov 14, 2019
  3. nklayman commented on Nov 16, 2019

    @nklayman

    I only get this issue on Windows, it works fine on Ubuntu. Here is a pr with runs that take many hours: nklayman/vue-cli-plugin-electron-builder#552, and a specific example.

  4. joshmgross commented on Nov 20, 2019

    @joshmgross
    Contributor

    @nklayman Could you turn on debug logging and see if you can get another repro?

  5. IchHabRecht commented on Dec 17, 2019

    @IchHabRecht

    It seems, I'm having the same issue for one of my repositories https://github.com/IchHabRecht/content_defender/commit/319e623fab7087e70e13474c120d38bd8c9d8d5e/checks?check_suite_id=362349005

    I turned on all debug information. Maybe anyone can help me to find the problem.

  6. TingluoHuang commented on Dec 17, 2019

    @TingluoHuang
    Member

    @IchHabRecht I forked your repo and i noticed it's hang during key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}, everything start working when i remove the hashFiles part. I am continue debug try to figure out what's wrong with hashfiles

  7. IchHabRecht commented on Dec 18, 2019

    @IchHabRecht

    @TingluoHuang thanks for your work and information. Please let me know if I can do anything to find the problem.

  8. TingluoHuang commented on Dec 18, 2019

    @TingluoHuang
    Member

    @IchHabRecht looks like your functional tests are creating symlink loop which cause the runner stuck on find all files to hash

    /home/runner/work/content_defender/content_defender/.Build/public/typo3conf/ext/content_defender ->/home/runner/work/content_defender/content_defender
    
    /home/runner/work/content_defender/content_defender/.Build/public/typo3temp/var/tests/functional-1d3fcff/typo3conf/ext/content_defender -> /home/runner/work/content_defender/content_defender
     
    /home/runner/work/content_defender/content_defender/.Build/public/typo3temp/var/tests/functional-278ffc0/typo3conf/ext/content_defender -> /home/runner/work/content_defender/content_defender
    
    /home/runner/work/content_defender/content_defender/.Build/public/typo3temp/var/tests/functional-440e983/typo3conf/ext/content_defender -> /home/runner/work/content_defender/content_defender
    
    /home/runner/work/content_defender/content_defender/.Build/public/typo3temp/var/tests/functional-529ffc0/typo3conf/ext/content_defender  -> /home/runner/work/content_defender/content_defender
    
    /home/runner/work/content_defender/content_defender/.Build/public/typo3temp/var/tests/functional-73aca13/typo3conf/ext/content_defender -> /home/runner/work/content_defender/content_defender
    

    I will file issue and fix the runner to handle the loop gracefully, to mitigate, you might want to fix it by stop creating symlink look in your functional test.

  9. IchHabRecht commented on Dec 18, 2019

    @IchHabRecht

    Hi @TingluoHuang,

    Thank you for your feedback. Unfortunately creating the symlink is how functional testing for/with TYPO3 works currently. There is no chance to mitigate that. But I'm a bit surprised that the .Build folder is included in any file search as only the composer cache folder should be cached?! Not sure how things work in the runner but shouldn't only the cache target be included in any hash generation? Is there any way to simple exclude the whole .Build folder from the runner handling?

  10. TingluoHuang commented on Dec 18, 2019

    @TingluoHuang
    Member

    @IchHabRecht
    in your yaml file:

    - name: Cache composer dependencies
      uses: actions/cache@v1
      with:
        path: ${{ steps.composer-cache.outputs.dir }}
        key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
        restore-keys: ${{ runner.os }}-composer-
    

    You set key to ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}, which will make the runner find all files under GitHub.Workspace that match **/composer.json and hash them. the cache target are not included in the hash generation.

    We don't support exclusion right now.

    If you want the cache key by the composer.json under your repository root, maybe you can do
    key: ${{ runner.os }}-composer-${{ hashFiles('composer.json') }} to avoid the file search

  11. IchHabRecht commented on Dec 19, 2019

    @IchHabRecht

    @TingluoHuang thank you so much for your help. I just took this caching script from another action example but didn't realize the composer.json is taken from folders recursively. Changing the path does indeed help to solve my problem.

  12. added a commit that references this issue on Dec 20, 2019
  13. JLHwung commented on Dec 20, 2019

    @JLHwung
    Contributor

    Removing the glob star in the hashFiles argument does not help in my case: JLHwung/babel@a6b4865, where the cache post action time has outweighed CI execution.

  14. TingluoHuang commented on Jan 2, 2020

    @TingluoHuang
    Member

    This problem are mostly caused by the symlink loop under node_modules, we are working on change the hashFiles() function to handle symlink

    actions/runner#234

  15. nklayman commented on Jan 2, 2020

    @nklayman

    My repo does have a symlink to itself in node modules.

  16. cyangOL commented on Feb 28, 2020

    @cyangOL

    This problem happens randomly with our testing flows.

  17. joshmgross commented on Apr 2, 2020

    @joshmgross
    Contributor

    👋 hashFiles has been fixed on the runner to correctly handle symlink loops (see actions/runner#234).

    Can someone confirm that this issue is resolved?

  18. nklayman commented on Apr 4, 2020

    @nklayman
  19. jagregory commented on Apr 5, 2020

    @jagregory

    Looking good so far. 5 hours down to 25 seconds 😍

    I'll run a few more builds through it today, but it's looking great right now. Thanks everyone.

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