You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dotnet-trace prints "Unable to examine process." (when run in Kudu command line on App Service) #2781
Installing dotnet-trace and running D:\path\to\dotnet-trace.exe collect -p <pid> --duration 00:00:30 prints Unable to examine process. when run in Kudu (Windows App Service).
Not sure if it qualifies as a bug, maybe it's a new restriction in App Service, but it's a step-by-step reproduction of what was done in the 1 month old presentation "Large Object Heap Churn in .NET" from .NET Conf 2021, so I suppose it was expected to work quite recently.
changed the title [-]dotnet-trace does not work in Kudu (App Service)[/-][+]dotnet-trace prints "Unable to examine process." (when run in Kudu command line on App Service)[/+]on Dec 13, 2021
I've confirmed that others are able to run dotnet-trace in Kudu, so this doesn't seem to be a general restriction on App Service. I've edited the title of the issue. The process I'm trying to attach to is running .NET 6. Any thoughts on what may be causing this?
@larspars I have followed the video linked above and have been able to run dotnet-trace collect -p 2774 --duration 00:00:30 successfully. Did you try running the following command to add dotnet-trace to the path? set path=%path%\UserProfile.dotnet\tools
@mikelle-rogers Yes. I tried again today, installing with dotnet tool install -g dotnet-trace, setting the path, running dotnet-trace collect -p <...> --duration 00:00:30, and it still prints Unable to examine process..
I've seen others saying they're able to run this via Kudu without problem, so I figure something must be different with my environment. As far as I know, my App Service use is bog-standard, so I don't know what could be making a difference here.
@larspars Thank you for your response. Would you please send me the output of running dotnet --info in Kudu?
In addition, are you using Kudu for Linux or Windows? The more information you can send about your environment, the better.
@mikelle-rogers Thanks for the response, this pointed me in a direction that allowed me to solve the problem. The output dotnet --info was the following:
.NET SDK (reflecting any global.json):
Version: 6.0.102
Commit: 02d5242ed7
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x86
Base Path: D:\Program Files (x86)\dotnet\sdk\6.0.102\
...
I noticed the RID: win10-x86, and the path Program Files (x86). However, the app is x64.
So the dotnet.exe I was running was from Program Files (x86), and there's another one in Program Files which outputs RID: win10-x64. I had to uninstall the tool using the x86 dotnet.exe version, and reinstall the tool with x64 version. Then running dotnet-trace on the process successfully produced a trace.
Once you learn that the environment has these two dotnet.exe versions installed, the problem is obvious. But on App Service, these things are provided by the service, so you don't have a very active relationship to these details of the environment.
The problem is solved for me. I see that a lot of time could be saved with a if there was an error message that explained the problem, i.e. something like "Can't trace a 64-bit process with a 32-bit dotnet-trace". I don't know how easy that is to add, but it's maybe something to consider.
I'll close the issue, since the problem is solved for me. Thanks a lot for your help.
@larspars I will look into what can be done to alter the unhelpful "unable to examine process" to include more information. Thank you for sharing how you fixed the issue and for providing valuable feedback. We appreciate it!
Activity
[-]dotnet-trace does not work in Kudu (App Service)[/-][+]dotnet-trace prints "Unable to examine process." (when run in Kudu command line on App Service)[/+]larspars commentedon Dec 13, 2021
I've confirmed that others are able to run dotnet-trace in Kudu, so this doesn't seem to be a general restriction on App Service. I've edited the title of the issue. The process I'm trying to attach to is running .NET 6. Any thoughts on what may be causing this?
tommcdon commentedon Dec 29, 2021
@mikelle-rogers
mikelle-rogers commentedon Mar 8, 2022
@larspars I have followed the video linked above and have been able to run dotnet-trace collect -p 2774 --duration 00:00:30 successfully. Did you try running the following command to add dotnet-trace to the path? set path=%path%\UserProfile.dotnet\tools
larspars commentedon Mar 11, 2022
@mikelle-rogers Yes. I tried again today, installing with
dotnet tool install -g dotnet-trace, setting the path, runningdotnet-trace collect -p <...> --duration 00:00:30, and it still printsUnable to examine process..I've seen others saying they're able to run this via Kudu without problem, so I figure something must be different with my environment. As far as I know, my App Service use is bog-standard, so I don't know what could be making a difference here.
mikelle-rogers commentedon Mar 22, 2022
@larspars Thank you for your response. Would you please send me the output of running
dotnet --infoin Kudu?In addition, are you using Kudu for Linux or Windows? The more information you can send about your environment, the better.
larspars commentedon Mar 24, 2022
@mikelle-rogers Thanks for the response, this pointed me in a direction that allowed me to solve the problem. The output
dotnet --infowas the following:I noticed the RID: win10-x86, and the path Program Files (x86). However, the app is x64.
So the dotnet.exe I was running was from
Program Files (x86), and there's another one inProgram Fileswhich outputs RID: win10-x64. I had to uninstall the tool using the x86 dotnet.exe version, and reinstall the tool with x64 version. Then running dotnet-trace on the process successfully produced a trace.Once you learn that the environment has these two dotnet.exe versions installed, the problem is obvious. But on App Service, these things are provided by the service, so you don't have a very active relationship to these details of the environment.
The problem is solved for me. I see that a lot of time could be saved with a if there was an error message that explained the problem, i.e. something like "Can't trace a 64-bit process with a 32-bit dotnet-trace". I don't know how easy that is to add, but it's maybe something to consider.
I'll close the issue, since the problem is solved for me. Thanks a lot for your help.
mikelle-rogers commentedon Mar 25, 2022
@larspars I will look into what can be done to alter the unhelpful "unable to examine process" to include more information. Thank you for sharing how you fixed the issue and for providing valuable feedback. We appreciate it!
mikelle-rogers commentedon Apr 6, 2022
@larspars I have reproduced the "unable to examine process." message. I am currently looking into where that is printed.