subosito / flutter-action

Flutter environment for use in GitHub Actions. It works on Linux, Windows, and macOS.
MIT License
2.16k stars 191 forks source link

Error destination path already exists and is not an empty directory when running step 'flutter pub get' #277

Closed trietfidelia closed 3 months ago

trietfidelia commented 3 months ago

Currently I am setting up github action for my flutter project. My workflows ran successfully several times until today the error below appeared. I have tried many ways to delete data in the ~/pub-cache/ folder but still get bellow error. Does anyone have any solution for this problem? Thank you very much

Error:

Git error. Command: `git clone --mirror https://github.com/******/my-app.git /c/Users/runneradmin/.pub-cache\git\cache\my-app-f653a1ef882151d633962cffcc7c2526653f0bbe`
stdout: 
stderr: fatal: destination path '/c/Users/runneradmin/.pub-cache\git\cache\my-app-f653a1ef882151d633962cffcc7c2526653f0bbe' already exists and is not an empty directory.
exit code: 128
Error: Process completed with exit code 69.

Code workflow:

- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
  with:
    flutter-version: "3.19.0"
    channel: 'stable'
    cache: true 
    cache-key: 'flutter-windows-stable-3.19.0-x64-df832a426eb5e0e80d12333cd7ee7419ab58ff49'
    cache-path: '${{ runner.tool_cache }}/flutter/stable-3.19.0-x64'
    architecture: x64

- name: Setup credentials to access private repositories
  run: git config --global url.https://${{ secrets.ACCESS_TOKEN }}@github.com/.insteadOf https://github.com/

- name: Clean cache
  run: dart pub cache clean --force

- name: Clean and get Flutter packages
  run: flutter clean && flutter pub get
Zensonaton commented 3 months ago

Same issue here. This problem does not occur on Ubuntu machine, but on Windows it does.

It feels like latest release of flutter-action broke it somehow.

UPD: Yeah, v2.13.0 of flutter-action is broken. Specifying v2.12.0 fixes the issue:

- name: Set up Flutter
  uses: subosito/flutter-action@v2.12.0
  with:
    channel: "stable"
    cache: true
trietfidelia commented 3 months ago

Same issue here. This problem does not occur on Ubuntu machine, but on Windows it does.

It feels like latest release of flutter-action broke it somehow.

UPD: Yeah, v2.13.0 of flutter-action is broken. Specifying v2.12.0 fixes the issue:

- name: Set up Flutter
  uses: subosito/flutter-action@v2.12.0
  with:
    channel: "stable"
    cache: true

@Zensonaton Wow, I didn't notice this, I was just looking at the their latest commit. It's true that when I downgraded the version, everything worked like before, thank you very much. Hope they will handle this issue soon

iampopal commented 3 months ago

Same issue here. This problem does not occur on Ubuntu machine, but on Windows it does.

It feels like latest release of flutter-action broke it somehow.

UPD: Yeah, v2.13.0 of flutter-action is broken. Specifying v2.12.0 fixes the issue:

- name: Set up Flutter
  uses: subosito/flutter-action@v2.12.0
  with:
    channel: "stable"
    cache: true

True Life saver. been searching for a solution all day