yacy / yacy_search_server

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
http://yacy.net
Other
3.39k stars 426 forks source link

ARM docker build fails. #606

Closed mbledkowski closed 11 months ago

mbledkowski commented 11 months ago

Hello, Two days ago, when I was building ARM version of Docker image, everything worked fine; but now I am getting the error below. I tried moving to the commit from the day before with git checkout and then building it, but same issue; so it is probably due to some change in the upstream. Clearing docker cache with docker system prune -a has no effect on the build process.

pwd: /home/rocky/yacy_search_server/docker command: docker build -t yacy/yacy_search_server:aarch64-latest -f Dockerfile.aarch64 ../

6.210 Selecting previously unselected package ant.
6.215 Preparing to unpack .../8-ant_1.10.5-2_all.deb ...
6.218 Unpacking ant (1.10.5-2) ...
6.358 Selecting previously unselected package ant-optional.
6.362 Preparing to unpack .../9-ant-optional_1.10.5-2_all.deb ...
6.366 Unpacking ant-optional (1.10.5-2) ...
6.444 Setting up java-common (0.71) ...
6.462 Setting up libasound2-data (1.1.8-1) ...
6.472 Setting up libnspr4:arm64 (2:4.20-1) ...
6.481 Setting up libasound2:arm64 (1.1.8-1) ...
6.489 Setting up libnss3:arm64 (2:3.42.1-1+deb10u7) ...
6.500 Setting up ca-certificates-java (20190405) ...
6.525 head: cannot open '/etc/ssl/certs/java/cacerts' for reading: No such file or directory
6.691 Exception in thread "main" java.lang.InternalError: Error loading java.security file
6.692   at java.base/java.security.Security.initialize(Security.java:94)
6.692   at java.base/java.security.Security$1.run(Security.java:79)
6.692   at java.base/java.security.Security$1.run(Security.java:77)
6.692   at java.base/java.security.AccessController.doPrivileged(Native Method)
6.692   at java.base/java.security.Security.<clinit>(Security.java:77)
6.692   at java.base/sun.security.jca.ProviderList.<init>(ProviderList.java:176)
6.692   at java.base/sun.security.jca.ProviderList$2.run(ProviderList.java:94)
6.692   at java.base/sun.security.jca.ProviderList$2.run(ProviderList.java:92)
6.692   at java.base/java.security.AccessController.doPrivileged(Native Method)
6.692   at java.base/sun.security.jca.ProviderList.fromSecurityProperties(ProviderList.java:91)
6.692   at java.base/sun.security.jca.Providers.<clinit>(Providers.java:54)
6.692   at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:156)
6.692   at java.base/java.security.cert.CertificateFactory.getInstance(CertificateFactory.java:193)
6.692   at org.debian.security.KeyStoreHandler.<init>(KeyStoreHandler.java:50)
6.692   at org.debian.security.UpdateCertificates.<init>(UpdateCertificates.java:65)
6.692   at org.debian.security.UpdateCertificates.main(UpdateCertificates.java:51)
6.697 dpkg: error processing package ca-certificates-java (--configure):
6.697  installed ca-certificates-java package post-installation script subprocess returned error exit status 1
6.698 Setting up default-jre-headless (2:1.11-71) ...
6.708 dpkg: dependency problems prevent configuration of openjdk-11-jre-headless:arm64:
6.708  openjdk-11-jre-headless:arm64 depends on ca-certificates-java (>= 20190405~); however:
6.708   Package ca-certificates-java is not configured yet.
6.708
6.708 dpkg: error processing package openjdk-11-jre-headless:arm64 (--configure):
6.708  dependency problems - leaving unconfigured
6.708 Setting up ant (1.10.5-2) ...
6.718 Setting up ant-optional (1.10.5-2) ...
6.727 Processing triggers for ca-certificates (20200601~deb10u2) ...
6.736 Updating certificates in /etc/ssl/certs...
7.294 0 added, 0 removed; done.
7.294 Running hooks in /etc/ca-certificates/update.d...
7.343
7.470 Exception in thread "main" java.lang.InternalError: Error loading java.security file
7.471   at java.base/java.security.Security.initialize(Security.java:94)
7.471   at java.base/java.security.Security$1.run(Security.java:79)
7.471   at java.base/java.security.Security$1.run(Security.java:77)
7.471   at java.base/java.security.AccessController.doPrivileged(Native Method)
7.471   at java.base/java.security.Security.<clinit>(Security.java:77)
7.471   at java.base/sun.security.jca.ProviderList.<init>(ProviderList.java:176)
7.471   at java.base/sun.security.jca.ProviderList$2.run(ProviderList.java:94)
7.471   at java.base/sun.security.jca.ProviderList$2.run(ProviderList.java:92)
7.472   at java.base/java.security.AccessController.doPrivileged(Native Method)
7.472   at java.base/sun.security.jca.ProviderList.fromSecurityProperties(ProviderList.java:91)
7.472   at java.base/sun.security.jca.Providers.<clinit>(Providers.java:54)
7.472   at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:156)
7.472   at java.base/java.security.cert.CertificateFactory.getInstance(CertificateFactory.java:193)
7.472   at org.debian.security.KeyStoreHandler.<init>(KeyStoreHandler.java:50)
7.472   at org.debian.security.UpdateCertificates.<init>(UpdateCertificates.java:65)
7.472   at org.debian.security.UpdateCertificates.main(UpdateCertificates.java:51)
7.486 E: /etc/ca-certificates/update.d/jks-keystore exited with code 1.
7.486 done.
7.495 Processing triggers for libc-bin (2.28-10+deb10u1) ...
7.527 Errors were encountered while processing:
7.527  ca-certificates-java
7.527  openjdk-11-jre-headless:arm64
7.542 E: Sub-process /usr/bin/dpkg returned an error code (1)
------
Dockerfile.aarch64:26
--------------------
  25 |
  26 | >>> RUN rm -rf /opt/yacy_search_server/.git && \
  27 | >>>     apt-get update && \
  28 | >>>      apt-get install -yq ant && \
  29 | >>>      ant compile -f /opt/yacy_search_server/build.xml && \
  30 | >>>      apt-get purge -yq --auto-remove ant && \
  31 | >>>      apt-get clean && \
  32 | >>>      rm -rf /var/lib/apt/lists/*
  33 |
--------------------
ERROR: failed to solve: process "/bin/sh -c rm -rf /opt/yacy_search_server/.git &&     apt-get update && \tapt-get install -yq ant && \tant compile -f /opt/yacy_search_server/build.xml && \tapt-get purge -yq --auto-remove ant && \tapt-get clean && \trm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 100
mbledkowski commented 11 months ago

I still need help, can you please guide me on how can I fix this issue?

Orbiter commented 11 months ago

I suspect the docker image is still at Java 8. Let me see.

Orbiter commented 11 months ago

not really, it was a complex mixture of other problems. Fixed them all in https://github.com/yacy/yacy_search_server/commit/b9912ff50d1af3a20bb0c5c1d2b19e35442f7db1

mbledkowski commented 11 months ago

@Orbiter I fixed it myself, before I saw the answer. In my case, I changed base image to arm64v8/eclipse-temurin:17-jammy and added git to apt install. What I noticed when researching this issue is that openjdk on Docker Hub is officially deprecated. Do you see in the future an option to move to other solution (e.g. eclipse-temurin as in my case)?