If you find yourself in a situation where your cache is being restored successfully but you believe that the files you are expecting are missing, take a look at the size of the cache being restored in the Restoring cache
step.
Example output:
Found a cache from build 1 at v1-CACHE_KEY
Size: 32 B Cached paths: * /home/circleci/...
Downloading cache archive...
Validating cache...
Unarchiving cache...
The 32B file size indicates the size of an empty tarball which was created in the previous save cache
step.
You will also often see in the save_cache
step that the step has been skipped as the contents have not changed due to them being empty.
Skipping cache generation, cache already exists for key:
Solution
Take a look at the save cache
step and ensure the proper paths are being saved and their contents are not empty.
You can implement ls
commands within your config to help identify what files are going to be saved or connect to your container over SSH to manually inspect the contents.
Comments
Article is closed for comments.