Release won't start because of version

I’m trying to build a release of a Phoenix app to deploy onto a CentOS 7 server (currently just testing on a Vagrant VM). I’m building it using Distillery running in a Docker container based on erlang:20.0, which I’ve done successfully before (although I think that app was deployed on Ubuntu).

When I try to start the application, I get the following error:

/vagrant/erts-9.0.5/bin/beam.smp: /lib64/ version `ZLIB_1.2.7.1' not found (required by /vagrant/erts-9.0.5/bin/beam.smp)

It seems the VM has a newer version of zlib (zlib-1.2.7-17.el7.x86_64), which doesn’t match.

I’m not sure exactly where the dependency on zlib is coming from, but a grep of deps points to cowboy/cowlib as the most likely answer.

Is there an easy fix for this (can I get distillery to bundle the shared library?), or does the OS I build the release on have to have exactly the same versions of any native library dependencies as the target server?

Any clues greatly appreciated!

As far as I know, indeed the release procedure requires to have the same native libraries between the computer that you build on and the one where you deploy the release.

1 Like

Erst 9.0 ist OTP 18 or 17. You need to build your application with a matching version of the target system.

Thanks both. I’m now in the process of building up a dockerfile with all the right versions.

1 Like