New cimg go 1.15.1 permission error

When running with image circleci/golang:1.13.7, this config works:

      - restore_cache: # restore depedencies
      keys:
        - go-mod-v1-{{ checksum "go.sum" }}

However, when switching to cimg/go:1.15.1, I now get the following error:

Found a cache from build 18320 at go-mod-v1-4WHplXka28aGT9S_FpfR0XH1SRAsTkAd2B20WHVwNX0=
Size: 128 MiB
Cached paths:

  • /go/pkg/mod

Downloading cache archive…
Validating cache…

Unarchiving cache…

Failed to unarchive cache

Error untarring cache: Error extracting tarball /tmp/cache620758939 : 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/bazil.org: Cannot mkdir: No such file or directory tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod/cache/download/bazil.org/fuse: Cannot mkdir: No such file or directory tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod/cache/download/bazil.org/fuse/@v: Cannot mkdir: No such file or directory tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod/cache/download/bazil.org/fuse/@v/list: Cannot open: No such file or directory tar: go: Cannot mkdir: Permission denied tar: go/pkg/mod/cache/download/bazil.org/fuse/@v/list.lock: Cannot open: No such file or directory tar: go: Cannot mkdir: Permission denied tar: go/pkg: exit status 2

What has changed in the new images and how can I fix this?

Hello,

Can you update your cache key so that a new cache is generated when you switch to the new image? Change go-mod-v1-{{ checksum "go.sum" }} to go-mod-v2-{{ checksum "go.sum" }} with the updated image and it should get you going.

1 Like