irods / irods_client_nfsrods

An nfs4j Virtual File System implementation supporting the iRODS Data Grid
BSD 3-Clause "New" or "Revised" License
8 stars 9 forks source link

Build fails after most recent OpenJDK 17.0.7 update #179

Closed dreynol closed 9 months ago

dreynol commented 1 year ago

It appears the release of OpenJDK version 17.0.7 on Ubuntu 18.04 has introduced a dependency problem with ca-certificates-java. As a result, the docker build step now fails. We have been able to work around this by modifying the Dockerfile to explicitly install ca-certificates-java before installing openjdk-17-jdk:

RUN DEBIAN_FRONTEND=noninteractive \
    apt-get update && apt-get upgrade -y && \
    apt-get install -y apt-transport-https && \
    apt-get install -y ca-certificates-java && \
    apt-get install -y openjdk-17-jdk libnss-sss

For completeness, here is the relevant error/traceback:

$ sudo docker build -t local/nfsrods .
[+] Building 71.2s (6/9)                                                        
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 744B                                       0.0s
 => [internal] load .dockerignore                                          0.1s
 => => transferring context: 2B                                            0.0s
 => [internal] load metadata for docker.io/library/ubuntu:18.04            0.6s
 => [1/5] FROM docker.io/library/ubuntu:18.04@sha256:14f1045816502e16fcbf  1.9s
 => => resolve docker.io/library/ubuntu:18.04@sha256:14f1045816502e16fcbf  0.0s
 => => sha256:14f1045816502e16fcbfc0b2a76747e9f5e40bc3899 1.33kB / 1.33kB  0.0s
 => => sha256:ffa418d98d4c763f2cba0d3b37e741c3d8b20dc6b60267e 424B / 424B  0.0s
 => => sha256:97ba4bbc97fcec201c950799697650b5cd8e5de1503 2.30kB / 2.30kB  0.0s
 => => sha256:4e43cebf9258af1a3b1edd74432c71dcb190dea87 25.69MB / 25.69MB  0.6s
 => => extracting sha256:4e43cebf9258af1a3b1edd74432c71dcb190dea879f69291  1.1s
 => [internal] load build context                                          0.3s
 => => transferring context: 23.64MB                                       0.3s
 => ERROR [2/5] RUN DEBIAN_FRONTEND=noninteractive     apt-get update &&  68.6s
------                                                                          
 > [2/5] RUN DEBIAN_FRONTEND=noninteractive     apt-get update && apt-get upgrade -y &&     apt-get install -y apt-transport-https &&     apt-get install -y openjdk-17-jdk libnss-sss:
