distillery icon indicating copy to clipboard operation
distillery copied to clipboard

release_handler issue

Open bparrillo opened this issue 2 years ago • 6 comments

Steps to reproduce

Running a deployment with Edeliver. Just updated to erlang OTP 25. Tried to build the release and it breaks.

Verbose Logs

MIX_ENV=prod env MIX_ENV=prod mix edeliver build release --branch=master --verbose

==> Generating RELEASES
==> Release failed: no match of right hand side value: {:error, :eacces}
    (distillery 2.1.1) lib/distillery/releases/assembler.ex:863: Distillery.Releases.Assembler.create_RELEASES/2
    (distillery 2.1.1) lib/distillery/releases/assembler.ex:290: Distillery.Releases.Assembler.write_release_scripts/1
    (distillery 2.1.1) lib/distillery/releases/assembler.ex:50: Distillery.Releases.Assembler.assemble/1
    (distillery 2.1.1) lib/distillery/tasks/release.ex:130: Mix.Tasks.Distillery.Release.do_release/2
    (mix 1.13.0) lib/mix/task.ex:397: anonymous fn/3 in Mix.Task.run_task/3
    (mix 1.13.0) lib/mix/cli.ex:84: Mix.CLI.run_task/2
    (elixir 1.13.0) src/elixir_compiler.erl:73: :elixir_compiler.dispatch/4
    (elixir 1.13.0) src/elixir_compiler.erl:58: :elixir_compiler.compile/3


A remote command failed on:

  [email protected]

Output of the command is shown above and the command executed
on that host is printed below for debugging purposes:

FAILED with exit status 1:

    [ -f ~/.profile ] && source ~/.profile
    set -e
    cd /home/ubuntu/app/mysite.com/myApp_builds
    if [ "mix" = "rebar" ]; then
      echo "using rebar to generate release"
      ./rebar   -f generate
    elif [ "mix" = "relx" ]; then
      echo "using relx to generate release"
      ./relx release
    elif [ "mix" = "mix" ]; then
      echo "using mix to generate release"
      MIX_ENV="prod" LINK_SYS_CONFIG="" LINK_VM_ARGS="" APP="myApp" AUTO_VERSION="" BRANCH="master" SKIP_RELUP_MODIFICATIONS="" RELUP_MODIFICATION_MODULE="" USING_DISTILLERY="true" mix  distillery.release --verbose --env="prod" --name="myApp"
    fi

Description of issue

  • What are the expected results? It's expected to build the release but I believe the recent update to erlang broke :release_handler .
  • What version of Distillery? 2.1
  • What OS, Erlang/Elixir versions are you seeing this issue on? ubuntu, 25, 13.3.3
  • If possible, also provide your `rel/config.exs' : Will do if necessary but it contains some sensitive information. Will hence require editing.
  • Is there documentation that says one thing, but Distillery does another? https://www.erlang.org/blog/my-otp-25-highlights/ I think the change to the release handler on this page is the problem.

Thanks in advance!

bparrillo avatar Jun 07 '22 16:06 bparrillo

I have same problem too.

Its may be something with user permissions if I run this command in build directory:

MIX_ENV="prod" LINK_SYS_CONFIG="" LINK_VM_ARGS="" APP="myApp" AUTO_VERSION="" BRANCH="master" SKIP_RELUP_MODIFICATIONS="" RELUP_MODIFICATION_MODULE="" USING_DISTILLERY="true" mix distillery.release --verbose --env="prod" --name="myApp"

with sudo command, release will build successfully.

rsolovjov avatar Jun 07 '22 20:06 rsolovjov

With OTP 25 it seems like the release_handler ( https://www.erlang.org/blog/my-otp-25-highlights/ ) has been changed. This induces a permissions error, accessing from the wrong directory potentially.

bparrillo avatar Jun 08 '22 17:06 bparrillo

same for me

ziyouchutuwenwu avatar Aug 22 '22 00:08 ziyouchutuwenwu

same issue. Its a real pain.

tensor-programming avatar Sep 26 '22 04:09 tensor-programming

With OTP 25 it seems like the release_handler ( https://www.erlang.org/blog/my-otp-25-highlights/ ) has been changed. This induces a permissions error, accessing from the wrong directory potentially.

Did you ever find out what caused the permission error?

edmz avatar Oct 03 '22 15:10 edmz

https://github.com/bitwalker/distillery/issues/744#issuecomment-1279436355

austinsalonen avatar Oct 14 '22 20:10 austinsalonen