I just updated the docker images I’m using to the latest CIMG versions. However doing so has caused the cache for my Rails gems to fail to restore. Although rather peculiarly, the cache of Node packages is fine.
Caching process for gems (failing)
- save_cache:
key: gems-v7-{{ checksum "./Gemfile.lock" }}-{{ .Branch }}-{{arch}}
paths:
- /usr/local/bundle/gems/
#...
- restore_cache:
keys:
- gems-v7-{{ checksum "./Gemfile.lock" }}-{{ .Branch }}-{{arch}}
The unpacking fails with the following error:
Found a cache from build 4695 at gems-v7-QzGGUSLOXs_fzenmHY_zxBE+WY4njXIujU5exfZ0CoU=-tester
Size: 81 MiB
Cached paths:
* /usr/local/bundle/gems
Downloading cache archive...
Validating cache...
Unarchiving cache...
Failed to unarchive cache
Error untarring cache: Error extracting tarball /tmp/cache3266232500 : tar: usr/local/bundle:
Cannot mkdir: Permission denied tar: usr/local/bundle/gems:
Cannot mkdir: No such file or directory tar: usr/local/bundle:
Cannot mkdir:...
Caching process for Node packages (working)
- save_cache:
key: 8-npm--{{ .Branch }}-{{arch}}-{{checksum "~/project/angular/package-lock.json"}}
paths:
- ~/project/angular/node_modules/
- /usr/local/bin/node_modules
- /home/circleci/.cache/
#...
- restore_cache:
key: v8-npm--{{ .Branch }}-{{arch}}-{{checksum "~/project/angular/package-lock.json"}}
What would be causing the gems cache to fail to unpack? It looks like some sort of RW permissions issue but I’m not sure how to fix it.