Erlang 19, Elixir 1.6.1, strange exception

Hello,

I am writing a plugin for VerneMQ and for that I have to use Erlang/OTP 19. So I created a docker container with Erlnag/OTP 19 and Elixir 1.6.1.

elixir -v
Erlang/OTP 19 [erts-8.3.5] [source] [64-bit] [smp:3:3] [async-threads:10] [hipe] [kernel-poll:false]

Elixir 1.6.1 (compiled with OTP 19)

In this container, I can run mix test without an exception. If I try this a second time I get this:

15:39:20.474 [error] beam/beam_load.c(1287): Error loading module hackney_app:
  mandatory chunk of type 'Atom' not found




15:39:20.607 [error] Loading of /src/_build/test/lib/hackney/ebin/hackney_app.beam failed: :badfile


15:39:20.764 [info]  Application hackney exited: exited in: :hackney_app.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function :hackney_app.start/2 is undefined (module :hackney_app is not available)
            (hackney) :hackney_app.start(:normal, [])
            (kernel) application_master.erl:273: :application_master.start_it_old/4
** (Mix) Could not start application hackney: exited in: :hackney_app.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) function :hackney_app.start/2 is undefined (module :hackney_app is not available)
            (hackney) :hackney_app.start(:normal, [])
            (kernel) application_master.erl:273: :application_master.start_it_old/4

Has anyone an idea?

This means you’re trying to load a module compiled with OTP 20 on OTP 19. The default chunks of .beam files changed between the releases.

4 Likes