microsoft / mindaro

Bridge to Kubernetes - for Visual Studio and Visual Studio Code
MIT License
307 stars 106 forks source link

Failed to refresh the kubeconfig token: The system cannot find the file specified. #156

Open cslovell opened 3 years ago

cslovell commented 3 years ago

Describe the bug A clear and concise description of what the bug is.

After installing Bridge to Kubernetes on Windows, I attempt to configure it, and it throws an error:

image

To Reproduce Steps to follow to reproduce this issue.

(1) Install Bridge to Kubernetes on WSL (2) Attempt to connect a local API to a GCP cluster (3) Observe that it appears to configure correctly (4) Start Debugging FastAPI hello world Python app (5) Observe that the Kubernetes component starts but the app itself never starts to debug (6) Attempt to make it work in Windows: install bridge to Kubernetes on Windows host (7) Clone same project to windows; attempt to run Bridge to Kubernetes by clicking on the Kubernetes button (8) Observe error

**Expected behavior** A clear and concise description of what you expected to happen. I expected the configuration stage to work. **Logs** Attach logs from the following directory: For Windows: %TEMP%/Bridge to Kubernetes ``` 2021-04-09T00:01:40.4234334Z | MindaroCli | TRACE | Event: Command.Start {"properties":{"arguments":"check-credentials --namespace sdgontologies","isRoutingEnabled":"false"},"metrics":null}\nOperation context: {"clientRequestId":null,"correlationId":"d89cf5f6-3f03-4c3f-8347-ee3c4bf4b0dc1617926492870:07b0857377cf","requestId":null,"userSubscriptionId":null,"startTime":"2021-04-09T00:01:40.0469989Z","userAgent":"VSCode/1.0.120210408","requestHttpMethod":null,"requestUri":null,"version":"1.0.20210408.1","requestHeaders":{},"loggingProperties":{"applicationName":"MindaroCli","deviceOperatingSystem":"Microsoft Windows 10.0.19041","framework":".NET Core 3.1.9","macAddressHash":"xxx","processId":18976,"targetEnvironment":"Production","commandId":"07b0857377cf"}} 2021-04-09T00:01:40.5440151Z | MindaroCli | TRACE | Running Microsoft.BridgeToKubernetes.Exe.Commands.Connect.CheckCredentialsCommand... 2021-04-09T00:01:40.5477168Z | MindaroCli | TRACE | Initializing progress reporter... 2021-04-09T00:01:41.7655237Z | MindaroCli | ERROR | Dependency: List Contexts {"target":null,"success":false,"duration":null,"properties":{"requestId":"null","clientRequestId":"null","correlationRequestId":"null"}} 2021-04-09T00:01:41.8059462Z | MindaroCli | ERROR | Logging handled exception: System.ComponentModel.Win32Exception: {"ClassName":"System.ComponentModel.Win32Exception","Message":"The system cannot find the file specified.","Data":null,"InnerException":null,"HelpURL":null,"StackTraceString":" at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)\r\n at System.Diagnostics.Process.Start()\r\n at k8s.Authentication.GcpTokenProvider.RefreshToken()\r\n at k8s.Authentication.GcpTokenProvider.GetAuthenticationHeaderAsync(CancellationToken cancellationToken)\r\n at Microsoft.Rest.TokenCredentials.ProcessHttpRequestAsync(HttpRequestMessage request, CancellationToken cancellationToken)\r\n at k8s.Kubernetes.ListNamespacedPodWithHttpMessagesAsync(String namespaceParameter, Nullable`1 allowWatchBookmarks, String continueParameter, String fieldSelector, String labelSelector, Nullable`1 limit, String resourceVersion, String resourceVersionMatch, Nullable`1 timeoutSeconds, Nullable`1 watch, String pretty, Dictionary`2 customHeaders, CancellationToken cancellationToken)\r\n at k8s.KubernetesExtensions.ListNamespacedPodAsync(IKubernetes operations, String namespaceParameter, Nullable`1 allowWatchBookmarks, String continueParameter, String fieldSelector, String labelSelector, Nullable`1 limit, String resourceVersion, String resourceVersionMatch, Nullable`1 timeoutSeconds, Nullable`1 watch, String pretty, CancellationToken cancellationToken)\r\n at Microsoft.BridgeToKubernetes.Common.Kubernetes.KubernetesClient.<>c__DisplayClass29_0.<b__0>d.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at Microsoft.BridgeToKubernetes.Common.Kubernetes.KubernetesClient.<>c__DisplayClass70_0`1.<b__0>d.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at Microsoft.BridgeToKubernetes.Common.Utilities.WebUtilities.RetryUntilTimeAsync(Func`2 action, TimeSpan maxWaitTime, CancellationToken cancellationToken)\r\n at Microsoft.BridgeToKubernetes.Common.Kubernetes.KubernetesClient.ClientInvokeWrapperAsync[T](Func`1 handler, String operation, CancellationToken cancellationToken)\r\n at Microsoft.BridgeToKubernetes.Common.Kubernetes.KubernetesClient.ListPodsInNamespaceAsync(String namespaceName, IEnumerable`1 labels, CancellationToken cancellationToken)\r\n at Microsoft.BridgeToKubernetes.Library.Client.ManagementClients.KubernetesManagementClient.<>c__DisplayClass5_0.<b__0>d.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at Microsoft.BridgeToKubernetes.Library.ManagementClients.ManagementClientExceptionStrategy.<>c__DisplayClass3_0.<b__0>d.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at Microsoft.BridgeToKubernetes.Library.ManagementClients.ManagementClientExceptionStrategy.RunWithHandlingAsync[T](Func`1 func, FailureConfig failureConfig)\r\n at Microsoft.BridgeToKubernetes.Library.Client.ManagementClients.KubernetesManagementClient.CheckCredentialsAsync(String targetNamespace, CancellationToken cancellationToken)\r\n at Microsoft.BridgeToKubernetes.Exe.Commands.Connect.CheckCredentialsCommand.ExecuteAsync()","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":null,"HResult":-2147467259,"Source":"System.Diagnostics.Process","WatsonBuckets":null,"NativeErrorCode":2} 2021-04-09T00:01:41.8090781Z | MindaroCli | ERROR | The system cannot find the file specified.\n 2021-04-09T00:01:42.5275946Z | MindaroCli | TRACE | Event: Command.End {"properties":{"arguments":"check-credentials --namespace sdgontologies","result":"Failed","failureReason":"The system cannot find the file specified."},"metrics":{"duration":2202.0}} ``` For OSX/Linux: $TMPDIR/Bridge to Kubernetes If you are a Visual Studio user, - Set the environment variable MS_VS_AZUREDEVSPACES_TOOLS_LOGGING_ENABLED=true - Open Visual Studio and run your scenario - Provide logs from: %temp%\Microsoft.VisualStudio.Kubernetes.Debugging **Environment Details** Client used (VS Code/Visual Studio): VS Code Client's version: 1.0.120210408 Operating System: ![image](https://user-images.githubusercontent.com/6457695/114111185-5ea89900-98a7-11eb-9d73-76faf3d3be93.png) ![image](https://user-images.githubusercontent.com/6457695/114111146-3a4cbc80-98a7-11eb-9330-f037b352ea9a.png) ![image](https://user-images.githubusercontent.com/6457695/114111162-46387e80-98a7-11eb-932b-e66104177b14.png) **Additional context** Add any other outputs from the clients or context you would like to share.
amsoedal commented 3 years ago

Hey @cslovell thanks for reporting this issue! From first glance I'm not totally sure what's going on, but I'll log a bug for us to investigate further.