Skip to content

dotnet-trace prints "Unable to examine process." (when run in Kudu command line on App Service) #2781

Closed

Description

@larspars

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.

Activity

  1. 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
  2. larspars commented on Dec 13, 2021

    @larspars
    Author

    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?

  3. added this to the .NET 7.0 milestone on Dec 29, 2021
  4. tommcdon commented on Dec 29, 2021

    @tommcdon
    Member
  5. mikelle-rogers commented on Mar 8, 2022

    @mikelle-rogers
    Member

    @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

  6. larspars commented on Mar 11, 2022

    @larspars
    Author

    @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.

  7. mikelle-rogers commented on Mar 22, 2022

    @mikelle-rogers
    Member

    @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.

  8. larspars commented on Mar 24, 2022

    @larspars
    Author

    @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.

  9. mikelle-rogers commented on Mar 25, 2022

    @mikelle-rogers
    Member

    @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!

  10. mikelle-rogers commented on Apr 6, 2022

    @mikelle-rogers
    Member

    @larspars I have reproduced the "unable to examine process." message. I am currently looking into where that is printed.

  11. ghost locked as resolved and limited conversation to collaborators on Jun 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions