-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[Support] Fabric8 IO client creation is failing with below stacktrace #4650
Comments
Hi Team, Below are the findings - K8s version =
Is this incompatibility is causing above failure while creating the client ? |
Closing to avoid cross-posting with #4653 |
The issue was because the ca.crt in path /var/run/secrets/kubernetes.io/serviceaccount/ca.crt having comments with it which was resulting in empty input exception. Exception in thread "main" java.security.cert.CertificateException: Could not parse certificate: java.io.IOException: Empty input Below is the certificate details.
Could you please let me know why the fabric8 io is not ignoring the comments present in the end of the certificate and reading everything while creating the x509 certificate instance in its code.. The below is block of code throwing the exception when pemInputStream is having commented lines.. CertUtils.java is the class.
Please let us know on this. |
This seems to be a problem only for the trailing entry in the file - if the comment appears in any other place, no exception will be thrown. |
Hi @shawkins , |
See #4716 - it has been targeted for 6.4, but not committed yet so there isn't a snapshot with it available. Feel free to compile from that branch if you want the fix sooner. |
Describe the bug
Hi Team,
I am facing below error during spring boot startup. Any idea what could be the issue ?.
Below dependency is used in my spring boot project.
Stack trace -
14:36:37.314 ERROR SpringApplication 835 Application run failed io.fabric8.kubernetes.client.KubernetesClientException: An error has occurred. at io.fabric8.kubernetes.client.KubernetesClientException.launderThrowable(KubernetesClientException.java:103) at io.fabric8.kubernetes.client.KubernetesClientException.launderThrowable(KubernetesClientException.java:97) at io.fabric8.kubernetes.client.utils.HttpClientUtils.createHttpClient(HttpClientUtils.java:253) at io.fabric8.kubernetes.client.utils.HttpClientUtils.createHttpClient(HttpClientUtils.java:85) at io.fabric8.kubernetes.client.BaseClient.<init>(BaseClient.java:53) at io.fabric8.kubernetes.client.BaseClient.<init>(BaseClient.java:45) at io.fabric8.kubernetes.client.BaseKubernetesClient.<init>(BaseKubernetesClient.java:151) at io.fabric8.kubernetes.client.DefaultKubernetesClient.<init>(DefaultKubernetesClient.java:32) at org.springframework.cloud.kubernetes.fabric8.profile.Fabric8ProfileEnvironmentPostProcessor.isInsideKubernetes(Fabric8ProfileEnvironmentPostProcessor.java:29) at org.springframework.cloud.kubernetes.commons.profile.AbstractKubernetesProfileEnvironmentPostProcessor.addKubernetesProfileIfMissing(AbstractKubernetesProfileEnvironmentPostProcessor.java:81) at org.springframework.cloud.kubernetes.commons.profile.AbstractKubernetesProfileEnvironmentPostProcessor.postProcessEnvironment(AbstractKubernetesProfileEnvironmentPostProcessor.java:66) at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:102) at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:87) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85) at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66) at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:343) at org.springframework.boot.SpringApplication.run(SpringApplication.java:301) at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:164) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:195) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:114) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:77) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85) at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66) at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:343) at org.springframework.boot.SpringApplication.run(SpringApplication.java:301) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) at com.ericsson.oss.common.service.ns.NotificationServiceApplication.main(NotificationServiceApplication.java:35) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) at org.springframework.boot.loader.Launcher.launch(Launcher.java:107) at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) Caused by: java.security.cert.CertificateException: Could not parse certificate: java.io.IOException: Empty input at java.base/sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:115) at java.base/java.security.cert.CertificateFactory.generateCertificate(CertificateFactory.java:355) at io.fabric8.kubernetes.client.internal.CertUtils.createTrustStore(CertUtils.java:98) at io.fabric8.kubernetes.client.internal.CertUtils.createTrustStore(CertUtils.java:74) at io.fabric8.kubernetes.client.internal.SSLUtils.trustManagers(SSLUtils.java:115) at io.fabric8.kubernetes.client.internal.SSLUtils.trustManagers(SSLUtils.java:91) at io.fabric8.kubernetes.client.utils.HttpClientUtils.createHttpClient(HttpClientUtils.java:147) ... 49 common frames omitted Caused by: java.io.IOException: Empty input at java.base/sun.security.provider.X509Factory.engineGenerateCertificate(X509Factory.java:111) ... 55 common frames omitted
Fabric8 Kubernetes Client version
6.0.0
Steps to reproduce
Need to understand more on the stacktrace debugging.
Expected behavior
Microservice pod should be up and running.
Runtime
other (please specify in additional context)
Kubernetes API Server version
1.23
Environment
other (please specify in additional context)
Fabric8 Kubernetes Client Logs
No response
Additional context
kubernetes in openstack environment
The text was updated successfully, but these errors were encountered: