cloud-code-intellij icon indicating copy to clipboard operation
cloud-code-intellij copied to clipboard

gcloud/kubectl operations sometimes time out on windows (Add GKE cluster, get nodes, etc.)

Open radeepr opened this issue 4 years ago • 8 comments

(Please ensure you are running the latest version of Cloud Code for IntelliJ with Help > Check for Updates)

  • Cloud Code for IntelliJ version: 21.10.1-IB.1
  • Google Cloud SDK version: 362.0.0
  • OS: Windows 10 10.0

What did you do?

Signed in to GCP from intellij. In Kubernetes Explorer , tried adding GKE cluster by selecting the project. Had also increased the Kubernetes explorer timeout to 30 seconds.

What did you expect to see?

I expect the GKE cluster in my project to be appearing for selection.

What did you see instead?

The GKE cluster in my GCP project doesn't appear and it just shows timed out. This is making the cloud code plugin not useable for us.

CloudCode_NotLoading_GKE Kubernetes_Available_In_GCPProject

(screenshots are helpful) Feel free to deviate from this template as needed, especially if you are submitting a feature request.

radeepr avatar Oct 29 '21 18:10 radeepr

Hi @radeepr thanks for the report! Could you please attach your IDE log file? (Help > Show Log in Finder > idea.log)

ivanporty avatar Oct 29 '21 18:10 ivanporty

As a workaround in the meanwhile, you can always call this command from Cloud Code Terminal:

  1. Open Menu > Tools > Cloud Code > Tools > Cloud Code Terminal
  2. In the CC terminal, run gcloud container clusters get-credentials CLUSTER_NAME [--region=REGION | --zone=ZONE, -z ZONE]
  3. GKE cluster should appear in the K8s explorer automatically, if not, try refreshing one time

ivanporty avatar Oct 29 '21 18:10 ivanporty

idea.log Attaching the intellij log file.

radeepr avatar Oct 29 '21 19:10 radeepr

We see a few other timeout exceptions in your log file, even around checking Cloud SDK version which is supposed to be very fast. That may have to do with Windows as well since we sometimes see longer process times on Windows. To help diagnosing, how long would the following command take to run if you run in from a terminal? kubectl.exe get nodes -o json

ivanporty avatar Oct 29 '21 19:10 ivanporty

Thanks for the investigation and apologies for delay in getting back,

I was able to able to add GKE cluster with your workaround method. Thanks for that. It takes about 10-12 seconds to load cluster info from GKE which is probably okay to live with.

PS D:\code\CloudCodeHello> date

06 November 2021 17:02:47

PS D:\code\CloudCodeHello> kubectl get nodes -o json

PS D:\code\CloudCodeHello> date

06 November 2021 17:02:59

Apart from that I am finding that the run/debug options also take a lot of time and the screen is quite stuck for a lot of time. I could file a separate one for that.

radeepr avatar Nov 06 '21 11:11 radeepr

Thanks @radeepr. To increase timeout for the Kubernetes explorer operations, you could use Cloud Code settings here:

Screen Shot 2021-11-08 at 9 52 10 AM

Apart from that I am finding that the run/debug options also take a lot of time and the screen is quite stuck for a lot of time. I could file a separate one for that.

I think we don't need a separate issue for that, as this seems to be stemming from the same reason - timing out calls to kubectl. We will rename the issue to apply it more broadly and will work on it. Thank you!

ivanporty avatar Nov 08 '21 14:11 ivanporty

Hi @ivanporty ,

As mentioned in the issue description under "What did you do", I had already tried the option to increase Kubernetes explorer timeout to maximum possible value of 30 seconds. But this doesn't solve the problem.

radeepr avatar Nov 08 '21 16:11 radeepr

Oh sorry about that, it's great you're using that already. That setting won't help with other timeouts such as ones in the run configuration but it should help when using the explorer.

ivanporty avatar Nov 08 '21 18:11 ivanporty