Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

latest-alpine fails to start due to erroneous shared library search paths for JVM #142

Closed
norriscm opened this issue Jun 14, 2024 · 0 comments · Fixed by #143
Closed

latest-alpine fails to start due to erroneous shared library search paths for JVM #142

norriscm opened this issue Jun 14, 2024 · 0 comments · Fixed by #143

Comments

@norriscm
Copy link
Contributor

In latest-alpine, the Unifi server fails to start because the java executable cannot open libjli.so:

<docker-entrypoint> EXEC - su-exec unifi:unifi /usr/bin/java  -Xmx1024M -Dunifi.datadir=/usr/lib/unifi/data -Dunifi.logdir=/usr/lib/unifi/logs -Dunifi.rundir=/usr/lib/unifi/run -Djava.awt.headless=true -Dfile.encoding=UTF-8 --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/sun.security.util=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED -jar /usr/lib/unifi/lib/ace.jar start
Error loading shared library libjli.so: No such file or directory (needed by /usr/bin/java)
[various relocation errors for missing symbols]

It appears that the shared library search paths in the container are for the wrong version of OpenJDK. The contents of the musl ld path file in the image are:

/lib
/usr/lib
/usr/local/lib
/usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64
/usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64/jli
/usr/lib/jvm/java-1.8-openjdk/jre/lib/amd64/server

The last three directories do not exist in the container because it uses OpenJDK 17.

I was able to get the container running by executing the following command within the container to fix the library paths:

sed -i -e 's/1\.8/17/' -e 's|/amd64||' -e 5d /etc/ld-musl-x86_64.path
  • System information:

    • OS/distribution version:
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 24.04 LTS
    Release:        24.04
    Codename:       noble
    
    • Docker version:
    Docker version 24.0.7, build 24.0.7-0ubuntu4
    
    • Labels from container:
    "Labels": {
    "org.opencontainers.image.created": "2024-06-06T15:43:46.191Z",
    "org.opencontainers.image.description": "UniFi Controller",
    "org.opencontainers.image.licenses": "Apache-2.0",
    "org.opencontainers.image.revision": "83551f56b1bd543c55a8711dca24b68018803524",
    "org.opencontainers.image.source": "https://github.com/goofball222/unifi",
    "org.opencontainers.image.title": "UniFi Controller",
    "org.opencontainers.image.url": "https://github.com/goofball222/unifi",
    "org.opencontainers.image.vendor": "The Goofball - goofball222@gmail.com",
    "org.opencontainers.image.version": "8.2.93-Alpine"
    } 
    
norriscm added a commit to norriscm/unifi that referenced this issue Jun 14, 2024
* Update musl ld shared library search paths for OpenJDK 17 directories
Fixes goofball222#142
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant