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.18.1

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

Tee
can someone please explain to me how Enum.reduce works with maps
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
mathew4509
I have a list say x = ["23gh", "56kh", "97mh"] I would like to pass each element to Val in each iteration. Say, in iteration 1 -------...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
idi527
I’ve been re-reading swift book again and noticed that multiline strings there don’t have a trailing line break, unlike in elixir iex(2)...
New

Other popular topics Top

yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
Tee
can someone please explain to me how Enum.reduce works with maps
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
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
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 42633 214
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New

We're in Beta

About us Mission Statement