microsoft / mindaro

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

Need help with VS Code BK Error: Failed to validate the requirements to replicate resources locally: An unexpected error occurred: 'Object reference not set to an instance of an object.' #284

Closed vadiml77 closed 2 years ago

vadiml77 commented 2 years ago

Describe the bug I'm getting the following error with Briudge to Kubernetes - "Error: Failed to validate the requirements to replicate resources locally: An unexpected error occurred: 'Object reference not set to an instance of an object.'" The service is a headless service fronted by an ingress exposing https URL forwarding to service port on 443.

Any help / ideas will be greatly appreciated.

To Reproduce Steps to follow to reproduce this issue.

**Expected behavior** A clear and concise description of what you expected to happen. **Logs** Attach logs from the following directory: For Windows: %TEMP%/Bridge to Kubernetes 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 **bridge-library-2022-02-13-22-46-11-9900.txt** 2022-02-13T22:46:11.3586650Z | Library | TRACE | Pulling kubeconfig...\nOperation context: {"clientRequestId":null,"correlationId":"023b29b5-4732-4889-9a06-44f48cd51f3b1644789939573:d579f9f82003:b7963e74cf42","requestId":null,"userSubscriptionId":null,"startTime":"2022-02-13T22:46:11.2995430Z","userAgent":"VSCode/1.0.120220125","requestHttpMethod":null,"requestUri":null,"version":"1.0.20220125.5","requestHeaders":{},"loggingProperties":{"applicationName":"Library","deviceOperatingSystem":"Darwin 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT 2021; root:xnu-8019.41.5~1/RELEASE_X86_64","framework":".NET Core 3.1.9","macAddressHash":"baf5b546097f991218e39a18e509c4e036edc89a50961cea8984208e4fc979e5","processId":9900,"targetEnvironment":"Production"}} 2022-02-13T22:46:11.6798560Z | Library | TRACE | Event: CloudProvider {"properties":{"clusterFQDNDomain":"Remote IP"},"metrics":null} 2022-02-13T22:46:13.0136440Z | Library | TRACE | Dependency: Kubernetes {"target":"ListPodsInNamespaceAsync","success":true,"duration":null,"properties":{}} 2022-02-13T22:46:13.0321150Z | Library | TRACE | Event: KubernetesManagementClient-RefreshCredentialsAsync {"properties":{"result":"Failed"},"metrics":{"durationInMs":1332.0}}\nOperation context: {"clientRequestId":"548a83e9-8094-40d6-9b65-cc497a2f2f58","correlationId":"023b29b5-4732-4889-9a06-44f48cd51f3b1644789939573:d579f9f82003:da101234c80f","requestId":null,"userSubscriptionId":null,"startTime":"2022-02-13T22:46:11.2995430Z","userAgent":"VSCode/1.0.120220125","requestHttpMethod":null,"requestUri":null,"version":"1.0.20220125.5","requestHeaders":{},"loggingProperties":{"applicationName":"Library","deviceOperatingSystem":"Darwin 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT 2021; root:xnu-8019.41.5~1/RELEASE_X86_64","framework":".NET Core 3.1.9","macAddressHash":"baf5b546097f991218e39a18e509c4e036edc89a50961cea8984208e4fc979e5","processId":9900,"targetEnvironment":"Production"}} **bridge-library-2022-02-13-22-46-14-9902.txt** 2022-02-13T22:46:14.5039340Z | Library | TRACE | Pulling kubeconfig...\nOperation context: {"clientRequestId":null,"correlationId":"023b29b5-4732-4889-9a06-44f48cd51f3b1644789939573:06f33086d1e7:a74fd19b9b09","requestId":null,"userSubscriptionId":null,"startTime":"2022-02-13T22:46:14.4636380Z","userAgent":"VSCode/1.0.120220125","requestHttpMethod":null,"requestUri":null,"version":"1.0.20220125.5","requestHeaders":{},"loggingProperties":{"applicationName":"Library","deviceOperatingSystem":"Darwin 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT 2021; root:xnu-8019.41.5~1/RELEASE_X86_64","framework":".NET Core 3.1.9","macAddressHash":"baf5b546097f991218e39a18e509c4e036edc89a50961cea8984208e4fc979e5","processId":9902,"targetEnvironment":"Production"}} 2022-02-13T22:46:14.7947600Z | Library | TRACE | Event: CloudProvider {"properties":{"clusterFQDNDomain":"Remote IP"},"metrics":null} 2022-02-13T22:46:16.0276080Z | Library | TRACE | Dependency: Kubernetes {"target":"ListPodsInNamespaceAsync","success":true,"duration":null,"properties":{}} 2022-02-13T22:46:16.0486980Z | Library | TRACE | Event: KubernetesManagementClient-RefreshCredentialsAsync {"properties":{"result":"Failed"},"metrics":{"durationInMs":1232.0}}\nOperation context: {"clientRequestId":"6ca33c44-bb58-49cc-802e-d078949caf7c","correlationId":"023b29b5-4732-4889-9a06-44f48cd51f3b1644789939573:06f33086d1e7:5f7f8accac89","requestId":null,"userSubscriptionId":null,"startTime":"2022-02-13T22:46:14.4636380Z","userAgent":"VSCode/1.0.120220125","requestHttpMethod":null,"requestUri":null,"version":"1.0.20220125.5","requestHeaders":{},"loggingProperties":{"applicationName":"Library","deviceOperatingSystem":"Darwin 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT 2021; root:xnu-8019.41.5~1/RELEASE_X86_64","framework":".NET Core 3.1.9","macAddressHash":"baf5b546097f991218e39a18e509c4e036edc89a50961cea8984208e4fc979e5","processId":9902,"targetEnvironment":"Production"}} **bridge-library-2022-02-13-22-46-17-9903.txt** 2022-02-13T22:46:17.4284780Z | Library | TRACE | Pulling kubeconfig...\nOperation context: {"clientRequestId":null,"correlationId":"023b29b5-4732-4889-9a06-44f48cd51f3b1644789939573:d166a6cb4423:d206781db1d8","requestId":null,"userSubscriptionId":null,"startTime":"2022-02-13T22:46:17.3819790Z","userAgent":"VSCode/1.0.120220125","requestHttpMethod":null,"requestUri":null,"version":"1.0.20220125.5","requestHeaders":{},"loggingProperties":{"applicationName":"Library","deviceOperatingSystem":"Darwin 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT 2021; root:xnu-8019.41.5~1/RELEASE_X86_64","framework":".NET Core 3.1.9","macAddressHash":"baf5b546097f991218e39a18e509c4e036edc89a50961cea8984208e4fc979e5","processId":9903,"targetEnvironment":"Production"}} 2022-02-13T22:46:17.7076690Z | Library | TRACE | Event: CloudProvider {"properties":{"clusterFQDNDomain":"Remote IP"},"metrics":null} 2022-02-13T22:46:18.5414150Z | Library | TRACE | Dependency: Kubernetes {"target":"GetV1ServiceAsync","success":true,"duration":null,"properties":{}} 2022-02-13T22:46:18.8197520Z | Library | TRACE | Dependency: Kubernetes {"target":"ListPodsInNamespaceAsync","success":true,"duration":null,"properties":{}} 2022-02-13T22:46:18.8289010Z | Library | TRACE | Event: KubernetesRemoteEnvironmentManager-GetPodsFromService {"properties":{"result":"Succeeded"},"metrics":{"durationInMs":274.0}}\nOperation context: {"clientRequestId":null,"correlationId":"023b29b5-4732-4889-9a06-44f48cd51f3b1644789939573:d166a6cb4423:c691e8217124","requestId":null,"userSubscriptionId":null,"startTime":"2022-02-13T22:46:17.3819790Z","userAgent":"VSCode/1.0.120220125","requestHttpMethod":null,"requestUri":null,"version":"1.0.20220125.5","requestHeaders":{},"loggingProperties":{"applicationName":"Library","deviceOperatingSystem":"Darwin 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT 2021; root:xnu-8019.41.5~1/RELEASE_X86_64","framework":".NET Core 3.1.9","macAddressHash":"baf5b546097f991218e39a18e509c4e036edc89a50961cea8984208e4fc979e5","processId":9903,"targetEnvironment":"Production","isRoutingEnabled":false}} 2022-02-13T22:46:18.8321080Z | Library | TRACE | Resolved 1 from service. 2022-02-13T22:46:18.8333280Z | Library | TRACE | Max number of containers in pod: 1, min number of containers in pod: 1 2022-02-13T22:46:18.8335480Z | Library | TRACE | Chose pod 'ssp-dev-ssp-factor-6fb9687f46-9pd7c' with 1 containers 2022-02-13T22:46:18.8384150Z | Library | TRACE | Pod ssp-dev-ssp-factor-6fb9687f46-9pd7c owned by service ssp-dev-ssp-factor contains 1 containers. 2022-02-13T22:46:18.8388560Z | Library | TRACE | Resolved source container ssp-factor 2022-02-13T22:46:18.8390900Z | Library | TRACE | Resolved 1 containers with exposed ports. 2022-02-13T22:46:18.8392010Z | Library | TRACE | Successfully got container from service and pod. 2022-02-13T22:46:18.8447640Z | Library | TRACE | Owning object type: ReplicaSet 2022-02-13T22:46:18.9619890Z | Library | TRACE | Dependency: Kubernetes {"target":"GetV1ReplicaSetAsync","success":true,"duration":null,"properties":{}} 2022-02-13T22:46:19.0793060Z | Library | TRACE | Dependency: Kubernetes {"target":"GetV1DeploymentAsync","success":true,"duration":null,"properties":{}} 2022-02-13T22:46:19.0795360Z | Library | TRACE | Resolved backing deployment: ssp-dev-ssp-factor 2022-02-13T22:46:19.0905460Z | Library | TRACE | Invoking kubectl GetContainerEnvironment command: exec ssp-dev-ssp-factor-6fb9687f46-9pd7c -c ssp-factor -n dev -- env 2022-02-13T22:46:19.0926470Z | Library | TRACE | Using kubectl found at: '/Users/vadimlander/Library/Application Support/Code/User/globalStorage/mindaro.mindaro/file-downloader-downloads/binaries/kubectl/osx/kubectl' 2022-02-13T22:46:23.1995790Z | Library | TRACE | Invoked kubectl GetContainerEnvironment command: 'exec ssp-dev-ssp-factor-6fb9687f46-9pd7c -c ssp-factor -n dev -- env' exited with 0 in 4102ms 2022-02-13T22:46:23.4396510Z | Library | TRACE | Dependency: Kubernetes {"target":"ListServicesInNamespaceAsync","success":true,"duration":null,"properties":{}} 2022-02-13T22:46:23.4470570Z | Library | TRACE | Detected headless service. Looking for endpoints with same name as service... 2022-02-13T22:46:23.5510450Z | Library | TRACE | Dependency: Kubernetes {"target":"GetEndpointInNamespaceAsync","success":true,"duration":null,"properties":{}} 2022-02-13T22:46:23.5533230Z | Library | TRACE | Detected headless service. Looking for endpoints with same name as service... 2022-02-13T22:46:23.6432110Z | Library | TRACE | Dependency: Kubernetes {"target":"GetEndpointInNamespaceAsync","success":true,"duration":null,"properties":{}} 2022-02-13T22:46:23.6434980Z | Library | TRACE | Detected headless service. Looking for endpoints with same name as service... 2022-02-13T22:46:23.7539140Z | Library | TRACE | Dependency: Kubernetes {"target":"GetEndpointInNamespaceAsync","success":true,"duration":null,"properties":{}} 2022-02-13T22:46:23.7540780Z | Library | TRACE | Detected headless service. Looking for endpoints with same name as service... 2022-02-13T22:46:23.8429860Z | Library | TRACE | Dependency: Kubernetes {"target":"GetEndpointInNamespaceAsync","success":true,"duration":null,"properties":{}} 2022-02-13T22:46:23.8432370Z | Library | TRACE | Detected headless service. Looking for endpoints with same name as service... 2022-02-13T22:46:23.9379030Z | Library | TRACE | Dependency: Kubernetes {"target":"GetEndpointInNamespaceAsync","success":true,"duration":null,"properties":{}} 2022-02-13T22:46:23.9425220Z | Library | TRACE | Event: WorkloadInformationProvider-GetReachableEndpoints {"properties":{"result":"Failed"},"metrics":{"durationInMs":731.0}} 2022-02-13T22:46:23.9430640Z | Library | TRACE | Event: ConnectManagementClient-GetElevationRequests {"properties":{"result":"Failed"},"metrics":{"durationInMs":6187.0}} 2022-02-13T22:46:23.9441720Z | Library | ERROR | Failed to get elevation requests. 2022-02-13T22:46:23.9811810Z | Library | ERROR | Logging handled exception: System.NullReferenceException: {"ClassName":"System.NullReferenceException","Message":"Object reference not set to an instance of an object.","Data":null,"InnerException":null,"HelpURL":null,"StackTraceString":" at Microsoft.BridgeToKubernetes.Library.Connect.WorkloadInformationProvider._CollectServicesToRouteAsync(String workloadNamespace, IEnumerable`1 services, CancellationToken cancellationToken)\n at Microsoft.BridgeToKubernetes.Library.Connect.WorkloadInformationProvider.GetReachableEndpointsAsync(String namespaceName, ILocalProcessConfig localProcessConfig, Boolean includeSameNamespaceServices, CancellationToken cancellationToken)\n at Microsoft.BridgeToKubernetes.Library.ManagementClients.ConnectManagementClient.<>c__DisplayClass18_0.<b__0>d.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at Microsoft.BridgeToKubernetes.Library.ManagementClients.ManagementClientExceptionStrategy.RunWithHandlingAsync[T](Func`1 func, FailureConfig failureConfig)","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":null,"HResult":-2147467261,"Source":"Microsoft.BridgeToKubernetes.Library","WatsonBuckets":null} **bridge-mindarocli-2022-02-13-22-46-10-9900.txt** 2022-02-13T22:46:11.2427330Z | MindaroCli | TRACE | Event: Command.Start {"properties":{"arguments":"refresh-credentials --namespace dev","isRoutingEnabled":"false"},"metrics":null}\nOperation context: {"clientRequestId":null,"correlationId":"023b29b5-4732-4889-9a06-44f48cd51f3b1644789939573:d579f9f82003","requestId":null,"userSubscriptionId":null,"startTime":"2022-02-13T22:46:10.8528600Z","userAgent":"VSCode/1.0.120220125","requestHttpMethod":null,"requestUri":null,"version":"1.0.20220125.5","requestHeaders":{},"loggingProperties":{"applicationName":"MindaroCli","deviceOperatingSystem":"Darwin 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT 2021; root:xnu-8019.41.5~1/RELEASE_X86_64","framework":".NET Core 3.1.9","macAddressHash":"baf5b546097f991218e39a18e509c4e036edc89a50961cea8984208e4fc979e5","processId":9900,"targetEnvironment":"Production","commandId":"d579f9f82003"}} 2022-02-13T22:46:11.3212340Z | MindaroCli | TRACE | Running Microsoft.BridgeToKubernetes.Exe.Commands.Connect.RefreshCredentialsCommand... 2022-02-13T22:46:13.7341760Z | MindaroCli | TRACE | Event: Command.End {"properties":{"arguments":"refresh-credentials --namespace dev","result":"Succeeded"},"metrics":{"duration":2557.0}} **bridge-mindarocli-2022-02-13-22-46-14-9902.txt** 2022-02-13T22:46:14.4217010Z | MindaroCli | TRACE | Event: Command.Start {"properties":{"arguments":"refresh-credentials --namespace dev","isRoutingEnabled":"false"},"metrics":null}\nOperation context: {"clientRequestId":null,"correlationId":"023b29b5-4732-4889-9a06-44f48cd51f3b1644789939573:06f33086d1e7","requestId":null,"userSubscriptionId":null,"startTime":"2022-02-13T22:46:14.1552360Z","userAgent":"VSCode/1.0.120220125","requestHttpMethod":null,"requestUri":null,"version":"1.0.20220125.5","requestHeaders":{},"loggingProperties":{"applicationName":"MindaroCli","deviceOperatingSystem":"Darwin 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT 2021; root:xnu-8019.41.5~1/RELEASE_X86_64","framework":".NET Core 3.1.9","macAddressHash":"baf5b546097f991218e39a18e509c4e036edc89a50961cea8984208e4fc979e5","processId":9902,"targetEnvironment":"Production","commandId":"06f33086d1e7"}} 2022-02-13T22:46:14.4833720Z | MindaroCli | TRACE | Running Microsoft.BridgeToKubernetes.Exe.Commands.Connect.RefreshCredentialsCommand... 2022-02-13T22:46:16.6036150Z | MindaroCli | TRACE | Event: Command.End {"properties":{"arguments":"refresh-credentials --namespace dev","result":"Succeeded"},"metrics":{"duration":2234.0}} **bridge-mindarocli-2022-02-13-22-46-17-9903.txt** [/var/folders/sf/r1bt9c8d0bn_bchd9d2y8lx40000gn/T/Bridge To Kubernetes] $ cat bridge-mindarocli-2022-02-13-22-46-14-9902.txt 2022-02-13T22:46:14.4217010Z | MindaroCli | TRACE | Event: Command.Start {"properties":{"arguments":"refresh-credentials --namespace dev","isRoutingEnabled":"false"},"metrics":null}\nOperation context: {"clientRequestId":null,"correlationId":"023b29b5-4732-4889-9a06-44f48cd51f3b1644789939573:06f33086d1e7","requestId":null,"userSubscriptionId":null,"startTime":"2022-02-13T22:46:14.1552360Z","userAgent":"VSCode/1.0.120220125","requestHttpMethod":null,"requestUri":null,"version":"1.0.20220125.5","requestHeaders":{},"loggingProperties":{"applicationName":"MindaroCli","deviceOperatingSystem":"Darwin 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT 2021; root:xnu-8019.41.5~1/RELEASE_X86_64","framework":".NET Core 3.1.9","macAddressHash":"baf5b546097f991218e39a18e509c4e036edc89a50961cea8984208e4fc979e5","processId":9902,"targetEnvironment":"Production","commandId":"06f33086d1e7"}} 2022-02-13T22:46:14.4833720Z | MindaroCli | TRACE | Running Microsoft.BridgeToKubernetes.Exe.Commands.Connect.RefreshCredentialsCommand... 2022-02-13T22:46:16.6036150Z | MindaroCli | TRACE | Event: Command.End {"properties":{"arguments":"refresh-credentials --namespace dev","result":"Succeeded"},"metrics":{"duration":2234.0}} [/var/folders/sf/r1bt9c8d0bn_bchd9d2y8lx40000gn/T/Bridge To Kubernetes] $ cat bridge-mindarocli-2022-02-13-22-46-17-9903.txt 2022-02-13T22:46:17.3398160Z | MindaroCli | TRACE | Event: Command.Start {"properties":{"arguments":"prep-connect --output json --service ssp-dev-ssp-factor --namespace dev","isRoutingEnabled":"false"},"metrics":null}\nOperation context: {"clientRequestId":null,"correlationId":"023b29b5-4732-4889-9a06-44f48cd51f3b1644789939573:d166a6cb4423","requestId":null,"userSubscriptionId":null,"startTime":"2022-02-13T22:46:17.0895670Z","userAgent":"VSCode/1.0.120220125","requestHttpMethod":null,"requestUri":null,"version":"1.0.20220125.5","requestHeaders":{},"loggingProperties":{"applicationName":"MindaroCli","deviceOperatingSystem":"Darwin 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT 2021; root:xnu-8019.41.5~1/RELEASE_X86_64","framework":".NET Core 3.1.9","macAddressHash":"baf5b546097f991218e39a18e509c4e036edc89a50961cea8984208e4fc979e5","processId":9903,"targetEnvironment":"Production","commandId":"d166a6cb4423"}} 2022-02-13T22:46:17.4058220Z | MindaroCli | TRACE | Running Microsoft.BridgeToKubernetes.Exe.Commands.Connect.PrepConnectCommand...\nOperation context: {"clientRequestId":null,"correlationId":"023b29b5-4732-4889-9a06-44f48cd51f3b1644789939573:d166a6cb4423","requestId":null,"userSubscriptionId":null,"startTime":"2022-02-13T22:46:17.0895670Z","userAgent":"VSCode/1.0.120220125","requestHttpMethod":null,"requestUri":null,"version":"1.0.20220125.5","requestHeaders":{},"loggingProperties":{"applicationName":"MindaroCli","deviceOperatingSystem":"Darwin 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:23 PDT 2021; root:xnu-8019.41.5~1/RELEASE_X86_64","framework":".NET Core 3.1.9","macAddressHash":"baf5b546097f991218e39a18e509c4e036edc89a50961cea8984208e4fc979e5","processId":9903,"targetEnvironment":"Production","commandId":"d166a6cb4423","targetServiceName":"ssp-dev-ssp-factor"}} 2022-02-13T22:46:23.9933950Z | MindaroCli | ERROR | Dependency: Prep Connect {"target":null,"success":false,"duration":null,"properties":{"requestId":"null","clientRequestId":"null","correlationRequestId":"null"}} 2022-02-13T22:46:24.9297360Z | MindaroCli | ERROR | An unexpected error occurred: 'Object reference not set to an instance of an object.'\n 2022-02-13T22:46:24.9304890Z | MindaroCli | ERROR | To see our active issues or file a bug report, please visit https://aka.ms/bridge-to-k8s-report.\n 2022-02-13T22:46:24.9308040Z | MindaroCli | ERROR | For diagnostic information, see logs at '/var/folders/sf/r1bt9c8d0bn_bchd9d2y8lx40000gn/T/Bridge To Kubernetes'.\n 2022-02-13T22:46:24.9347160Z | MindaroCli | ERROR | Logging handled exception: System.NullReferenceException: {"ClassName":"System.NullReferenceException","Message":"Object reference not set to an instance of an object.","Data":null,"InnerException":null,"HelpURL":null,"StackTraceString":" at Microsoft.BridgeToKubernetes.Library.Connect.WorkloadInformationProvider._CollectServicesToRouteAsync(String workloadNamespace, IEnumerable`1 services, CancellationToken cancellationToken)\n at Microsoft.BridgeToKubernetes.Library.Connect.WorkloadInformationProvider.GetReachableEndpointsAsync(String namespaceName, ILocalProcessConfig localProcessConfig, Boolean includeSameNamespaceServices, CancellationToken cancellationToken)\n at Microsoft.BridgeToKubernetes.Library.ManagementClients.ConnectManagementClient.<>c__DisplayClass18_0.<b__0>d.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at Microsoft.BridgeToKubernetes.Library.ManagementClients.ManagementClientExceptionStrategy.RunWithHandlingAsync[T](Func`1 func, FailureConfig failureConfig)\n at Microsoft.BridgeToKubernetes.Library.ManagementClients.ConnectManagementClient.GetElevationRequestsAsync(CancellationToken cancellationToken)\n at Microsoft.BridgeToKubernetes.Exe.Commands.Connect.PrepConnectCommand.ExecuteAsync()\n at Microsoft.BridgeToKubernetes.Exe.CliApp.RunCommandAsync(String[] args, CancellationToken cancellationToken)\n at Microsoft.BridgeToKubernetes.Exe.CliApp.ExecuteAsync(String[] args, CancellationToken cancellationToken)","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":null,"HResult":-2147467261,"Source":"Microsoft.BridgeToKubernetes.Library","WatsonBuckets":null} 2022-02-13T22:46:24.9359970Z | MindaroCli | TRACE | Event: Command.End {"properties":{"arguments":"prep-connect --output json --service ssp-dev-ssp-factor --namespace dev","result":"Failed","failureReason":"Object reference not set to an instance of an object."},"metrics":{"duration":7649.0}} **Environment Details** Operating System: MacOS 12.01 Client used (VS Code/Visual Studio): VS Code Version: 1.64.2 Commit: f80445acd5a3dadef24aa209168452a3d97cc326 Date: 2022-02-09T22:00:58.347Z (4 days ago) Electron: 13.5.2 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.39-electron.0 OS: Darwin x64 21.1.0 **Additional context** > Executing task: bridge-to-kubernetes.resource < Redirecting Kubernetes service ssp-dev-ssp-factor to your machine... Target cluster: kubernetes Current cluster: kubernetes Target namespace: dev Current namespace: dev Target service name: ssp-dev-ssp-factor Target service ports: 443 Using kubernetes service environment variables: false Retrieving the current context and credentials... Validating the credentials to access the cluster... Validating the requirements to replicate resources locally... Error: Failed to validate the requirements to replicate resources locally: An unexpected error occurred: 'Object reference not set to an instance of an object.' To see our active issues or file a bug report, please visit https://aka.ms/bridge-to-k8s-report. For diagnostic information, see logs at '/var/folders/sf/r1bt9c8d0bn_bchd9d2y8lx40000gn/T/Bridge To Kubernetes'. The terminal process terminated with exit code: 1. Add any other outputs from the clients or context you would like to share. **launch.json** { "type": "java", "name": "Launch FactorsBootApplication with Kubernetes", "request": "launch", "mainClass": "com.broadcom.layer7authentication.FactorsBootApplication", "projectName": "factorssvc", "preLaunchTask": "bridge-to-kubernetes.resource", "env": { "GRPC_DNS_RESOLVER": "native" }
amsoedal commented 2 years ago

Hi @vadiml77, could you please send us the manifest for the headless service? You can send it to BridgeToKubernetes@microsoft.com, or attach it here. Thanks!

vadiml77 commented 2 years ago

Hi, sorry, the service is being load balanced. Here is the yaml for the service. I've XXX out few fields.

apiVersion: v1 kind: Pod metadata: creationTimestamp: "2022-02-13T22:03:27Z" generateName: ssp-dev-ssp-factor-6fb9687f46- labels: app: ssp-factor app.kubernetes.io/component: webservice app.kubernetes.io/instance: ssp-dev app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: ssp-factor app.kubernetes.io/part-of: ssp app.kubernetes.io/version: 1.0.2666 helm.sh/chart: ssp-1.0.2666 pod-template-hash: 6fb9687f46 managedFields:

amsoedal commented 2 years ago

Hi @vadiml77, sorry for the slow reply. I've produced a new CLI build that contains some extra logging as well as a tiny code change. Can you please follow the instructions here and let us know the results? https://github.com/microsoft/mindaro/issues/288#issuecomment-1055588516

vadiml77 commented 2 years ago

OK, was able to get further with the latest plugin (v1.0.120220125) in OSX VSCode

The issue with this NPE appears to be presence of endpoints having no target IP Address. Not sure if that was limited to a specific namespace or all namespaces. Do "kubectl get endpoints" and make sure there ate no endpoints without a target ip address

Once we removed services that were also creating an endpoint without a target IP address, I was able to get past this issue. It looks like Bridge, while reading endpoint data, should also take care of the possiblity there will be no target data

amsoedal commented 2 years ago

Thanks so much for trying again and letting us know, and glad you found a workaround. I'll document this bug on our side