[... output trimmed ...]
#0 65.87 Setting up ca-certificates-java (20180516ubuntu1~18.04.1) ...
#0 65.90 head: cannot open '/etc/ssl/certs/java/cacerts' for reading: No such file or directory
#0 65.95 Exception in thread "main" java.lang.InternalError: Error loading java.security file
#0 65.95    at java.base/java.security.Security.initialize(Security.java:106)
#0 65.95    at java.base/java.security.Security$1.run(Security.java:84)
#0 65.95    at java.base/java.security.Security$1.run(Security.java:82)
#0 65.95    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
#0 65.95    at java.base/java.security.Security.<clinit>(Security.java:82)
#0 65.95    at java.base/sun.security.jca.ProviderList.<init>(ProviderList.java:178)
#0 65.96    at java.base/sun.security.jca.ProviderList$2.run(ProviderList.java:96)
#0 65.96    at java.base/sun.security.jca.ProviderList$2.run(ProviderList.java:94)
#0 65.96    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
#0 65.96    at java.base/sun.security.jca.ProviderList.fromSecurityProperties(ProviderList.java:93)
#0 65.96    at java.base/sun.security.jca.Providers.<clinit>(Providers.java:55)
#0 65.96    at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:156)
#0 65.96    at java.base/java.security.cert.CertificateFactory.getInstance(CertificateFactory.java:193)
#0 65.96    at org.debian.security.KeyStoreHandler.<init>(KeyStoreHandler.java:50)
#0 65.96    at org.debian.security.UpdateCertificates.<init>(UpdateCertificates.java:65)
#0 65.96    at org.debian.security.UpdateCertificates.main(UpdateCertificates.java:51)
#0 65.96 dpkg: error processing package ca-certificates-java (--configure):
#0 65.96  installed ca-certificates-java package post-installation script subprocess returned error exit status 1
#0 65.96 Setting up libgail18:amd64 (2.24.32-1ubuntu1) ...
#0 65.98 Setting up libgail-common:amd64 (2.24.32-1ubuntu1) ...
#0 65.99 Setting up humanity-icon-theme (0.6.15) ...
#0 66.15 dpkg: dependency problems prevent configuration of openjdk-17-jre-headless:amd64:
#0 66.15  openjdk-17-jre-headless:amd64 depends on ca-certificates-java; however:
#0 66.15   Package ca-certificates-java is not configured yet.
#0 66.15 
#0 66.15 dpkg: error processing package openjdk-17-jre-headless:amd64 (--configure):
#0 66.15  dependency problems - leaving unconfigured
#0 66.16 dpkg: dependency problems prevent configuration of openjdk-17-jre:amd64:
#0 66.16  openjdk-17-jre:amd64 depends on openjdk-17-jre-headless (= 17.0.7+7~us1-0ubuntu1~18.04); however:
#0 66.16   Package openjdk-17-jre-headless:amd64 is not configured yet.
#0 66.16 
#0 66.16 dpkg: error processing package openjdk-17-jre:amd64 (--configure):
#0 66.16  dependency problems - leaving unconfigured
#0 66.16 Setting up libgtk2.0-bin (2.24.32-1ubuntu1) ...
#0 66.17 dpkg: dependency problems prevent configuration of openjdk-17-jdk-headless:amd64:
#0 66.17  openjdk-17-jdk-headless:amd64 depends on openjdk-17-jre-headless (= 17.0.7+7~us1-0ubuntu1~18.04); however:
#0 66.17   Package openjdk-17-jre-headless:amd64 is not configured yet.
#0 66.17 
#0 66.17 dpkg: error processing package openjdk-17-jdk-headless:amd64 (--configure):
#0 66.17  dependency problems - leaving unconfigured
#0 66.17 Setting up ubuntu-mono (16.10+18.04.20181005-0ubuntu1) ...
#0 66.22 dpkg: dependency problems prevent configuration of openjdk-17-jdk:amd64:
#0 66.22  openjdk-17-jdk:amd64 depends on openjdk-17-jre (= 17.0.7+7~us1-0ubuntu1~18.04); however:
#0 66.22   Package openjdk-17-jre:amd64 is not configured yet.
#0 66.22  openjdk-17-jdk:amd64 depends on openjdk-17-jdk-headless (= 17.0.7+7~us1-0ubuntu1~18.04); however:
#0 66.22   Package openjdk-17-jdk-headless:amd64 is not configured yet.
#0 66.22 
#0 66.22 dpkg: error processing package openjdk-17-jdk:amd64 (--configure):
#0 66.22  dependency problems - leaving unconfigured
#0 66.22 Processing triggers for libc-bin (2.27-3ubuntu1.6) ...
#0 66.25 Processing triggers for ca-certificates (20211016ubuntu0.18.04.1) ...
#0 66.26 Updating certificates in /etc/ssl/certs...
#0 66.55 0 added, 0 removed; done.
#0 66.55 Running hooks in /etc/ca-certificates/update.d...
#0 66.55 
#0 66.62 Exception in thread "main" java.lang.InternalError: Error loading java.security file
#0 66.62    at java.base/java.security.Security.initialize(Security.java:106)
#0 66.62    at java.base/java.security.Security$1.run(Security.java:84)
#0 66.62    at java.base/java.security.Security$1.run(Security.java:82)
#0 66.62    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
#0 66.62    at java.base/java.security.Security.<clinit>(Security.java:82)
#0 66.62    at java.base/sun.security.jca.ProviderList.<init>(ProviderList.java:178)
#0 66.62    at java.base/sun.security.jca.ProviderList$2.run(ProviderList.java:96)
#0 66.62    at java.base/sun.security.jca.ProviderList$2.run(ProviderList.java:94)
#0 66.62    at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
#0 66.62    at java.base/sun.security.jca.ProviderList.fromSecurityProperties(ProviderList.java:93)
#0 66.62    at java.base/sun.security.jca.Providers.<clinit>(Providers.java:55)
#0 66.62    at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:156)
#0 66.62    at java.base/java.security.cert.CertificateFactory.getInstance(CertificateFactory.java:193)
#0 66.62    at org.debian.security.KeyStoreHandler.<init>(KeyStoreHandler.java:50)
#0 66.62    at org.debian.security.UpdateCertificates.<init>(UpdateCertificates.java:65)
#0 66.62    at org.debian.security.UpdateCertificates.main(UpdateCertificates.java:51)
#0 66.62 E: /etc/ca-certificates/update.d/jks-keystore exited with code 1.
#0 66.62 done.
#0 66.63 Processing triggers for libgdk-pixbuf2.0-0:amd64 (2.36.11-2) ...
#0 66.66 Errors were encountered while processing:
#0 66.66  ca-certificates-java
#0 66.66  openjdk-17-jre-headless:amd64
#0 66.66  openjdk-17-jre:amd64
#0 66.66  openjdk-17-jdk-headless:amd64
#0 66.66  openjdk-17-jdk:amd64
#0 66.69 E: Sub-process /usr/bin/dpkg returned an error code (1)
------
Dockerfile:10
--------------------
   9 |     
  10 | >>> RUN DEBIAN_FRONTEND=noninteractive \
  11 | >>>     apt-get update && apt-get upgrade -y && \
  12 | >>>     apt-get install -y apt-transport-https && \
  13 | >>>     apt-get install -y openjdk-17-jdk libnss-sss
  14 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c DEBIAN_FRONTEND=noninteractive     apt-get update && apt-get upgrade -y &&     apt-get install -y apt-transport-https &&     apt-get install -y openjdk-17-jdk libnss-sss" did not complete successfully: exit code: 100
korydraughn commented 1 year ago

This looks very similar to the following:

Will reproduce and review proposed solution.

korydraughn commented 1 year ago

Which version of NFSRODS did you build? Do you have a SHA?

dreynol commented 1 year ago

It was a fresh clone so the most recent commit: 8c686ca0f5a1bf5da0dfa0a9443036d650a56402

korydraughn commented 9 months ago

I tried reproducing this, but could not. The image is building without errors on my computer.

I'm running Ubuntu 20.04 and using Docker version 24.0.6, build ed223bc.

@dreynol Are you still able to reproduce this?

dreynol commented 9 months ago

I can no longer reproduce either. It looks like the underlying issue with ca-certificates-java may have been fixed with this update:

https://answers.launchpad.net/ubuntu/+source/ca-certificates-java/20180516ubuntu1~18.04.2

korydraughn commented 9 months ago

Excellent.

Closing.