Cache-pull "failed to extract tar archive"

Description of the issue

I’ve got the following message at the cache-pull step

Start installing (rsync) with apt-get
Step dependency (rsync) installed, available.
Start installing (tar) with apt-get
Step dependency (tar) installed, available.
Cache pull…
=> Downloading and extracting cache archive …
[!] Unable to download or uncompress cache: failed to extract tar archive, output: tar: Unaligned block (6038 bytes) in archive
tar: Error is not recoverable: exiting now, error: exit status 2, retrying…
=> [DONE]
=> Took: 35.264573558s
=> Finished

cache-push step has the following output:

Start installing (tar) with apt-get
Step dependency (tar) installed, available.
Configs:

  • CachePaths:

    • /root/.gradle → /bitrise/src/gradle.deps
    • /root/.kotlin → /bitrise/src/gradle.deps
    • /root/.m2 → /bitrise/src/gradle.deps
    • /root/.android/build-cache → /bitrise/src/gradle.deps
    • /bitrise/src/.gradle
    • /bitrise/src/moduleone/build
    • /bitrise/src/app/build
    • /bitrise/src/build
    • /bitrise/src/c-0/wrapper/dists/gradle-3.3-all/55gk2rcmfc6p2dg9u9ohc3hw9/gradle-3.3/docs/javadoc/org/gradle/tooling/model/build
    • /bitrise/src/c-0/wrapper/dists/gradle-3.3-all/55gk2rcmfc6p2dg9u9ohc3hw9/gradle-3.3/src/internal-integ-testing/org/gradle/integtests/fixtures/build
    • /bitrise/src/c-0/wrapper/dists/gradle-3.3-all/55gk2rcmfc6p2dg9u9ohc3hw9/gradle-3.3/src/tooling-api/org/gradle/tooling/internal/build
    • /bitrise/src/c-0/wrapper/dists/gradle-3.3-all/55gk2rcmfc6p2dg9u9ohc3hw9/gradle-3.3/src/tooling-api/org/gradle/tooling/model/build
    • /bitrise/src/moduletwo/build
  • IgnoredPaths:

    • “/bitrise/src/moduleone/build”,“/bitrise/src/app/build”,“/bitrise/src/build”,“/bitrise/src/moduletwo/build”
    • ~/.gradle/**
    • ~/.android/build-cache/**
    • *.lock
    • *.bin
    • //build/.json
    • //build/.html
    • //build/.xml
    • //build/.properties
    • //build//zip-cache/**
    • *.log
    • *.txt
    • *.rawproto
    • !*.ap_
    • !*.apk
  • CompressArchive: false

  • FingerprintMethodID: file-content-hash

Cleaning paths
Path ignored, does not exists: /root/.kotlin

  • Done
  • Took: 327.367µs

Checking previous cache status

  • Previous cache info found
  • Done
  • Took: 118.844376ms

cache-push yml:

  • cache-push@2.0.1:
    inputs:
    - ignore_check_on_paths: ‘“/bitrise/src/moduleone/build”,“/bitrise/src/app/build”,“/bitrise/src/build”,“/bitrise/src/moduletwo/build”’

Environment:

Standard machine
Android & Docker, on Ubuntu 16.04

What I am trying to do is ommit the build folders from cache. Is my “ignore_check” field format wrong or is something else?

Hey @chronvas

We need some extra information about the application to solve the issue, could you please enable the support user in your application and send us the app URL?

1 Like

Thank you for the information, can you also send the URL of the build where this issue comes up?

1 Like

Sure,

that particular build is successfull, but the cache exclusion does not seem to work.
This workflow was created for investigating why some builds fail when a new commit is pushed to a branch that has an open pull request for another branch. My initial thoughts are caching the bulld folders which I try to “turn off” for now, and see if that problem persists.

Hi again, sorry for the latency, so what you have to do is to upgrade the cache steps to the latest ones and do a cache clear. This solution should solve your problem.

1 Like

Hi, did the suggested steps fixed the issue?

1 Like

Hi
There was a misconception that the cache steps were there to avoid maven from blocking traffic to bitrise when the dependencies were resolved and libraries needed to be downloaded from that cdn.
But, seems the cache mechanism is there to keep build files and folders. Found that by downloading the cache and extracting i. This is what caused the builds to fail.
Removing the cache steps now causes a build from the begining. Which is slower than before, but has no issues with persisted files.
Not sure what causes that to happen (possibly a library update in the gradle file), the same issue happens on a local machine, and fixing it required deleting all the build folders and even restarting android studio.

tldr; the build issues are solved by removing cache steps

1 Like

Alternative solution might be to delete all your caches, which you can do on the Settings tab of the app.