terenceponce

terenceponce

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"

Showing Posts 1 to 10

tristan

tristan

Rebar3 Core Team

Can you run with the environment variable DEBUG=1 or copy out the rebar3.crashdump file from the container so the error can be seen?

terenceponce

terenceponce OP

Here’s what I got when I ran it again:

$ DEBUG=1 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
===> Expanded command sequence to be run: []
===> Provider: {default,do}
===> Expanded command sequence to be run: [{default,app_discovery},
                                           {bare,compile}]
===> Provider: {default,app_discovery}
===> Provider: {bare,compile}
===> Compiling ranch
===> run_hooks("/builds/rarex/core/deps/ranch", pre_hooks, compile) -> no hooks defined

===> run_hooks("/builds/rarex/core/deps/ranch", pre_hooks, erlc_compile) -> no hooks defined

===> erlopts [debug_info]
===> files to compile ["/builds/rarex/core/deps/ranch/src/ranch_app.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_acceptors_sup.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_crc32c.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_server.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_transport.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_protocol.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_tcp.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_conns_sup.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_sup.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_acceptor.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_listener_sup.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_proxy_header.erl",
                       "/builds/rarex/core/deps/ranch/src/ranch_ssl.erl"]
===> run_hooks("/builds/rarex/core/deps/ranch", post_hooks, erlc_compile) -> no hooks defined

===> run_hooks("/builds/rarex/core/deps/ranch", pre_hooks, app_compile) -> no hooks defined

===> run_hooks("/builds/rarex/core/deps/ranch", post_hooks, app_compile) -> no hooks defined

===> run_hooks("/builds/rarex/core/deps/ranch", post_hooks, compile) -> no hooks defined

===> Expanded command sequence to be run: []
===> Provider: {default,do}
===> Expanded command sequence to be run: [{default,app_discovery},
                                           {bare,compile}]
===> Provider: {default,app_discovery}
===> Provider: {bare,compile}
===> Compiling telemetry
===> run_hooks("/builds/rarex/core/deps/telemetry", pre_hooks, compile) -> no hooks defined

===> run_hooks("/builds/rarex/core/deps/telemetry", pre_hooks, erlc_compile) -> no hooks defined

===> erlopts [debug_info]
===> files to compile ["/builds/rarex/core/deps/telemetry/src/telemetry_app.erl",
                       "/builds/rarex/core/deps/telemetry/src/telemetry_handler_table.erl",
                       "/builds/rarex/core/deps/telemetry/src/telemetry_sup.erl",
                       "/builds/rarex/core/deps/telemetry/src/telemetry.erl"]
===> Uncaught error in rebar_core. Run with DEBUG=1 to see stacktrace or consult rebar3.crashdump
===> Uncaught error: {badmatch,{error,enoent}}
===> Stack trace to the error location:
[{rebar_erlc_compiler,modify_erlcinfo,5,
                      [{file,"/home/tristan/Devel/rebar3/_build/prod/lib/rebar/src/rebar_erlc_compiler.erl"},
                       {line,477}]},
 {rebar_erlc_compiler,'-update_erlcinfo_fun/2-fun-0-',4,
                      [{file,"/home/tristan/Devel/rebar3/_build/prod/lib/rebar/src/rebar_erlc_compiler.erl"},
                       {line,463}]},
 {lists,foldl,3,[{file,"lists.erl"},{line,1263}]},
 {rebar_erlc_compiler,update_erlcinfo,3,
                      [{file,"/home/tristan/Devel/rebar3/_build/prod/lib/rebar/src/rebar_erlc_compiler.erl"},
                       {line,448}]},
 {rebar_erlc_compiler,'-update_erlcinfo_fun/2-fun-0-',4,
                      [{file,"/home/tristan/Devel/rebar3/_build/prod/lib/rebar/src/rebar_erlc_compiler.erl"},
                       {line,463}]},
 {lists,foldl,3,[{file,"lists.erl"},{line,1263}]},
 {rebar_erlc_compiler,init_erlcinfo,4,
                      [{file,"/home/tristan/Devel/rebar3/_build/prod/lib/rebar/src/rebar_erlc_compiler.erl"},
                       {line,411}]},
 {rebar_erlc_compiler,compile_dirs,5,
                      [{file,"/home/tristan/Devel/rebar3/_build/prod/lib/rebar/src/rebar_erlc_compiler.erl"},
                       {line,195}]}]
===> 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"
tristan

tristan

Rebar3 Core Team

Have you tried with the cache deleted? I think this can also happen if some of what you have cached is not readable..

terenceponce

terenceponce OP

I haven’t tried that yet although the app I’m doing this on is pretty fresh, so I’m not sure if this is the cause. So does this mean that I don’t need to install any libraries using apk before doing the compilation?

NobbZ

NobbZ

Seeing this path in a dockerized build makes me think…

It looks like a path from your host OS, not like one I’d expect to see in the guest.

Can you please verify that you have deps and _build in your .dockerignore?

tristan

tristan

Rebar3 Core Team

No, that is actually my path :). It is using an old prebuilt rebar3 escript that was built on my machine.

NobbZ

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.

tristan

tristan

Rebar3 Core Team

They aren’t, it is using the version installed my mix local.rebar.

NobbZ

NobbZ

Can you share access to the code? Or at least recreate the issue in a clean/fresh phoenix application which we could clone and experiment with?

tristan

tristan

Rebar3 Core Team

This is unrelated to apk, I’m simply suggesting rerunning without _build and deps cached (and deleted locally in case you are including them in the context, better to put them in .dockerignore).

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New
ChrisAmelia
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication): toke...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews