microsoft / mindaro

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

Failed to clone ingressRoute #281

Open jmonnier23 opened 2 years ago

jmonnier23 commented 2 years ago

Describe the bug When starting a microservice in isolation, the bridge to kubernetes extension gives the following error "Failed to get routing manager deployments status". This does not occur when starting without isolation. It seems to be due to the duplication of ingressRoute.

To Reproduce

Logs ... 2022-02-10T15:56:21.6489279Z | RoutingManager | TRACE | Cloning ingressRoute : 'https-www' in namespace : 'dev' 2022-02-10T15:56:21.6491452Z | RoutingManager | TRACE | Cloning ingressRoute : 'https-www-ext' in namespace : 'dev' 2022-02-10T15:56:21.6495710Z | RoutingManager | TRACE | Event: RoutingManager-GenerateResources {"eventName":"RoutingManager-GenerateResources","properties":{"result":"Failed"},"metrics":{"durationInMs":24.0}} 2022-02-10T15:56:21.6565026Z | RoutingManager | ERROR | Logging handled exception: System.DivideByZeroException: {"ClassName":"System.DivideByZeroException","Message":"Attempted to divide by zero.","Data":null,"InnerException":null,"HelpURL":null,"StackTraceString":" at Microsoft.BridgeToKubernetes.RoutingManager.RoutingStateEstablisher.GetEntityLabelValue(RoutingStateEstablisherInput input) in /src/routingmanager/RoutingStateEstablisher.cs:line 955\n at Microsoft.BridgeToKubernetes.RoutingManager.RoutingStateEstablisher.GenerateClonedService(KeyValuePair2 input) in /src/routingmanager/RoutingStateEstablisher.cs:line 674\n at Microsoft.BridgeToKubernetes.RoutingManager.RoutingStateEstablisher.<>c__DisplayClass10_0.<RunAsync>b__7() in /src/routingmanager/RoutingStateEstablisher.cs:line 111\n at System.Threading.Tasks.Task.InnerInvoke()\n at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)\n--- End of stack trace from previous location where exception was thrown ---\n at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)\n--- End of stack trace from previous location where exception was thrown ---\n at Microsoft.BridgeToKubernetes.RoutingManager.RoutingStateEstablisher.RunAsync(IDictionary2 inputs, CancellationToken cancellationToken) in /src/routingmanager/RoutingStateEstablisher.cs:line 193\n at Microsoft.BridgeToKubernetes.RoutingManager.RoutingManagerApp.RefreshAsync(CancellationToken cancellationToken) in /src/routingmanager/RoutingManagerApp.cs:line 251\n at Microsoft.BridgeToKubernetes.RoutingManager.RoutingManagerApp.RefreshLoopAsync(CancellationToken cancellationToken) in /src/routingmanager/RoutingManagerApp.cs:line 184","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":null,"HResult":-2147352558,"Source":"Microsoft.BridgeToKubernetes.RoutingManager","WatsonBuckets":null} 2022-02-10T15:56:21.6574102Z | RoutingManager | TRACE | Event: RoutingManager-RefreshLoop {"eventName":"RoutingManager-RefreshLoop","properties":{"result":"Failed"},"metrics":{"durationInMs":59997.0}} 2022-02-10T15:56:23.1949975Z | RoutingManager | TRACE | Pod 'jmonnier-identite-api-75c8d8fd97-rr7g9.dev' was 'Modified' 2022-02-10T15:56:23.2017772Z | RoutingManager | TRACE | Pod 'jmonnier-identite-api-75c8d8fd97-rr7g9.dev' was 'Deleted' 2022-02-10T15:56:24.2045442Z | RoutingManager | TRACE | Refreshing objects... ...

Environment Details Client's version: Microsoft Visual Studio Professional 2019 Version 16.11.8 Operating System: Windows 10

pragyamehta commented 2 years ago

@jmonnier23 I am making a note of this bug. We will update you once we have a fix. Thanks!

jmonnier23 commented 2 years ago

Thanks. Is there a workaround for now ?