Quarkus: OpenShift deployment (quarkus-openshift extension) fails on Windows

Created on 8 May 2020  路  8Comments  路  Source: quarkusio/quarkus

Describe the bug
OpenShift deployment using the quarkus-openshift extension fails on Windows.
The same project works fine on Linux.

Expected behavior
Deployment works on Windows too.

Actual behavior

[WARNING] [io.quarkus.container.image.s2i.deployment.S2iProcessor] No Openshift manifests were generated (most likely due to the fact that the service is not an HTTP service) so no s2i process will be taking place
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

To Reproduce
Steps to reproduce the behavior:

  1. Clone repo https://github.com/haraldatbmw/quarkus-openshift-deployment
  2. Login to your OpenShift cluster oc login ...
  3. Start deployment mvn clean package -Dquarkus.kubernetes.deploy=true

Configuration

quarkus.kubernetes-client.trust-certs=true
quarkus.s2i.base-jvm-image=registry.access.redhat.com/openjdk/openjdk-11-rhel7
quarkus.openshift.expose=true

Environment (please complete the following information):

  • Output of uname -a or ver: Microsoft Windows [Version 10.0.17134.1425]
  • Output of java -version:
    openjdk version "11.0.6" 2020-01-14 LTS
    OpenJDK Runtime Environment Zulu11.37+17-CA (build 11.0.6+10-LTS)
    OpenJDK 64-Bit Server VM Zulu11.37+17-CA (build 11.0.6+10-LTS, mixed mode)
  • Quarkus version or git rev: 1.4.2.Final
  • Build tool (ie. output of mvnw --version or gradlew --version): Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)

    • oc tool:

      oc v3.11.0+0cbc58b

      kubernetes v1.11.0+d4cacc0

      features: Basic-Auth SSPI Kerberos SPNEGO

enwindows kinbug

Most helpful comment

@iocanel this need to be fixed. Basically it looks like S2iProcessor is assuming Unix path only, which results in failure on Windows.

I could obviously blindly replace with platform paths, but I think it's best if you take a look and see if there might be more things going in s2i that could fail (or be improved to not depend on paths).

Furthermore, we need to find a way to get s2i running as part of the tests somehow, so we can at least be sure in Windows that everything but the deployment works.

All 8 comments

reproduced on windows:

[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.4.2.Final:build (default) on project simple: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]         [error]: Build step io.quarkus.kubernetes.deployment.KubernetesDeployer#deploy threw an exception: java.lang.RuntimeException: A Kubernetes deployment was requested but no extension was found to build a container image. Consider adding one of following extensions: "quarkus-container-image-jib", "quarkus-container-image-docker", "quarkus-container-image-s2i".
[ERROR]         at io.quarkus.kubernetes.deployment.KubernetesDeployer.deploy(KubernetesDeployer.java:60)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR]         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]         at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR]         at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:931)
[ERROR]         at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR]         at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
[ERROR]         at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR]         at org.jboss.threads.JBossThread.run(JBossThread.java:479)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

@iocanel this need to be fixed. Basically it looks like S2iProcessor is assuming Unix path only, which results in failure on Windows.

I could obviously blindly replace with platform paths, but I think it's best if you take a look and see if there might be more things going in s2i that could fail (or be improved to not depend on paths).

Furthermore, we need to find a way to get s2i running as part of the tests somehow, so we can at least be sure in Windows that everything but the deployment works.

S2iProcessor.java does a a bunch of path lookup/comparisons that assumes linux style paths, i.e. resources/kubernetes.yaml instead of resources\kubernets.yaml

Retested the issue with Quarkus 1.5.0.CR1 on Windows10 with a new error-message.
Linux still working.

@iocanel Should I raise a new issue therefor?

...
[INFO] --- quarkus-maven-plugin:1.5.0.CR1:build (default) @ quarkus-openshift-deployment ---
[INFO] [org.jboss.threads] JBoss Threads version 3.1.1.Final
[INFO] [io.quarkus.deployment.pkg.steps.JarResultBuildStep] Building thin jar: C:\git\Quarkus\quarkus-openshift-deployment\target\quarkus-openshift-deployment-1.0.0-SNAPSHOT-runner.jar
[WARNING] [io.quarkus.kubernetes.deployment.KubernetesProcessor] No registry was set for the container image, so 'ImagePullPolicy' is being force-set to 'IfNotPresent'.
[INFO] Checking for existing resources in: C:\git\Quarkus\quarkus-openshift-deployment\src\main\kubernetes.
[INFO] [io.quarkus.kubernetes.deployment.KubernetesProcessor] Generated the Kubernetes manifests: '\openshift.json,\openshift.yml' in 'C:\git\Quarkus\quarkus-openshift-deployment\target\kubernetes'
[INFO] [io.quarkus.kubernetes.deployment.KubernetesDeploy] Kubernetes API Server at 'https://xxxx.bmwgroup.net:8443/' successfully contacted.
[INFO] [io.quarkus.container.image.s2i.deployment.S2iProcessor] Performing s2i binary build with jar on server: https://xxxx.bmwgroup.net:8443/ in namespace:harald.
[INFO] [io.quarkus.container.image.s2i.deployment.S2iProcessor] Found: ImageStream openjdk-11 repository: registry.access.redhat.com/ubi8/openjdk-11
[INFO] [io.quarkus.container.image.s2i.deployment.S2iProcessor] Applied: ImageStream quarkus-openshift-deployment
[INFO] [io.quarkus.container.image.s2i.deployment.S2iProcessor] Applied: BuildConfig quarkus-openshift-deployment
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  33.329 s
[INFO] Finished at: 2020-05-26T15:02:34+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.5.0.CR1:build (default) on project quarkus-openshift-deployment: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]         [error]: Build step io.quarkus.container.image.s2i.deployment.S2iProcessor#s2iBuildFromJar threw an exception: io.dekorate.deps.kubernetes.client.KubernetesClientException: Operation: [get]  for kind: [ImageStreamTag]  with name: [openjdk-11:latest]  in namespace: [harald]  failed.
[ERROR]         at io.dekorate.deps.kubernetes.client.KubernetesClientException.launderThrowable(KubernetesClientException.java:64)
[ERROR]         at io.dekorate.deps.kubernetes.client.KubernetesClientException.launderThrowable(KubernetesClientException.java:72)
[ERROR]         at io.dekorate.deps.kubernetes.client.dsl.base.BaseOperation.getMandatory(BaseOperation.java:225)
[ERROR]         at io.dekorate.deps.kubernetes.client.dsl.base.BaseOperation.get(BaseOperation.java:168)
[ERROR]         at io.dekorate.s2i.util.S2iUtils.waitForImageStreamTags(S2iUtils.java:67)
[ERROR]         at io.quarkus.container.image.s2i.deployment.S2iProcessor.applyS2iResources(S2iProcessor.java:305)
[ERROR]         at io.quarkus.container.image.s2i.deployment.S2iProcessor.createContainerImage(S2iProcessor.java:265)
[ERROR]         at io.quarkus.container.image.s2i.deployment.S2iProcessor.s2iBuildFromJar(S2iProcessor.java:197)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]         at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[ERROR]         at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]         at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[ERROR]         at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:932)
[ERROR]         at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
[ERROR]         at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2046)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1578)
[ERROR]         at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1452)
[ERROR]         at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR]         at org.jboss.threads.JBossThread.run(JBossThread.java:479)
[ERROR] Caused by: javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[ERROR]         at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
[ERROR]         at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:320)
[ERROR]         at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:263)
[ERROR]         at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:258)
[ERROR]         at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:645)
[ERROR]         at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.onCertificate(CertificateMessage.java:464)
[ERROR]         at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.consume(CertificateMessage.java:360)
[ERROR]         at java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:392)
[ERROR]         at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:443)
[ERROR]         at java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:421)
[ERROR]         at java.base/sun.security.ssl.TransportContext.dispatch(TransportContext.java:177)
[ERROR]         at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:164)
[ERROR]         at java.base/sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1151)
[ERROR]         at java.base/sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1062)
[ERROR]         at java.base/sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:402)
[ERROR]         at io.dekorate.deps.okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:320)
[ERROR]         at io.dekorate.deps.okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:284)
[ERROR]         at io.dekorate.deps.okhttp3.internal.connection.RealConnection.connect(RealConnection.java:169)
[ERROR]         at io.dekorate.deps.okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:258)
[ERROR]         at io.dekorate.deps.okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
[ERROR]         at io.dekorate.deps.okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
[ERROR]         at io.dekorate.deps.okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
[ERROR]         at io.dekorate.deps.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
[ERROR]         at io.dekorate.deps.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
[ERROR]         at io.dekorate.deps.okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
[ERROR]         at io.dekorate.deps.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
[ERROR]         at io.dekorate.deps.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
[ERROR]         at io.dekorate.deps.okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
[ERROR]         at io.dekorate.deps.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
[ERROR]         at io.dekorate.deps.okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:127)
[ERROR]         at io.dekorate.deps.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
[ERROR]         at io.dekorate.deps.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
[ERROR]         at io.dekorate.deps.kubernetes.client.utils.BackwardsCompatibilityInterceptor.intercept(BackwardsCompatibilityInterceptor.java:134)
[ERROR]         at io.dekorate.deps.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
[ERROR]         at io.dekorate.deps.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
[ERROR]         at io.dekorate.deps.kubernetes.client.utils.ImpersonatorInterceptor.intercept(ImpersonatorInterceptor.java:68)
[ERROR]         at io.dekorate.deps.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
[ERROR]         at io.dekorate.deps.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
[ERROR]         at io.dekorate.deps.openshift.client.internal.OpenShiftOAuthInterceptor.intercept(OpenShiftOAuthInterceptor.java:69)
[ERROR]         at io.dekorate.deps.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
[ERROR]         at io.dekorate.deps.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
[ERROR]         at io.dekorate.deps.okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:257)
[ERROR]         at io.dekorate.deps.okhttp3.RealCall.execute(RealCall.java:93)
[ERROR]         at io.dekorate.deps.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:469)
[ERROR]         at io.dekorate.deps.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:430)
[ERROR]         at io.dekorate.deps.kubernetes.client.dsl.base.OperationSupport.handleGet(OperationSupport.java:395)
[ERROR]         at io.dekorate.deps.kubernetes.client.dsl.base.OperationSupport.handleGet(OperationSupport.java:376)
[ERROR]         at io.dekorate.deps.kubernetes.client.dsl.base.BaseOperation.handleGet(BaseOperation.java:845)
[ERROR]         at io.dekorate.deps.kubernetes.client.dsl.base.BaseOperation.getMandatory(BaseOperation.java:214)
[ERROR]         ... 17 more
[ERROR] Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[ERROR]         at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:439)
[ERROR]         at java.base/sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:306)
[ERROR]         at java.base/sun.security.validator.Validator.validate(Validator.java:264)
[ERROR]         at java.base/sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:313)
[ERROR]         at java.base/sun.security.ssl.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:222)
[ERROR]         at java.base/sun.security.ssl.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:129)
[ERROR]         at java.base/sun.security.ssl.CertificateMessage$T12CertificateConsumer.checkServerCerts(CertificateMessage.java:629)
[ERROR]         ... 61 more
[ERROR] Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[ERROR]         at java.base/sun.security.provider.certpath.SunCertPathBuilder.build(SunCertPathBuilder.java:141)
[ERROR]         at java.base/sun.security.provider.certpath.SunCertPathBuilder.engineBuild(SunCertPathBuilder.java:126)
[ERROR]         at java.base/java.security.cert.CertPathBuilder.build(CertPathBuilder.java:297)
[ERROR]         at java.base/sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:434)
[ERROR]         ... 67 more
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

@haraldatbmw can you try adding quarkus.kubernetes-client.trust-certs=true?

Also, are setting any other configuration values for quarkus.kubernetes-client.... ?

@geoand I already had the property quarkus.kubernetes-client.trust-certs=true which causes the error on Windows.

I just now explicit set the env variable set KUBERNETES_TRUST_CERTIFICATES=true before calling maven. And now it works. It seams that the quarkus property does not work on windows!?

That is very weird... Can you please open a new issue for that?

Was this page helpful?
0 / 5 - 0 ratings