spring-cloud / spring-cloud-kubernetes

Kubernetes integration with Spring Cloud Discovery Client, Configuration, etc...
Apache License 2.0
3.46k stars 1.03k forks source link

[els.V1Service-1] i.k.c.informer.cache ReflectorRunnable : class io.kubernetes.client.openapi.models.V1Service#Reflector loop failed unexpectedly #1632

Closed rsrini7 closed 5 months ago

rsrini7 commented 5 months ago

Describe the bug I tried deploying spring boot admin server to kubernetes, getting below exception

2024-04-06 12:05:01.033 ERROR [ my-spring-boot-admin ] 1 —— [els.V1Service-1] i.k.c.informer.cache ReflectorRunnable : class io.kubernetes.client.openapi.models.V1Service#Reflector loop failed unexpectedly

java.lang llegalStateException: java.net.SocketException: Connection reset at io.kubernetes.client.util.generic.GenericKubernetesApi.checkForlOException(GenericKubernetesApi.java:1333) at io.kubernetes.client.util.generic.GenericKubernetesApi.responseFromApiException(GenericKubernetesApi.java:1340) at io.kubernetes.client.util.generic.GenericKubernetesApi.executeCall(GenericKubernetesApi.java:1367) at io.kubernetes.client.util.generic.GenericKubernetesApi.list(GenericKubernetesApi.java:571) at io.kubernetes.client.informer.SharedinformerFactory$2.list(SharedinformerFactory.java:299) at io.kubernetes.client.informer.cache.ReflectorRunnable.run(ReflectorRunnable.java:91) at java.base/javautil.concurrent.ExecutorsSRunnableAdapter.call(Executors.java:572) at java.base/java.util.concurrent.FutureTask runAndReset(FutureTask.java:358) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) at java.base/java.util.concurrent.ThreadPoolExecutor.nunWorker(ThreadPoolExecutor.java:1144) at java.base/javautil.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) at java base/java lang.Thread.run(Thread.java:1583) Caused by: java.net SocketException: Connection reset at java.base/sun.nio.ch.NioSocketimpl.implRead(NioSocketimpl.java:318) at java.base/sun.nio.ch.NioSocketimpl.read(NioSocketimpl.java:346) at java.base/sun.nio.ch.NioSocketimpl$1.read(NioSocketimpl.java:796) at java.base/java.net.Socket$SocketinputStream.read(Socket.java:1099) at java.base/sun.security.ssl.SSLSocketinputRecord.read(SSLSocketinputRecord.java:489) at java.base/sun.security.ssl.SSLSocketinputRecord.readHeader(SSLSocketinputRecord.java:483) at java.base/sun.security.ssl.SSLSocketinputRecord.decode(SSLSocketinputRecord.java:160) at java.base/sun.security.ssl.SSLTransport.decode(SSLTransport.java:111) at java.base/sun.security.ssl.SSLSocketimpl.decode(SSLSocketimpl.java:1506) at java.base/sun.security.ssl.SSLSocketimpl.readHandshakeRecord(SSLSocketimpl.java:1421) at java.base/sun.security.ssl.SSLSocketimpl.startHandshake(SSLSocketimpl.java:455) at java.base/sun.security.ssl.SSLSocketimpl.startHandshake(SSLSocketimpl.java:426) at okhttp3.intemal.connection.ConnectPlan.connectTis(ConnectPlan.kt:335) at okhttp3.intemal.connection.ConnectPlan.connectTlsEtc(ConnectPlan.kt:197)

https://github.com/spring-cloud/spring-cloud-kubernetes/issues/762 issue is similar, but i use all latest spring boot and spring boot admin and kubernetes cluster.

Sample https://github.com/ch4dwick/spring-boot-admin-kubernetes

wind57 commented 5 months ago

there are no steps there on how to re-produce the problem. what are the exact steps for that?

wind57 commented 5 months ago

@ryanjbaxter would you be so kind for add the feedback tag in here? thank you

rsrini7 commented 5 months ago

Apologies, The code i used inside my office kubernetes setup. I am tring to setup in my local minikube to reproduce the same. May i know, what are the scenarios the exception can occur so that i can add ingress / egress rules if anything to be required to be added ?

wind57 commented 5 months ago

From what I have looked, you are reporting the issue against an existing repo. So it seems you are using that repository and you are getting the issue, no?

If so, just tell us how you run that repository locally. Otherwise, that error comes from a client we are using, not directly from our code, so I can't tell anything about scenarios :(

rsrini7 commented 5 months ago

Yes, i am using that given repo in my office kubernetes environment and i am getting the same exception when i deploy into k8s and when the application starts the above mentioned exception occurs.

when i run with locally there is no issues and application starts. Its because discoveryclient is causing the exception when i deploy the application to k8s. if i remove discovery client tha app starts and but client registrations happens but the client status all are down.

wind57 commented 5 months ago

well, without a way for us to reproduce that in minikube/kind for example, with clear instructions on what we must do, it is complicated to tell what is going on...

rsrini7 commented 5 months ago

Agree. will try to reproduce in minikube and get back.

spring-cloud-issues commented 5 months ago

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-cloud-issues commented 5 months ago

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.