Skip to content

Toolkit window stays empty if current cluster isn't reachable #757

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

Closed
adietish opened this issue Apr 30, 2024 · 1 comment · Fixed by #759
Closed

Toolkit window stays empty if current cluster isn't reachable #757

adietish opened this issue Apr 30, 2024 · 1 comment · Fixed by #759
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@adietish
Copy link
Collaborator

adietish commented Apr 30, 2024

Steps:

  1. ASSERT: have an unreachable current cluster in current context (ex. stopped minikube)
  2. EXEC: launch plugin

Result:
The toolkit window stays empty, nothing is shown. Also there's a fatal IDE error:

io.fabric8.kubernetes.client.KubernetesClientException: An error has occurred.
	at io.fabric8.kubernetes.client.KubernetesClientException.launderThrowable(KubernetesClientException.java:129)
	at io.fabric8.kubernetes.client.KubernetesClientException.launderThrowable(KubernetesClientException.java:122)
	at io.fabric8.kubernetes.client.dsl.internal.OperationSupport.restCall(OperationSupport.java:718)
	at io.fabric8.kubernetes.client.impl.BaseClient.getApiGroups(BaseClient.java:292)
	at io.fabric8.kubernetes.client.impl.BaseClient.hasApiGroup(BaseClient.java:208)
	at com.redhat.devtools.intellij.common.kubernetes.ClusterHelper.isOpenShift(ClusterHelper.java:28)
	at com.redhat.devtools.intellij.kubernetes.model.client.ClientAdapter$Factory.create(ClientAdapter.kt:84)
	at com.redhat.devtools.intellij.kubernetes.model.client.ClientAdapter$Factory.create(ClientAdapter.kt:67)
	at com.redhat.devtools.intellij.kubernetes.model.client.ClientAdapter$Factory.create$default(ClientAdapter.kt:59)
	at com.redhat.devtools.intellij.kubernetes.model.AllContexts$2.invoke(AllContexts.kt:86)
	at com.redhat.devtools.intellij.kubernetes.model.AllContexts$2.invoke(AllContexts.kt:86)
	at com.redhat.devtools.intellij.kubernetes.model.AllContexts$client$1.invoke(AllContexts.kt:97)
	at com.redhat.devtools.intellij.kubernetes.model.AllContexts$client$1.invoke(AllContexts.kt:95)
	at com.redhat.devtools.intellij.kubernetes.model.util.ResettableLazyProperty.get(ResettableLazyProperty.kt:30)
	at com.redhat.devtools.intellij.kubernetes.model.AllContexts.getAll(AllContexts.kt:112)
	at com.redhat.devtools.intellij.kubernetes.model.AllContexts.getCurrent(AllContexts.kt:103)
	at com.redhat.devtools.intellij.kubernetes.model.ResourceModel.getCurrentContext(ResourceModel.kt:94)
	at com.redhat.devtools.intellij.kubernetes.tree.OpenShiftStructure.canContribute(OpenShiftStructure.kt:184)
	at com.redhat.devtools.intellij.kubernetes.tree.TreeStructure.getValidContributions(TreeStructure.kt:122)
	at com.redhat.devtools.intellij.kubernetes.tree.TreeStructure.createDescriptor(TreeStructure.kt:106)
	at com.intellij.ui.tree.StructureTreeModel$Node.<init>(StructureTreeModel.java:461)
	at com.intellij.ui.tree.StructureTreeModel.getValidRoot(StructureTreeModel.java:397)
	at com.intellij.ui.tree.StructureTreeModel.getRoot(StructureTreeModel.java:314)
	at com.intellij.ui.tree.StructureTreeModel.getRoot(StructureTreeModel.java:37)
	at com.intellij.ui.tree.AsyncTreeModel$CmdGetRoot.computeNode(AsyncTreeModel.java:518)
	at com.intellij.ui.tree.AsyncTreeModel$Command.computeNode(AsyncTreeModel.java:490)
	at com.intellij.util.concurrency.Invoker$Task.run(Invoker.java:381)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:217)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:660)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:735)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:691)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:659)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:79)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:202)
	at com.intellij.util.concurrency.Invoker.startTask(Invoker.java:236)
	at com.intellij.util.concurrency.Invoker.invokeSafely(Invoker.java:194)
	at com.intellij.util.concurrency.Invoker.lambda$offerSafely$0(Invoker.java:177)
	at com.intellij.util.concurrency.Invoker$Background.lambda$offer$0(Invoker.java:508)
	at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:244)
	at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:30)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:222)
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:218)
	at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:210)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
	at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
	at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
	at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.io.IOException: api.rhamilto.devcluster.openshift.com
	at io.fabric8.kubernetes.client.dsl.internal.OperationSupport.waitForResult(OperationSupport.java:504)
	at io.fabric8.kubernetes.client.dsl.internal.OperationSupport.handleResponse(OperationSupport.java:524)
	at io.fabric8.kubernetes.client.dsl.internal.OperationSupport.restCall(OperationSupport.java:711)
	... 47 more
