When try to save cache receive error


I tried to use the save-cache step however I got an error, I’m doing something wrong?

`Error computing cache key: template: cacheKey:1:29: executing “cacheKey” at <checksum "animal.clj…>: error calling checksum: open /home/circleci/animal/animal.clj: no such file or directory``

project: https://circleci.com/gh/meltwater/animal/276



As a sanity check, can you add a step “ls /home/circleci/animal/animal.clj” before the cache save step?


@Eric build running now if you comment: https://circleci.com/gh/meltwater/animal/277


@Eric : ls: cannot access /home/circleci/animal/animal.clj: No such file or directory


Yep, I just saw that too. That explains the cache save error–this file doesn’t exist. Is animal.clj checked into your repo?

I also notice this is an Elixir app, but that file has a Clojure extension. Is that a mistake?


humm. I thought this cache key circleci create on the fly when you ask to save cache

I dont have the animal.clj file.
but I guess I understood now how it works


This is valuable feedback. We’ll revisit the explanation of filename cache keys in our documentation.

Just to clarify, the filename cache key will use the contents of a file you specify. Generally, good candidates for this will be your dependency manifest. For instance, this would be package.json for npm, Gemfile or Gemfile.lock for Ruby, and mix.exs for Elixir.

Dependency manifests are a good to use for filename cache keys. When you change your dependencies and commit them, your next CircleCI 2.0 build will hash that file and get a different key. That different key won’t match an existing cache, so you’ll get a new set a dependencies and then cache-save that.