0
    $ strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX_3.4.30
GLIBCXX_3.4.30

Yet, when running another application on the same docker container:

org.postgresql.util.PSQLException: ERROR: could not load library "/usr/lib/postgresql/13/lib/llvmjit.so": /lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libz3.so.4)

The llvvjit.so file is also present:

# ls /usr/lib/postgresql/13/lib/llvmjit.so
/usr/lib/postgresql/13/lib/llvmjit.so

I'm using the following Dockerfile:

FROM alpine

RUN apk upgrade --no-cache
RUN apk add libstdc++ postgresql-client leiningen

WORKDIR /ui-service
COPY . .
CMD ["lein", "ring", "server-headless", "3000"]
EXPOSE 3000

What am I missing for postgresql driver to load the shared library, or how can I further debug this?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
ealfonso
  • 6,622
  • 5
  • 39
  • 67
  • Does this answer your question? [jdbc.postgresql trying to load non-java shared library?](https://stackoverflow.com/questions/76933048/jdbc-postgresql-trying-to-load-non-java-shared-library) – Mark Rotteveel Aug 19 '23 at 16:19

2 Answers2

0

strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX_3.4.30
GLIBCXX_3.4.30

Yet when running another application on the same docker container: org.postgresql.util.PSQLException: ERROR: could not load library "/usr/lib/postgresql/13/lib/llvmjit.so": /lib/x86_64-linux-gnu/libstdc++.so.6: version 'GLIBCXX_3.4.30' not found (required by /lib/x86_64-linux-gnu/libz3.so.4)

Note that /usr/lib/x86_64-linux-gnu/libstdc++.so.6 and /lib/x86_64-linux-gnu/libstdc++.so.6 are not the same.

You likely have two versions of libstdc++.so.6 installed (never a good idea), one of them is older than the other.

P.S. Using string is the wrong way to look for versions. Use readelf -V /lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX_3.4.30 instead.

P.P.S. You tagged this question with the glibc tag, but this has nothing to do with GLIBC. See this answer.

Employed Russian
  • 199,314
  • 34
  • 295
  • 362
0

The breakage in this case, including this failure to find a shared library, had nothing to do with the postgresql client.

The problem happened after a debian bullseye -> bookworm migration and was resolved by restarting the postgresql server.

ealfonso
  • 6,622
  • 5
  • 39
  • 67