Resolving "Cache key files could not be found" error on Bitbucket pipelines
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
Users might observe "Cache key files could not be found" error during build set up step on pipelines which results in failure of the build
1
2
3
Key file does not exist – Cache key files could not be found.
Key file is outside the repository – Cache key files could not be found.
Cause
Providing incorrect path to the file in YAML config
Error in the file name defined
Presence of lock files
Solution
Verify the file path. The path provided should be an absolute path
1 2 3 4 5 6 7 8
definitions: caches: my-bundler-cache: key: files: - Gemfile.lock - "**/*.gemspec" # glob patterns are supported for cache key files path: vendor/bundle
Check if the file exists in specific branch/repo by navigating through UI
Error reference: https://stackoverflow.com/questions/72345721/gitlab-cache-key-files-file-does-not-exist
Updated on April 11, 2025
Was this helpful?
Still need help?
The Atlassian Community is here for you.