microsoft / mindaro

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

Attempting to start the Bridge to Kubernetes a second time fails #226

Open bobbydams opened 3 years ago

bobbydams commented 3 years ago

Describe the bug I've used this with Python and NodeJs projects, when killing a debugging session using Bridge to Kubernetes with minikube and then attempting to restart the same session I get the following error below.

Error: Failed to validate the requirements to replicate resources locally: Failed to get the container environment: error: unable to upgrade connection: container not found ("frontend")

The terminal process terminated with exit code: 1.

In the kubernetes deployment I notice that it's in status ImagePullBackOff with the following error.

Failed to pull image "<private-docker-registry>/frontend:latest": rpc error: code = Unknown desc = Error response from daemon: Get https://<private-docker-registry>/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

I don't know if this is caused by the fact that we're using a private repository and not docker hub?

I've tried to remove the deployment and re-install, but this doesn't solve the issue. The only solution I've found is to delete the minikube cluster and start over.

To Reproduce

  1. Launch the debugger using Bridge to Kubernetes
  2. Kill the debug session (press Stop button)
  3. Attempt to restart the same session
**Expected behavior** I would expect that killing the debugging session would reset the deployment back to a useable state. **Logs** ``` 2021-09-07T12:06:01.6306910Z | MindaroCli | TRACE | Event: Command.Start {"properties":{"arguments":"prep-connect --output json --service frontend --namespace dimension-local","isRoutingEnabled":"false"},"metrics":null}\nOperation context: {"clientRequestId":null,"correlationId":"b765144f-835a-420a-8ec7-4643e30d65b71631014971270:cb87e7acf5d7","requestId":null,"userSubscriptionId":null,"startTime":"2021-09-07T12:06:01.2409320Z","userAgent":"VSCode/1.0.120210803","requestHttpMethod":null,"requestUri":null,"version":"1.0.20210708.15","requestHeaders":{},"loggingProperties":{"applicationName":"MindaroCli","deviceOperatingSystem":"Darwin 20.6.0 Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:31 PDT 2021; root:xnu-7195.141.2~5/RELEASE_X86_64","framework":".NET Core 3.1.9","macAddressHash":"a97578cb83d597d22384fb7265d6ca21ee66af53b0937a7abbb5b9de558750cf","processId":80082,"targetEnvironment":"Production","commandId":"cb87e7acf5d7"}} 2021-09-07T12:06:01.7077100Z | MindaroCli | TRACE | Running Microsoft.BridgeToKubernetes.Exe.Commands.Connect.PrepConnectCommand...\nOperation context: {"clientRequestId":null,"correlationId":"b765144f-835a-420a-8ec7-4643e30d65b71631014971270:cb87e7acf5d7","requestId":null,"userSubscriptionId":null,"startTime":"2021-09-07T12:06:01.2409320Z","userAgent":"VSCode/1.0.120210803","requestHttpMethod":null,"requestUri":null,"version":"1.0.20210708.15","requestHeaders":{},"loggingProperties":{"applicationName":"MindaroCli","deviceOperatingSystem":"Darwin 20.6.0 Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:31 PDT 2021; root:xnu-7195.141.2~5/RELEASE_X86_64","framework":".NET Core 3.1.9","macAddressHash":"a97578cb83d597d22384fb7265d6ca21ee66af53b0937a7abbb5b9de558750cf","processId":80082,"targetEnvironment":"Production","commandId":"cb87e7acf5d7","targetServiceName":"frontend"}} 2021-09-07T12:06:01.7097560Z | MindaroCli | TRACE | Initializing progress reporter... 2021-09-07T12:06:03.1776750Z | MindaroCli | WARNG | Failed to get the container environment: error: unable to upgrade connection: container not found ("frontend") 2021-09-07T12:06:03.1797530Z | MindaroCli | ERROR | Failed to get the container environment: error: unable to upgrade connection: container not found ("frontend")\n 2021-09-07T12:06:03.1920480Z | MindaroCli | TRACE | Event: Command.End {"properties":{"arguments":"prep-connect --output json --service frontend --namespace dimension-local","result":"Failed","failureReason":"Failed to get the container environment: error: unable to upgrade connection: container not found (\"frontend\")"},"metrics":{"duration":1634.0}} ``` **Environment Details** Client used (VS Code/Visual Studio): VS Code mindaro.mindaro@1.0.120210803 VS Code: 1.60.0 e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff x64 Client's version: v1.21.2 Operating System: macOS **Additional context** minikube version: v1.22.0 commit: a03fbcf166e6f74ef224d4a63be4277d017bb62e Kubernetes Version Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.2", GitCommit:"092fbfbf53427de67cac1e9fa54aaa09a28371d7", GitTreeState:"clean", BuildDate:"2021-06-16T12:59:11Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"darwin/amd64"} Server Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.2", GitCommit:"092fbfbf53427de67cac1e9fa54aaa09a28371d7", GitTreeState:"clean", BuildDate:"2021-06-16T12:53:14Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"linux/amd64"}
amsoedal commented 3 years ago

Hi @bobbydams, thanks for reaching out. We don't currently support private registries (more info here: https://github.com/microsoft/mindaro/issues/147) but we're looking to do so as soon as we can divert some resources to it. Is this a blocker for you?

bobbydams commented 2 years ago

Hello, okay thanks for letting me know. I've started using Skaffold because it works as expected.