terenceponce
Having trouble compiling Telemetry 0.4.0 under Elixir Alpine
I’m using Phoenix 1.4.8 and I’m trying to use Distillery to compile the app inside Alpine (elixir:1.8.2-alpine). Do I need to install some library to make the compilation work? I’m using Gitlab CI to compile the app:
distillery:
stage: build
image: elixir:1.8.2-alpine
cache:
paths:
- _build
- deps
before_script:
- apk --no-cache add git
- mix local.rebar --force
- mix local.hex --force
- mix deps.get
- mix deps.compile
script:
- MIX_ENV=prod mix release --verbose
$ mix deps.compile
==> inflex
Compiling 6 files (.ex)
Generated inflex app
==> base64url (compile)
Compiled src/base64url.erl
==> gettext
Compiling 1 file (.erl)
Compiling 20 files (.ex)
==> jose
Compiling 90 files (.erl)
Compiling 8 files (.ex)
warning: function Poison.EncodeError.exception/1 is undefined (module Poison.EncodeError is not available)
lib/jose/poison/lexical_encoder.ex:8
Generated jose app
===> Compiling ranch
===> 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"`
==> rarex
** (Mix) Could not compile dependency :telemetry, "/root/.mix/rebar3 bare compile --paths "/builds/rarex/core/_build/dev/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"
Most Liked
hlalvesbr
I had the same problem. It’s not telemetry, it’s old cached files. Delete “_build” and “deps” folders and run “mix deps.get” and “mix deps.compile”. Everything ok now.
mhs
I’m seeing this (occasional :telemetry compile fails) too. I’m not sure how to repro it as it seems to happen randomly once and awhile. I’ve seen it on my local OSX machine as well as on a circleci/elixir:1.9.1-node container.
The relevent part from my CircleCI config looks like this:
elixir_tests:
docker:
- image: circleci/elixir:1.9.1-node
working_directory: ~/repo/api/my_app
steps:
- checkout:
path: ~/repo
- restore_cache:
keys:
- ex-deps-{{ checksum "mix.exs" }}-{{ checksum "mix.lock" }}
- ex-deps-
- run:
name: Install hex and rebar3
command: mix local.hex --force && mix local.rebar --force
- run:
name: App Dependencies
command: MIX_ENV=test mix do deps.get --only test, deps.compile, compile
- save_cache:
paths:
- deps
key: ex-deps-{{ checksum "mix.exs" }}-{{ checksum "mix.lock" }}
- run:
name: ExUnit Tests
command: mix test --cover
- store_artifacts:
path: cover
destination: cover
mix deps.clean telemetry fixes it up if I SSH in and try to interactively manipulate the build.
NobbZ
That might actually be an issue, mix local.rebar installs versions it is known to work with, you should not use a different rebar when compiling mix projects.
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








