bitwalker / distillery

Simplify deployments in Elixir with OTP releases!
MIT License
2.96k stars 396 forks source link

release_handler issue #745

Open bparrillo opened 2 years ago

bparrillo commented 2 years ago

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

Thanks in advance!

rsolovjov commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

same for me

tensor-programming commented 1 year ago

same issue. Its a real pain.

edmz commented 1 year ago

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 commented 1 year ago

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