DidactMacros

DidactMacros

Multiple errors when trying to do a basic release with Distillery. Is it OTP 26 compatible?

I’ve been working through Programming Elixir, the second half of Chapter 20 pertains to releases and hotcode reloading.

One of the first errors I experienced was when using mix release --env=prod

Mix could not invoke task “release” : 1 error found
–env :unknown option

When I found that the new mix format to be used for distillery was distillery., I started again (after cleaning) using distillery.init, then distillery.release --env=prod.

Everything was beginning to build then I got a Release Failed error regarding not finding a file at ./config/config.exs, which is a bit odd because it’s my first time using distillery so I’m taking the out of the box approach, and copying files directly into config is not recommended by the distillery guides.

Throwing more at the problem I updated my dep description of distillery to include github: "bitwalker/distillery", in case github was ahead of the pm.

deps do
  [
    {:distillery, "~> 2.1", runtime: false,  github: "bitwalker/distillery"}
  ]
end

runtime: false was removed, but I understand it is ignored anyway.

After I relented and touched config/config.exs I got to the packaging stage of distillery.release before triggering a Failed to archive release error that no such file or directory was located at the target uri (stipulated in the error log).

Does distillery work on the latest OTP?

I’ve been looking around and haven’t found much info regarding these bugs other than that there was a breaking change in erlang/otp 25. I’m using Erlang/OTP 26. I’ve not seen notice of a rectification.

I downloaded OTP 24 but I am reluctant to switch to it for the sake of completing this example.

Moved to chapter 21 for the time being so this isn’t necessarily urgent, just a request for clarification.

Much appreciated.

Marked As Solved

andyleclair

andyleclair

The architecture for hot reloads exists at the erlang level (in the form of AppUps) but it is rarely used in prod (at least in my experience, I’m sure Ericsson would beg to differ) because there are a few annoying caveats.

We used to use them at Appcues, but it ended up being more of a pain than it was worth, so now we just reboot the processes. This gives us a few other useful properties (clearing ETS caches, not needing to coordinate running process version upgrades) and is easier for us to reason about.

To directly answer your question, distillery doesn’t currently support OTP 25 (see also; THIS LIBRARY IS NOT COMPATIBLE WITH ERLANG/OTP 25 · Issue #744 · bitwalker/distillery · GitHub) but there is a fix on a fork, YMMV.

Also Liked

D4no0

D4no0

Distillery was used back in the day, I am not sure it is still actively supported.

The official way to make releases now is to use releases. You can do that from any elixir project by running release task:

mix release 
Hermanverschooten

Hermanverschooten

Currently releases do not support hot code upgrades.

D4no0

D4no0

Imagine you are talking on the phone and your call stops because someone did a new deploy :smile: . In their case that feature was crucial and maybe once we can create a good abstraction over it, we will harness the full power without these nitty-gritty details.

andyleclair

andyleclair

Yes, and that’s absolutely the case I was thinking of :joy:

It’s a nice to have, for sure! The industry I work in (SaaS software), we use Channels, and it’s not a problem for us to just reboot the servers, because the websocket will reconnect to an alive, not-being-deployed server, and I don’t need to worry if whoever wrote the appup remembered to start the new Supervisor or whatever, we just start at the state we want via application.ex and don’t worry about it.

The downside is, we need to deploy our service one (or a small few) at a time, because if we deploy, say, all the servers (~50+ m6g.8xl on a heavy day) at once, we would have downtime, as well as the dread thundering herd as millions of websockets reconnect and resume state.

We used to use hot upgrades, but the mental burden on the engineers of figuring out “can I do this hot or does it need to be a release” became too much of a headache. Still, it was nice to be able to deploy all of our servers at once (currently takes ~30 mins to deploy the fleet)

D4no0

D4no0

No idea to be fair, we don’t dabble with such things in our production systems.

Where Next?

Popular in Questions Top

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
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 th...
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
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
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
gonzofish
I’m currently trying to understand how to join three tables using Ecto. All the examples I’ve seen use 2, so maybe I’m just missing somet...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

Other popular topics Top

Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3268 119930 1237
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
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
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
chrismccord
This release brings a number of exciting features, including integration with the new Phoenix LiveDashboard and Phoenix LiveView. There h...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
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
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
magnetic
Hey :wave:t3: Elixir community, I’ve been learning Elixir, and working on some side projects. My editor of choice is VSCode, and althoug...
New

We're in Beta

About us Mission Statement