Open Scaramanga77 opened 2 years ago
I have docker desktop running and a build deployed in debug configuration. I launch the bridge and the ui starts as expected but no debugging symbols are hit.
HI @Scaramanga77, how are you running Bridge (VS/VS Code?), and how are you running your application (launch configuration in VS Code, through the command line)?
Hi, I am running it in Visual Studio 2019. I have a kubernetes deployment via docker desktop on Windows running in Linux container mode. The code in question is .NET 5. The app starts via the debugger but all breakpoints are telling me no symbols attached. The build is in Debug mode.
This is completely broken I have a simple api that I am trying to put breakpoints on a call to some middleware. No symbols are loaded and debugging does not work at all:
@Scaramanga77, what happens if you debug without Bridge? Do you see your breakpoints getting hit in that case? Also could you share how your Bridge profile is set up?
@amsoedal If I debug without bridge for example using docker run option in Visual Studio it is working fine. The Bridge profile is just the out of the box configuration that gets applied through Visual Studio. In my case:
Is there something else I need to configure?
My launchsettings.json bridge settings are:
My kubernetes setup is as follows:
I do not have any launch.json defined I just run as above straight out of the box. Am I missing a step?
Any update on this? It seems broken:
2021-11-24T16:59:19.4932791Z | Library | TRACE | Pulling kubeconfig...\nOperation context: 2.FindEntry(TKey key)\r\n at System.Collections.Generic.Dictionary
2.ContainsKey(TKey key)\r\n at Microsoft.BridgeToKubernetes.Library.Connect.KubernetesRemoteEnvironmentManager.<>cDisplayClass31_0.<_CollectServicesToRouteAsync>b3(V1Endpoints e)\r\n at System.Collections.Generic.IEnumerableExtensions.ExecuteForEach[T](IEnumerable1 items, Action
1 action, CancellationToken cancellationToken)\r\n at Microsoft.BridgeToKubernetes.Library.Connect.KubernetesRemoteEnvironmentManager.<>cDisplayClass31_0.<<_CollectServicesToRouteAsync>b0>d.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at Microsoft.BridgeToKubernetes.Library.Connect.KubernetesRemoteEnvironmentManager.GetReachableServicesAsync(String namespaceName, ILocalProcessConfig localProcessConfig, IProgress1 progress, CancellationToken cancellationToken)\r\n at Microsoft.BridgeToKubernetes.Library.ManagementClients.ConnectManagementClient.<>c__DisplayClass13_0.<<GetElevationRequestsAsync>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)","RemoteStackTraceString":null,"RemoteStackIndex":0,"ExceptionMethod":null,"HResult":-2147467261,"Source":"System.Private.CoreLib","WatsonBuckets":null}
Hi @Scaramanga77, sorry for the delayed response. It looks like you're debugging headless services -- I recommend using our VSCode extension because our VS extension is lagging behind in terms of the latest fixes. Can you give VS Code a go and see if it works for you? Similar issues here: #209, #237
Hi. I have tried the same with VS code but I am getting the bridge connect ok but am still not getting any debugging symbols attached. Here is my config:
{ "configurations": [ { "name": ".NET Core Launch (web) with Kubernetes", "type": "coreclr", "request": "launch", "preLaunchTask": "bridge-to-kubernetes.compound", "program": "${workspaceFolder}/src/api/bin/Debug/net5.0/Sigma.Catalog.Api.dll", "args": [], "cwd": "${workspaceFolder}/src/api", "stopAtEntry": false, "env": { "ASPNETCORE_ENVIRONMENT": "Development", "ASPNETCORE_URLS": "http://+:8080" }, "sourceFileMap": { "/app": "${workspaceFolder}/src/api" } }, { "name": ".NET Core Launch (web)", "type": "coreclr", "request": "launch", "preLaunchTask": "build", "program": "${workspaceFolder}/src/api/bin/Debug/net5.0/Sigma.Catalog.Api.dll", "args": [], "cwd": "${workspaceFolder}/src/api", "stopAtEntry": false, "serverReadyAction": { "action": "openExternally", "pattern": "\bNow listening on:\s+(https?://\S+)" }, "env": { "ASPNETCORE_ENVIRONMENT": "Development" }, "sourceFileMap": { "/app": "${workspaceFolder}/src/api" } } ] }
with the below structure:
@Scaramanga77 I tried to reproduce the issue by debugging with VS Code and targeting a pod running in K8s on Docker desktop, but all my breakpoints got hit. I'm trying to understand what might be different about your setup where this reproduces -- apologies for asking again, but when you said that you can debug with VS docker run sometimes, do you ever run the app un-containerized? What happens then? I'll also ask my colleagues in parallel to see if anyone might have insight on this.
Hi,
Would it be possible to arrange a chat over google meets and I can demo the exact issue?
@Scaramanga77 yes, that would be possible. Can you send a mail to BridgeToKubernetes@microsoft.com and we can coordinate?
Hi, I have now got partial success with the update that you sent me but only if I run via docker option in Visual Studio. If I attempt to run the project by name which spins up kestrel no breakpoint symbols are loaded. If my service calls other services I am then unable to connect to them. I get a 404 even if I add the services into the KubernetesLocalProcessConfig.yaml.
Is there any update to this?
If you do not have embedded debugging symbols in the DLL (which is the default option, as far as I know), then Visual Studio has to find the symbol paths as they are not integrated with the DLL.
There are two solutions to that:
Another cause could be, that you enabled Only my code
(enabled by default), if Visual Studio does not classify the assembly as "your own code" then it skips it to improve the debug experience (loading tons of debug symbols could take hours) (This would be very uncommon, but could also be relevant).
If nothing of the above working, Visual Studio should at least provide an informational message why the debug symbol load failed for a module in the module window (mentioned in the second possible solution).
For example:
(Transcription: PDB file could not be found, or could not be opened.)
Hope I could provide any help.
I have tried this and it does not work. I have fallen back to vscode and I have the same problem:
Management.Worker.csproj
tasks.json
launch.json
I then configure bridge and no breakpoints are hit:
Note: that there is no message in the loader of attempting to even search for .pdb files.
However if I disconnect from the cluster and run the application breakpoints are hit perfectly fine:
Note: in this run the attempt to load the symbols is happening fine and my breakpoints are active.
The debugger console output shows the following:
symbols to be resolved later
symbols not loaded
You can see here for some reason it believes that the code has changed and hence no symbols. However, it has only rebuilt due to the sequencing of the task configuration created by bridge.
is there any updates in regards to this issue? i have the same issue but using visual studio 2022. i have followed the guide and its still not working.
doesn't matter where I put them it just doesn't stop the application for debugging. ive also checked JustMyCode to see if it will make a difference but it doesn't.
I have having the exact same issue as @joshy1990 connecting to kubernetes in an AKS cluster has anyone managed to resolve this? If I could get this working I could move my whole team to developing with this method making life so much easier!