OpenMetadata icon indicating copy to clipboard operation
OpenMetadata copied to clipboard

[Bug] Failed to initialize vector search service: UnsatisfiedLinkError on PyTorch native library on Alpine Linux (musl libc)

Open jnrimjhim opened this issue 5 months ago • 1 comments

OpenMetadata Version: 1.13.0 Deployment: Kubernetes Image: docker.getcollate.io/openmetadata/server:1.13.0 Search Backend: OpenSearch 3.3.2 Embedding Provider: DJL

Configuration
- name: SEMANTIC_SEARCH_ENABLED
  value: "true"
- name: EMBEDDING_PROVIDER
  value: "djl"
- name: DJL_EMBEDDING_MODEL
  value: "ai.djl.huggingface.pytorch/sentence-transformers/all-MiniLM-L6-v2"
- name: DJL_CACHE_DIR
  value: "/opt/djl-cache"

When deploying OpenMetadata with semantic search and DJL-based embeddings enabled, the server fails to initialize the vector search service at startup with the following error: -

ERROR o.o.s.s.SearchRepository - Failed to initialize vector search service: Failed to load PyTorch native library
Caused by:
java.lang.UnsatisfiedLinkError:
/root/.djl.ai/pytorch/2.7.1-cpu-linux-x86_64/libgomp-98b21ff3.so.1:
Error relocating ...:
initial-exec TLS resolves to dynamic definition

jnrimjhim avatar Jun 29 '26 13:06 jnrimjhim

Duplicate of #26700 — same root cause, different point of failure along the same load path.

The server image is Alpine (FROM alpine:3 + openjdk21-jre, docker/development/Dockerfile), so the runtime libc is musl. DJL downloads its PyTorch natives from publish.djl.ai at first use, and those are glibc-linked — DJL publishes only linux-x86_64 / linux-aarch64 / osx-aarch64 / win-x86_64 classifiers, with no musl build. #26700 dies earlier on libstdc++.so.6; this report gets one step further and dies on libgomp's initial-exec TLS relocation. Both are the same glibc-vs-musl incompatibility, and it applies equally to libtokenizers.so (deepjavalibrary/djl#2946) and to ONNX Runtime, so switching the DJL engine wouldn't help either.

The fix is in flight in #32182, which moves the server runtime to gcr.io/distroless/cc-debian12 (glibc) with a jlink'd Java 21. That PR also measured the cheaper option and ruled it out: gcompat + libstdc++ + libgcc on Alpine still fails with __vsnprintf_chk: symbol not found on both arches, because gcompat exports none of the _FORTIFY_SOURCE __*_chk symbols these libraries need.

Until that lands, EMBEDDING_PROVIDER=djl cannot work on the published images; the working options are bedrock (the default), openai, or google.

Two unrelated notes on your config, in case they bite you later:

  • DJL_CACHE_DIR is set to /opt/djl-cache, but the failing path is /root/.djl.ai/... — the variable isn't reaching the JVM, so the ~276 MB of natives and model weights are being re-downloaded into a non-persisted location on every container start.
  • That path also means the process is running as root, while the image declares USER openmetadata.

Closing in favour of #26700 — please follow that one for updates.

fmcardoso avatar Aug 31 '26 14:08 fmcardoso