CircleCI-Public / flutter-orb

Easily install Flutter SDK and package dependencies. Also wasily run unit test and lint. Supports Linux and macOS
https://circleci.com/developer/orbs/orb/tadashi0713/flutter-orb
MIT License
2 stars 16 forks source link

Permission denied downloading cache when resource class changed #31

Closed aluu4445 closed 11 months ago

aluu4445 commented 11 months ago

Orb version: 2.0.2

What happened:

When I change the resource class on CircleCI for an android-machine executor, the restoring cache step of flutter/install_sdk_and_pub is unable to restore the cache due to a permissions issue. It slowly goes through each file in the cache with the same error for 20 minutes+:

Found a cache from build 15564 at flutter-3.7.10-arch1-linux-amd64-6_85
Size: 705 MiB
Cached paths:
  * /root/development

Downloading cache archive...
Unarchiving cache...
Skipping writing "root/development/" - mkdir /root/development: permission denied
Skipping writing "root/development/flutter/" - mkdir /root/development: permission denied
...

There is a cache_version parameter for install_sdk_and_pub but looking at the orb source it only gets passed into install_pub and not install_sdk so there's no way to clear the cache for install_sdk:

        steps:
            - install_sdk:
                install-location: <<parameters.install-location>>
                version: <<parameters.version>>
            - install_pub:
                app-dir: <<parameters.app-dir>>
                cache-version: <<parameters.app-dir>>

Expected behavior:

There should be a cache_version parameter for install_sdk so the cache can be cleared. If a resource class change causes a cache hit, it should not run into this permission issue. If it does run into the permission issue it should not slowly go through each files for 20 minutes+, but instead treat it as a cache miss.

ryanbourdais commented 11 months ago

Hi @aluu4445 did you change only recourse classes or did you also make the change from cimg/android to the machine executor as well?

aluu4445 commented 11 months ago

Hi @aluu4445 did you change only recourse classes or did you also make the change from cimg/android to the machine executor as well?

Did not change the executor at all, just added resource_class: xlarge to the existing one

ryanbourdais commented 11 months ago

Hi @aluu4445 can you provide a link for builds before and after this change?

aluu4445 commented 11 months ago

Hi @aluu4445 can you provide a link for builds before and after this change?

Unfortunately not, it's a private repo.

EDIT: I can share the restoring cache steps: Before: https://pastebin.com/g67meFFv After: https://gist.github.com/aluu4445/75a1447f9eb12b21895a3446aedfe444

ryanbourdais commented 11 months ago

Hi @aluu4445 I don't believe that this is a problem with the orb. I think you may want to reach out to support to resolve this issue.