seb5law

seb5law

Deploying a Phoenix app from Windows to CentOS

I am bound by company policy to use Windows for development (only WIndows admins present…) but the productive system schould run on a CentOS.
I tried deploying a simple Phoenix app (converting user input as markdown to html code) using distillery as described in the Using Distillery With Phoenix article but removing the Erlang ERTS by setting set include_erts: false in rel/config.exs and compiling Erlang from source on CentOS.

I tried running the app but nothing happens, when I run the app with the foreground command I get the following error that I don’t comprehend:

bin/markdownhtml foreground
{"init terminating in do_boot",{load_failed, [gen,ets,supervisor,proc_lib,lists,kernel,heart,gen_server,gen_event,file_io_server,file_server,filename,file,error_logger,erl_parse,erl_lint,erl_eval,code_server,code,application_master,application_controller,application,error_handler]}}
init terminating in do_boot ()

Crash dump is being written to: erl_crash.dump...done
Shutting down node cleanly..
Node is not running!

What should this error tell me except that something went wrong?

How else do you suggest should I deploy?

Marked As Solved

bobbypriambodo

bobbypriambodo

Most likely it is a compatibility issue. From Erlang crash dump man page:

Init terminating in do_boot ()
The primitive Erlang boot sequence was terminated, most probably because the boot script has errors or cannot be read. This is usually a configuration error; the system can have been started with a faulty -boot parameter or with a boot script from the wrong OTP version.

Excluding ERTS often result in faulty behavior. For consistency I guess it’s probably best to always bundle it.

Now, since the host system (Windows) is different from the target (CentOS), you have four options:

  1. Build the release inside a CentOS Docker container. This is the most lightweight solution and highly recommended.
  2. Build the release inside a CentOS VM (via Virtualbox, VMWare, etc.).
  3. Build the release on a CentOS build server.
  4. Build the release on the production server.

Option 1 and 2 can be done on your host machine. Option 3 needs you to have an extra server for building releases, and that might not be feasible depending on your company. I don’t think option 4 is recommended though, but it’s possible. Be aware that all options requires your container/VM/machine to have Elixir installed.

Also Liked

seb5law

seb5law

Thanks for the reply, I chose the docker variant, but run the entire application via a docker container based on msaraiva/elixir. The deployment process I used is almost the same as and derived from the one described in this article.

Where Next?

Popular in Questions Top

aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
Phillipp
Hey, I have a NanoPi-M3 and try to install Elixir on their Ubuntu image. I followed the Raspberry Pi installation instructions from the ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
sabri
Can someone explain the settings of pool_size of Ecto in config file? and what is the recommend size? Thanks
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
vrod
I am using the Starship cross-shell prompt – it seems pretty nice, but I get some errors: [WARN] - (starship::utils): Executing command ...
New

Other popular topics Top

openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 27727 240
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
josevalim
Hi everyone, One of the features added to Elixir early on to help integration with Erlang code was the idea of overridable function defi...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New

We're in Beta

About us Mission Statement