Caused by: java.net.UnknownHostException: api.rhamilto.devcluster.openshift.com
	at java.base/java.net.InetAddress$CachedAddresses.get(InetAddress.java:801)
	at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1533)
	at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1385)
	at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1306)
	at okhttp3.Dns$1.lookup(Dns.java:40)
	at okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:185)
	at okhttp3.internal.connection.RouteSelector.nextProxy(RouteSelector.java:149)
	at okhttp3.internal.connection.RouteSelector.next(RouteSelector.java:84)
	at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:215)
	at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:135)
	at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:114)
	at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:42)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:127)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
	at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
	at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:257)
	at okhttp3.RealCall$AsyncCall.execute(RealCall.java:201)
	at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	... 1 more

Expected result:
The toolking window should list the existing contexts and the current context should show the error that happened when trying to connect to the cluster.

@adietish adietish added kind/bug Something isn't working severity/critical and removed severity/critical labels Apr 30, 2024
@adietish
Copy link
Collaborator Author

At least one can "heal" the situation without restarting the plugin: one can change the current context using oc/kubectl and the tool windows lists the contexts again.

adietish added a commit to adietish/intellij-kubernetes that referenced this issue Apr 30, 2024
adietish added a commit to adietish/intellij-kubernetes that referenced this issue Apr 30, 2024
adietish added a commit to adietish/intellij-kubernetes that referenced this issue Apr 30, 2024
adietish added a commit to adietish/intellij-kubernetes that referenced this issue Apr 30, 2024
adietish added a commit to adietish/intellij-kubernetes that referenced this issue Apr 30, 2024
adietish added a commit to adietish/intellij-kubernetes that referenced this issue Apr 30, 2024
adietish added a commit to adietish/intellij-kubernetes that referenced this issue Apr 30, 2024
adietish added a commit to adietish/intellij-kubernetes that referenced this issue Apr 30, 2024
adietish added a commit to adietish/intellij-kubernetes that referenced this issue May 6, 2024
adietish added a commit to adietish/intellij-kubernetes that referenced this issue May 6, 2024
@adietish adietish self-assigned this May 6, 2024
@adietish adietish moved this to 👀 In review in IDE Cloudaptors May 6, 2024
adietish added a commit to adietish/intellij-kubernetes that referenced this issue May 6, 2024
adietish added a commit to adietish/intellij-kubernetes that referenced this issue May 6, 2024
adietish added a commit to adietish/intellij-kubernetes that referenced this issue May 7, 2024
adietish added a commit to adietish/intellij-kubernetes that referenced this issue May 7, 2024
adietish added a commit that referenced this issue May 7, 2024
adietish added a commit that referenced this issue May 7, 2024
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in IDE Cloudaptors May 7, 2024
@adietish adietish added this to the 1.4.0 milestone Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant