From 35590f0c9692ac2e4779f952651d81ee23df607e Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Thu, 24 Mar 2022 14:51:02 +0300 Subject: [PATCH] circleci: update cache key to avoid fetching outdated cache Avoid the following problem: ``` Found a cache from build 55879 at deps- Size: 178 MiB Cached paths: * /go/pkg/mod Downloading cache archive... Validating cache... Unarchiving cache... Failed to unarchive cache Error untarring cache: Error extracting tarball /tmp/cache87609141 : tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod: Cannot mkdir: No such file or directory tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod/cache: Cannot mkdir: No such file or directory tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod/cache/download: Cannot mkdir: No such file or directory tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod/cache/download/cloud.google.com: Cannot mkdir: No such file or directory tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod/cache/download/cloud.google.com/go: Cannot mkdir: No such file or directory tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod/cache/download/cloud.google.com/go/@v: Cannot mkdir: No such file or directory tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod/cache/download/cloud.google.com/go/@v/list: Cannot open: No such file or directory tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod/cache/download/cloud.google.com/go/@v/list.lock: Cannot open: No such file or directory tar: go: Cannot mkdir: Pe: exit status 2 ``` --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2703ce10c..717a6260f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,12 +17,12 @@ commands: gomod: steps: - restore_cache: - keys: [deps-] + keys: [deps-v2-] - run: name: Download go module dependencies command: go mod download - save_cache: - key: deps-{{ checksum "go.sum" }}-{{ checksum "go.sum" }} + key: deps-v2-{{ checksum "go.sum" }}-{{ checksum "go.sum" }} paths: [/home/circleci/go/pkg/mod] jobs: