Maven dependency Openshift-quarkus uses quarkus fabric8 build inside BuildConfig

Solution Verified - Updated -

Issue

  • Quarkus build on BuildConfig uses a separate SA and fails:
NFO] [io.quarkus.container.image.openshift.deployment.OpenshiftProcessor] Starting (in-cluster) container image build for jar using: BINARY on server: https://api.akp25-rqef4-bev.3hug.p3.openshiftapps.com:443/ in namespace:eapsessionsoption2.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  9.344 s
[INFO] Finished at: 2023-10-15T16:51:37-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.redhat.quarkus.platform:quarkus-maven-plugin:2.13.8.Final-redhat-00004:build (default) on project push-registy-poc: Failed to build quarkus application: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
[ERROR]     [error]: Build step io.quarkus.container.image.openshift.deployment.OpenshiftProcessor#openshiftBuildFromJar threw an exception: io.fabric8.kubernetes.client.KubernetesClientException: An error has occurred.
[ERROR]     at io.fabric8.kubernetes.client.KubernetesClientException.launderThrowable(KubernetesClientException.java:129)
[ERROR]     at io.fabric8.kubernetes.client.KubernetesClientException.launderThrowable(KubernetesClientException.java:122)
[ERROR]     at io.fabric8.kubernetes.client.dsl.base.OperationSupport.restCall(OperationSupport.java:749)
[ERROR]     at io.fabric8.kubernetes.client.BaseClient.getApiGroups(BaseClient.java:135)
[ERROR]     at io.fabric8.openshift.client.OpenshiftAdapterSupport.lambda$isOpenShiftAPIGroups$1(OpenshiftAdapterSupport.java:61)
[ERROR]     at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
[ERROR]     at io.fabric8.openshift.client.OpenshiftAdapterSupport.isOpenShiftAPIGroups(OpenshiftAdapterSupport.java:59)
[ERROR]     at io.fabric8.openshift.client.OpenshiftAdapterSupport.isAdaptable(OpenshiftAdapterSupport.java:38)
[ERROR]     at io.fabric8.openshift.client.OpenshiftAdapterSupport.adapt(OpenshiftAdapterSupport.java:42)
[ERROR]     at io.fabric8.openshift.client.OpenShiftExtensionAdapter.adapt(OpenShiftExtensionAdapter.java:56)
[ERROR]     at io.fabric8.kubernetes.client.BaseClient.adapt(BaseClient.java:107)
[ERROR]     at io.quarkus.container.image.openshift.deployment.OpenshiftProcessor.toOpenshiftClient(OpenshiftProcessor.java:382)
[ERROR]     at io.quarkus.container.image.openshift.deployment.OpenshiftProcessor.createContainerImage(OpenshiftProcessor.java:367)
[ERROR]     at io.quarkus.container.image.openshift.deployment.OpenshiftProcessor.openshiftBuildFromJar(OpenshiftProcessor.java:275)
[ERROR]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR]     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[ERROR]     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR]     at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[ERROR]     at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:909)
[ERROR]     at io.quarkus.builder.BuildContext.run(BuildContext.java:281)
[ERROR]     at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
[ERROR]     at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
[ERROR]     at java.base/java.lang.Thread.run(Thread.java:833)
[ERROR]     at org.jboss.threads.JBossThread.run(JBossThread.java:501)
[ERROR] Caused by: java.net.UnknownHostException: api.akp25-rqef4-bev.3hug.p3.openshiftapps.com: Name or service not known
[ERROR]     at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
[ERROR]     at java.base/java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:934)
[ERROR]     at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1543)
[ERROR]     at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:852)
[ERROR]     at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1533)
[ERROR]     at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1385)
[ERROR]     at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1306)
[ERROR]     at okhttp3.Dns.lambda$static$0(Dns.java:39)
[ERROR]     at okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:171)
[ERROR]     at okhttp3.internal.connection.RouteSelector.nextProxy(RouteSelector.java:135)
[ERROR]     at okhttp3.internal.connection.RouteSelector.next(RouteSelector.java:84)
[ERROR]     at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.java:187)
[ERROR]     at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.java:108)
[ERROR]     at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.java:88)
[ERROR]     at okhttp3.internal.connection.Transmitter.newExchange(Transmitter.java:169)
[ERROR]     at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:41)
[ERROR]     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
[ERROR]     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
[ERROR]     at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
[ERROR]     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
[ERROR]     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
[ERROR]     at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
[ERROR]     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
[ERROR]     at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
[ERROR]     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
[ERROR]     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
[ERROR]     at io.fabric8.kubernetes.client.okhttp.OkHttpClientBuilderImpl$InteceptorAdapter.intercept(OkHttpClientBuilderImpl.java:62)
[ERROR]     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
[ERROR]     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
[ERROR]     at io.fabric8.kubernetes.client.okhttp.OkHttpClientBuilderImpl$InteceptorAdapter.intercept(OkHttpClientBuilderImpl.java:62)
[ERROR]     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
[ERROR]     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
[ERROR]     at io.fabric8.kubernetes.client.okhttp.OkHttpClientBuilderImpl$InteceptorAdapter.intercept(OkHttpClientBuilderImpl.java:62)
[ERROR]     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
[ERROR]     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
[ERROR]     at io.fabric8.kubernetes.client.okhttp.OkHttpClientBuilderImpl$InteceptorAdapter.intercept(OkHttpClientBuilderImpl.java:62)
[ERROR]     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
[ERROR]     at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
[ERROR]     at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)
[ERROR]     at okhttp3.RealCall.execute(RealCall.java:81)
[ERROR]     at io.fabric8.kubernetes.client.okhttp.OkHttpClientImpl.send(OkHttpClientImpl.java:138)
[ERROR]     at io.fabric8.kubernetes.client.dsl.base.OperationSupport.retryWithExponentialBackoff(OperationSupport.java:577)
[ERROR]     at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:556)
[ERROR]     at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:521)
[ERROR]     at io.fabric8.kubernetes.client.dsl.base.OperationSupport.handleResponse(OperationSupport.java:505)
[ERROR]     at io.fabric8.kubernetes.client.dsl.base.OperationSupport.restCall(OperationSupport.java:739)
[ERROR]     ... 22 more: Unknown host api.id.openshiftapps.com: Name or service not known
[ERROR] -> [Help 1]

Environment

  • OpenJDK 8, 11, 17
  • Red hat OpenShift Container Platform (OCP): 4.x
  • Red Hat Build of Quarkus

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content