Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release_handler issue #745

Open
bparrillo opened this issue Jun 7, 2022 · 6 comments
Open

release_handler issue #745

bparrillo opened this issue Jun 7, 2022 · 6 comments

Comments

@bparrillo
Copy link

bparrillo commented Jun 7, 2022

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:

  ubuntu@placeholder.com

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!

@rsolovjov
Copy link

rsolovjov commented Jun 7, 2022

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.

@bparrillo
Copy link
Author

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.

@ziyouchutuwenwu
Copy link

same for me

@tensor-programming
Copy link

same issue. Its a real pain.

@edmz
Copy link
Contributor

edmz commented Oct 3, 2022

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?

@austinsalonen
Copy link

#744 (comment)

chris-heath added a commit to chris-heath/distillery that referenced this issue Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants