Why am I getting "Failed to pack new cache" error during builds?

Last updated: July 27, 2026

Context

You may encounter a "Failed to pack new cache" error during your build process, along with messages indicating that certain cache paths are not found. This typically occurs when there are issues with the cache configuration in your workflow, such as duplicate cache path entries or incorrect path specifications.

Answer

The most common cause of this error is having duplicate cache paths defined in your workflow configuration.

workflows:
  example-workflow:
    cache:
      cache_paths:
        - ~/.gradle/caches
        - ~/.gradle/caches

To resolve this issue:

  1. Review your workflow cache configuration and look for any duplicate entries

  2. Check specifically for paths like /Users/builder/.gradle/caches or ~/.gradle/caches that may be defined multiple times

  3. Remove any duplicate cache path entries from your configuration

  4. Save your workflow configuration and trigger a new build

After removing the duplicate cache paths, your build should complete successfully without the caching error.

If the issue persists, please contact support for further investigation.