Error deploying to production server

Hey folks! Total noob to all things phoenix and elixir. I have inherited a project that runs fine locally and I am trying to get it to run on a production server. I am following this tutorial from Digital Ocean: https://www.digitalocean.com/community/tutorials/how-to-automate-elixir-phoenix-deployment-with-distillery-and-edeliver-on-ubuntu-16-04#step-4-—-creating-a-test-project. Everything runs fine until the command mix edeliver start production where I get the error:

-----> starting production servers

production node:

  user    : deployer
  host    : myapp
  path    : /home/deployer/app_release
  response: init terminating in do_boot ({cannot get bootfile,no_dot_erlang.boot})

Crash dump is being written to: erl_crash.dump...done
init terminating in do_boot ({cannot get bootfile,no_dot_erlang.boot})

Crash dump is being written to: erl_crash.dump...done
init terminating in do_boot ({cannot get bootfile,no_dot_erlang.boot})

Crash dump is being written to: erl_crash.dump...done


START DONE!

My first question is, is it OK that I am doing with from a MAC dev environment, and could that be the reason I am getting this error? I only ask b/c the DO article says it should be done from an Ubuntu-based environment.

Next, I found this topic:

…which looks similar to mine. I updated to distillery locally, but am still getting the same error. That topic mentions patching distillery, but I’m not exactly sure how to do that. Where does it live, and can I just upgrade or downgrade so this works?

Any help appreciated.

The error message indicates a version mismatch of the Erlang version used for compilation and that used to run. Usually the compiler version is newer than the runtime version.

I’d check that first. If both versions are the same, you should try to use an Ubuntu VM that is a mostly exact clone of the target host.

1 Like

Good call Nobbz. Indeed I have 10.0.1 locally and 10.0.0 on the server. Just spent an hour trying to uninstall and/or update the production server and everything is a mess now. I guess I will blow that server away and try rebuilding it from scratch.

Thanks!

Did you figure it out?

It should be OK to run the edeliver commands from your macOS, as long as you have BUILD_HOST set to an Ubuntu machine. Make sure your build host has the same Erlang/Elixir versions as your development environment.

Following the DO tutorial, you’re going to build and deploy to the same machine. Your mileage may vary, I have a local VM that I use to build so I don’t need to install development dependencies on my production nodes.

Yep… BUILD_HOST is set to the Ubuntu machine. Any tips on how to get the versions in sync? I am downloading the latest version for Ubuntu (esl-erlang_21.0-1_ubuntu_artful_amd64.deb) and the version is 10.0;

Erlang/OTP 21 [erts-10.0] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [hipe]

Eshell V10.0  (abort with ^G)
1> erlang:system_info(version).
"10.0"

Whereas on my MAC I get…

Erlang/OTP 21 [erts-10.0.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] [dtrace]

Eshell V10.0.1  (abort with ^G)
1> erlang:system_info(otp_release).
"21"
2> erlang:system_info(version).
"10.0.1"

Is there anyway to get these in sync?

Building and installing from source is probably the only way then. But if you build and deploy on Ubuntu, I’m not sure what is going on with your problem.