gradle / gradle-build-action

Execute your Gradle build and trigger dependency submission
https://github.com/marketplace/actions/gradle-build-action
MIT License
679 stars 97 forks source link

Error: Cache upload failed because file read failed with EBADF: bad file descriptor, read #1077

Closed zoey-juan closed 5 months ago

zoey-juan commented 5 months ago

Hi, We have checked several discussion and reported issues but still we're getting a bunch of warnings after updating to gradle/actions/setup-gradle@v3. I'm wondering if any suggestions how to fix those issues properly.

Setup

Added the gradle workaround.

    - name: Set /usr/bin/gradle alias to gradlew # workaround: https://github.com/gradle/actions/issues/33
      shell: bash
      run: sudo ln -s "$GITHUB_WORKSPACE/gradlew" /usr/bin/gradle
    - uses: gradle/actions/setup-gradle@v3
      with:
        gradle-version: wrapper
        # Excludes ~/.gradle/caches/build-cache-1/ already provided by GE remote caching
        gradle-home-cache-excludes: caches/build-cache-gu
        gradle-home-cache-cleanup: true
        cache-read-only: false // for testing on non-master branch only

Disable local cache regarding to the readme doc

buildCache {
    local {
        isEnabled = System.getenv("CI") == null
        directory = File(gradle.gradleUserHomeDir, "build-cache-gu")
        removeUnusedEntriesAfterDays = 15
    }
    remote<HttpBuildCache> {
        isEnabled = System.getenv("CI") != null
        isPush = System.getenv("CI") != null
        setUrl("$gradleEnterpriseUrl/cache/")
    }
}

Warnings

Screenshot 2024-05-31 at 20 16 03
  1. build_debug / android-build
    Unhandled error in Gradle post-action - job will continue: Error: Cache upload failed because file read failed with EBADF: bad file descriptor, read
  2. build_debug / android-build
    Failed to save cache entry with path '/home/runner/.gradle/caches/transforms-4/*/ /home/runner/.gradle/caches/*/transforms/*/' and key: gradle-transforms-v1-feb3ccfac262ee449fb58b558de5457a: Error: Cache service responded with 429 during upload chunk.

 

zoey-juan commented 5 months ago

opened in https://github.com/gradle/actions/issues/238