Closed Vaccano closed 3 years ago
@Vaccano Thanks for reaching out to us! When you debug with Bridge to Kubernetes, the code you are debugging actually runs locally on your machine. We "bridge" all calls to and from the code running locally to the other microservices running in your cluster. I see you are running this on a Windows 10 machine, which is why it tries to look for the file path locally in the C drive on your machine and does not find it. You can use this link to download existing volumes from your running container to your local machine which should get you past this error. Let me know if you have any questions.
Describe the bug I am making an operation that reads from the file
\sys\fs\cgroup\memory\memory.usage_in_bytes
. (I do this to calculate metrics for health checks.)When I run this via docker compose on my local machine, it works correctly. (Finds the file and reads it.) It also works correctly when I run it in my Kubernetes cluster.
But when I run it in a debug session using Bridge to Kuberentes, I get the following exception:
The fact that it is adding a
C:
to the front is fishy to me. Almost as if it thinks it is running on Windows? (Not sure how that would be possible.)To Reproduce
Create an ASP.Net Core 3.1 Web API application.
In an operation in your controller, add the following code:
string memoryUsageFile = "/sys/fs/cgroup/memory/memory.usage_in_bytes";
var memoryUsage = System.IO.File.ReadAllText(memoryUsageFile);
Console.Writeline(memoryUsage);
Set a break point on the first line.
Debug with Bridge to Kubernetes
Step over the second line.
The exception is thrown.