exqlite icon indicating copy to clipboard operation
exqlite copied to clipboard

Can't build Docker image with 0.30.0

Open ndrean opened this issue 8 months ago • 15 comments

With 0.29.0, I can run the Docker image.

With 0.30.0, I can't run the Docker image, but I can run the app in an IEX session.

{load_failed,
web-1  |  "Failed to load NIF library: '/lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.33' 
not found (required by /app/lib/exqlite-0.30.0/priv/sqlite3_nif.so)'"
}}}}},

ndrean avatar Apr 26 '25 16:04 ndrean

I have the exact same issue, with the same solution.

HVossi92 avatar Apr 26 '25 18:04 HVossi92

@cocoa-xu would the change you did here https://github.com/elixir-sqlite/exqlite/pull/322 cause this issue? I have to support both glibc and musl libc backings.

warmwaffles avatar Apr 28 '25 02:04 warmwaffles

No, it's not relevant.

cocoa-xu avatar Apr 28 '25 02:04 cocoa-xu

Thanks!

warmwaffles avatar Apr 28 '25 02:04 warmwaffles

Ubuntu 20.04 has glibc 2.31.

2.33 is the newer one from https://github.com/elixir-sqlite/exqlite/commit/999a9351a8f5c29031182277d0392de86881fea2

cocoa-xu avatar Apr 28 '25 02:04 cocoa-xu

warmwaffles avatar Apr 28 '25 02:04 warmwaffles

@ndrean what version of glibc are you running in the docker container?

warmwaffles avatar Apr 28 '25 02:04 warmwaffles

@warmwaffles Using DEBIAN_VERSION=bullseye-20250317-slim ------> : 2.31 (ldd --version)

ndrean avatar Apr 28 '25 05:04 ndrean

Running into the same problem trying to deploy a fly.io app. fly auto generates a docker image with ARG DEBIAN_VERSION=bullseye-20241202-slim everything deploys but I get

ord [info] ~c"Failed to load NIF library: '/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /app/lib/exqlite-0.30.0/priv/sqlite3_nif.so)'"}}

in the logs

hlista avatar Apr 28 '25 16:04 hlista

I see. Okay. Looks like I can't use ubuntu-latest to compile with.

warmwaffles avatar Apr 28 '25 17:04 warmwaffles

@ndrean and @hlista I've pushed an update to use ubuntu 22.04 for the precompiled images. If this is still a problem for you, I am going to suggest you update your base docker image to a later version of glibc, or use a musl based image, or build this package without the precompiled binaries. (see: https://github.com/elixir-sqlite/exqlite?tab=readme-ov-file#compile-time-configuration)

v0.30.1 was published.

warmwaffles avatar Apr 28 '25 17:04 warmwaffles

The latest I can get is 20250428 (https://hub.docker.com/r/hexpm/elixir/tags?name=27.3.3) It uses again:

ldd (Debian GLIBC 2.31-13+deb11u11) 2.31

With 0.30.1:

> mix deps | grep exqlite

* exqlite (Hex package) (mix)
  locked at 0.30.1 (exqlite) 15714871

and

config :exqlite, force_build: true

it works 🎉

ndrean avatar Apr 29 '25 17:04 ndrean

Mainly I was trying to stop github from screaming at me about using an outdated image. I have a love hate with the precompiled binaries. On the one hand super convenient. On the other, boy it's a quagmire having to navigate all the possible glibc's floating out there.

warmwaffles avatar Apr 29 '25 18:04 warmwaffles

I have this same problem between versions 0.29.0 and 0.32.1.

dtingey avatar Jul 15 '25 19:07 dtingey

A tale as old as time. Precompiled binaries being problematic. 😞 I'll take a look soon. The workaround is to do

config :exqlite, force_build: false

warmwaffles avatar Jul 15 '25 20:07 warmwaffles