Engineering

14 April, 2017

Deploying an Elixir application with edeliver: Troubleshooting

After asking around in the community I came to the conclusion that, in our specific case, the best tool for deploying Elixir applications is edeliver.

David Magalhães

Software Engineer

Deploying elixir applications using Edeliver - Coletiv Blog

I successfully deployed an Elixir application to an Amazon EC2 and decided to compile a list of the issues and solutions that I’ve encountered and found little or no information regarding it.

After researching for a few days and asking around in the community I came to the conclusion that in our specific case the best tool to deploy an Elixir application is edeliver. It uses distillery (or exrm) to create a single package with all the code needed to be deployed on a server.

There are still available other ways of deploying an Elixir application to AWS using CodeDeploy, Elastic Beanstalk, Kubernetes and so on. In some of them you lose some functionality of Elixir (Erlang) like hot swap and communication between nodes, but at the moment the simplicity of edeliver is more than enough for my needs.

Confusing information on README.md

I followed the README.md file and it assumes by default that the distillery module is used. That was what I was thinking in using too, but after trying to deploy the application, I got the following message: cat: deps/exrm/mix.exs: No such file or directory.

In the readme file after the quick start section, you can check that you have this environment variable you can setup to use distillery, which means that setting USING_DISTILLERY=true solves the issue.

Phoenix deployed but no listening port open

After successfully deploying the service, I couldn’t reach it because the default port wasn’t available (used netstat -tulpn to check).

If you are deploying a Phoenix application be aware that on prod.exs file you need to uncomment config :phoenix, :serve_endpoints, true for the server start to accept requests.

Also if you don’t setup a fixed port, be sure you set an environment variable PORT with the port you want your web server to be listening, export PORT=80 on the server side, or check RELX_REPLACE_OS_VARS=true to include this information on the deploy.

Missing Modules

If your application is saying that modules are missing, run command mix release to check what modules is missing on your mix.exs file.

Some Elixir modules don’t state in their README.md that you need to explicit include the module on the applications entry and the problem is that on development mode (using mix phx.server) the application doesn’t show any issue with it.

def application do [mod: {MyApp, []}, applications: [ :canary, :corsica, ... :edeliver ]] end

Conclusion

I’m still giving my first baby steps towards the Elixir/Erlang work, but I will try to keep this article up to date if I encounter some more issues with it.

Elixir

Software Development

Phoenix

Edeliver

Join our newsletter

Be part of our community and stay up to date with the latest blog posts.

Subscribe

Join our newsletter

Be part of our community and stay up to date with the latest blog posts.

Subscribe

You might also like...

Go back to blogNext
How to support a list of uploads as input with Absinthe GraphQL

Engineering

26 July, 2022

How to support a list of uploads as input with Absinthe GraphQL

As you might guess, in our day-to-day, we write GraphQL queries and mutations for Phoenix applications using Absinthe to be able to create, read, update and delete records.

Nuno Marinho

Software Engineer

Flutter Navigator 2.0 Made Easy with Auto Router - Coletiv Blog

Engineering

04 January, 2022

Flutter Navigator 2.0 Made Easy with Auto Router

If you are a Flutter developer you might have heard about or even tried the “new” way of navigating with Navigator 2.0, which might be one of the most controversial APIs I have seen.

António Valente

Software Engineer

Enabling PostgreSQL cron jobs on AWS RDS - Coletiv Blog

Engineering

04 November, 2021

Enabling PostgreSQL cron jobs on AWS RDS

A database cron job is a process for scheduling a procedure or command on your database to automate repetitive tasks. By default, cron jobs are disabled on PostgreSQL instances. Here is how you can enable them on Amazon Web Services (AWS) RDS console.

Nuno Marinho

Software Engineer

Go back to blogNext