Having issues with Elixir releases in 1.9.0

Hello people!

I’ve been testing Elixir 1.9.0 releases and can’t make it work on a very simple project… it is failing with:

Generated <<project>> app
Release <<project>>-0.1.0 already exists. Overwrite? [Yn] Y
* assembling <<project>>-0.1.0 on MIX_ENV=prod
* using config/releases.exs to configure the release at runtime
Cannot read "<<project_root>>/_build/prod/rel/<<Project>>/releases/0.1.0/start.script"
** (MatchError) no match of right hand side value: :error
    (mix) lib/mix/release.ex:433: Mix.Release.make_boot_script/4
    (mix) lib/mix/tasks/release.ex:1063: anonymous fn/5 in Mix.Tasks.Release.make_boot_scripts/3
    (stdlib) maps.erl:257: :maps.fold_1/3
    (mix) lib/mix/tasks/release.ex:1060: Mix.Tasks.Release.make_boot_scripts/3
    (mix) lib/mix/tasks/release.ex:1008: Mix.Tasks.Release.build_rel/2
    (mix) lib/mix/tasks/release.ex:955: Mix.Tasks.Release.assemble/1
    (mix) lib/mix/tasks/release.ex:931: Mix.Tasks.Release.run_steps/1
    (mix) lib/mix/task.ex:331: Mix.Task.run_task/3```

This is a simple Phoenix project without ecto, html or webpack.

Elixir: 1.9.0 (with asdf)
Erlang: 21.3.8 (with asdf)

Nothing configured on mix.exs for releases. Can run project just fine with pure iex iex -S mix but cant generate the release. Run mix release.init just fine but mix release breaks.

The file it says it can’t read is there with readable permissions:

ls -la _build/dev/rel/<<project>>/releases/0.1.0/
total 152
drwxrwxr-x. 2 victorolinasc victorolinasc  4096 jul  3 12:01 .
drwxrwxr-x. 3 victorolinasc victorolinasc  4096 jul  3 12:01 ..
-rw-rw-r--. 1 victorolinasc victorolinasc 57409 jul  3 12:01 start.boot
-rw-rw-r--. 1 victorolinasc victorolinasc  1218 jul  3 12:01 start.rel
-rw-rw-r--. 1 victorolinasc victorolinasc 78962 jul  3 12:01 start.script

Tried to look for the line it says it is breaking (lib/mix/release.ex:433) but on tag 1.9 this line is comment and then not sure how to debug it further down.

Anyone with that problem?

1 Like

I’d say wipe _build and try again, it looks like there was a release started but killed at one point. Elixir should still handle this better I’d think though. @josevalim?

I’ve tried that several times to no avail. Also tried nuking deps, and some other nuke opttions also without success. I’ve moved back to distillery for now. Will try again later when I have more time.

Thanks!

1 Like

If you can make a minimal reproduceable example, I know that @josevalim would love to have a link to the repo, probably in the elixir issue tracker (even better if its reproduced in a docker container for ease of stable platform testing), especially as that sounds like it could be a big issue! :slight_smile:

I don’t know if it has to do anything with your issue but the script is failing with

* assembling <<project>>-0.1.0 on MIX_ENV=prod
<snip>
Cannot read "<<project_root>>/_build/prod/rel/<<Project>>/releases/0.1.0/start.script"

And you listed files from _build/dev.

(I actually have a similar weird issue with scenic where the driver always seems to be put in the wrong environment, but I didn’t have a chance to investigate).

That was actually my poor copy and paste skill… though I am sure both environments had the same issue (tested this for some hours with all possible combinations I could think of at the moment).

As I said before, I’ve moved on to using Distillery. When I find some time I’ll try to reproduce it once again to see if I can upload a minimum project for helping debugging it.

Thanks!

That sounds like the issue that @boydm is investigating here: New project won't run · Issue #36 · ScenicFramework/scenic_new · GitHub

But my guess is it is unrelated to this issue.