My Elixir/Phoenix app fails only on a particular branch

I use CircleCI to test my Elixir/Phoenix app for several months.

For the past few days I have been plagued by strange phenomena.

While things go well on a topic branch, after merging it into another branch the tests on the CircleCI always fail.

Specifically, they fail on the mix do deps.get, compile phase with these messages:

===> Compiling telemetry
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> When submitting a bug report, please include the output of `rebar3 report "your command"`
** (Mix) Could not compile dependency :telemetry, "/home/circleci/.mix/rebar3 bare compile --paths "/home/circleci/app/_build/test/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile telemetry", update it with "mix deps.update telemetry" or clean it with "mix deps.clean telemetry"

There is no essential difference between the topic branch and the other branch.
I just made minor fixes.
The local tests are green on both branches.

So I suppose this problem is not because of telemetry, but because of the environment of CircleCI or my configuration.

I found the cause of my problem. I have to change my .circleci/config.yml to clear project cache.

The original config (taken from https://circleci.com/docs/ja/2.0/language-elixir/) was:

      - restore_cache:  # restores saved mix cache
      # Read about caching dependencies: https://circleci.com/docs/2.0/caching/
          keys:  # list of cache keys, in decreasing specificity
            - v1-mix-cache-{{ .Branch }}-{{ checksum "mix.lock" }}
            - v1-mix-cache-{{ .Branch }}
            - v1-mix-cache
      - restore_cache:  # restores saved build cache
          keys:
            - v1-build-cache-{{ .Branch }}
            - v1-build-cache

The revised one is:

      - restore_cache:  # restores saved mix cache
          keys:
            - v1-mix-cache-{{ .Branch }}-{{ checksum "mix.lock" }}

The cache saved as v1-mix-cache-{{ .Branch }} was somehow broken.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.