cengkarim

cengkarim

Distillery: sasl.app does not exist or cannot be loaded

Hi folks,

An Elixir beginner here. I’m reading the Programming Elixir 1.6 book and I’m in chapter 20, at using Distillery to release the app. Things are a bit outdated but I managed to find my way until this point where calling: mix distillery.release --env=prod is failing with this error messasge:
==> Invalid application `:sasl`! The file sasl.app does not exist or cannot be loaded.

I’m using elixir: "~> 1.15" and {:distillery, "~>2.0"} in my mix.exs.

I tried {:distillery, "~>2.1"} with no success. Looked up online and couldn’t find much information to help root cause the issue. Any clue what I’m missing here? Thanks!

❯ mix distillery.init

An example config file has been placed in rel/config.exs, review it,
make edits as needed/desired, and then run `mix distillery.release` to build the release

❯ mix distillery.release --env=prod
==> Assembling release..
==> Building release sequence_supervisor:0.1.0 using environment prod
==> Invalid application `:sasl`! The file sasl.app does not exist or cannot be loaded.

❯ iex --version
IEx 1.15.7 (compiled with Erlang/OTP 26)

❯ elixir --version
Erlang/OTP 27 [erts-15.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit] [dtrace]

Elixir 1.15.7 (compiled with Erlang/OTP 26)

❯ mix --version
Erlang/OTP 27 [erts-15.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit] [dtrace]

Mix 1.15.7 (compiled with Erlang/OTP 26)

Marked As Solved

D4no0

D4no0

Distillery is no longer used for elixir releases, as elixir has its own release tool these days: mix release — Mix v1.20.2

I would recommend to just take a look at documentation and try to adapt your project to elixir releases.

If that doesn’t work, I might guess the culprit most probably is the OTP version, in that book should be specified what OTP and elixir versions were used, stick to them and everything should work in theory.

Also Liked

psylone

psylone

mix release is a really wonderful tool, but it doesn’t support hot code upgrades while Distillery does.

So if you want to use Distillery here are the steps that you need:

  1. Use Erlang/OTP 24 because Distillery is not compatible with OTP 25

  2. Use Elixir version 1.14 or earlier. If you use a later version, you will not be able to run the IEx console in Distillery release. I suppose the reason is here and after Elixir 1.14 module IEx.CLI was refactored

Here is my tool-versions file from the brilliant asdf version manager:

erlang 24.3.4.17
elixir 1.14.5
  1. Create config/config.exs file with this content:
import Config
  1. Also don’t forget to use appropriate elixir version in project function from the mix.exs file, for example:
  def project do
    [
      app: :sequence,
      version: "0.1.0",
      elixir: "~> 1.14",
      start_permanent: Mix.env() == :prod,
      deps: deps()
    ]
  end

Yes, I also read this wonderful book and encountered the same problem :slight_smile:

  1. Use mix task which starts from the distillery prefix, for example: mix distillery.init and mix distillery.release --env=prod (my Distillery version is 2.1.1)

With all this, I was able to successfully complete the entire chapter of the book.

psylone

psylone

Sometimes, this occurs just like it does with any other application in a different stack. However, it is usually common practice to use Docker and simply redeploy the container with the previous version.

I apologize; at first, I misunderstood the question.

It depends. we usually strive to use the latest versions of Elixir/Erlang. However, if it’s a critical system, there might be a compromise: using hot code updates but sticking to slightly older versions of Elixir/Erlang.

One way or another, I haven’t encountered the use of hot code updates in production. Typically, Docker containers are used along with the latest versions of Elixir/Erlang. Nevertheless, it was useful to get acquainted with this mechanism and experiment with it in the context of this chapter of the book.

LostKobrakai

LostKobrakai

While there‘s no built in support it can be added by third parties: Castle - Hot-Code Upgrade Support for Elixir

Where Next?

Popular in Questions Top

Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call t...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
dotdotdotPaul
Okay, I’m having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I’m sure I’...
New

Other popular topics Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
pmjoe
I have a relationship of love and hate with Elixir. Lots of things are just absolutely right, but there are some things that are kind of ...
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
Brian
What is the proper way to load a module from a file in to IEX? In the python world, doing something like this pretty standard: from ....
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New

Latest on Elixir Forum

We're in Beta

About us Mission Statement