Misleading error message for dotnet-* tools when working cross container
- Dominant language
- C++
- Stars
- 1.3k
- Forks
- 404
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 38
Description
I’ve got a sample repo [here](https://github.com/mjrousos/ContainerProfiling) that is similar. The repro steps are:
1. Start the [testapp](https://github.com/mjrousos/ContainerProfiling/blob/master/TestApp/Dockerfile) container (which is on Docker hub at mjrousos/testapp:latest):
docker run --rm -p 8080:80 -d mjrousos/testapp:latest
2. Start the [sidecar](https://github.com/mjrousos/ContainerProfiling/blob/master/Sidecar/Dockerfile) (in interactive mode) sharing the testapp container’s process namespace so that diagnostics tools in the sidecar can be used on processes in the testapp container.
docker run -it --pid=container:2d5 mjrousos/sidecar:latest
Try to use dotnet-counters from the sidecar. The expectation is that it should work, but instead we get an error.
~/.dotnet/tools/dotnet-counters monitor -p 1
The error is:
```
counter_list is unspecified. Monitoring all counters by default.
Press p to pause, r to resume, q to quit.
Status: Waiting for initial payload...
Failed to start the counter session: Microsoft.Diagnostics.NETCore.Client.ServerNotAvailableException: Process 1 not running compatible .NET runtime.
at Microsoft.Diagnostics.NETCore.Client.PidIpcEndpoint.GetDefaultAddress() in /_/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs:line 165
at Microsoft.Diagnostics.NETCore.Client.PidIpcEndpoint.Connect(TimeSpan timeout) in /_/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcTransport.cs:line 98
at Microsoft.Diagnostics.NETCore.Client.IpcClient.SendMessage(IpcEndpoint endpoint, IpcMessage message, IpcMessage& response) in /_/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsIpc/IpcClient.cs:line 41
at Microsoft.Diagnostics.NETCore.Client.EventPipeSession..ctor(IpcEndpoint endpoint, IEnumerable`1 providers, Boolean requestRundown, Int32 circularBufferMB) in /_/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsClient/EventPipeSession.cs:line 30
at Microsoft.Diagnostics.NETCore.Client.DiagnosticsClient.StartEventPipeSession(IEnumerable`1 providers, Boolean requestRundown, Int32 circularBufferMB) in /_/src/Microsoft.Diagnostics.NETCore.Client/DiagnosticsClient/DiagnosticsClient.cs:line 57
at Microsoft.Diagnostics.Tools.Counters.CounterMonitor.<>c__DisplayClass17_0.b__1() in /_/src/Tools/dotnet-counters/CounterMonitor.cs:line 272
```
From the looks of it, the actual issue is that the two containers don't share a mnt namespace so even though testapp created the unix domain socket in \tmp, the profiling container can't find it. The Linux /proc filesystem has some information about namespaces that we could probably use to identify when we are in this condition and give a better error message.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.