Skip to content

dotnet-trace won't run in Kudu console #637

Closed

Description

@pharring

Repro:

  1. Create an Azure App Service for Windows
  2. (Optional) Deploy an ASP.NET Core 3.0 app to the App Service
  3. Open the Kudu site for your App Service in the Browser (Find "Advanced Tools" from the App in the Azure Portal)
  4. Go to the Process Explorer and find the PID of your app (it's probably the w3wp.exe process)
  5. Click on Debug Console and select Cmd
  6. At the cmd prompt, type:
  7. dotnet tool install --global dotnet-trace
  8. There's a warning that the tools directory is not on the PATH. So run
    set PATH=%PATH%;%USERPROFILE%\.dotnet\tools
  9. dotnet-trace collect --profile gc-verbose -p 4124 -o gc-verbose.netperf (substituting the PID from the earlier step for 4124)

Result:

[ERROR] System.IO.IOException: The handle is invalid
   at System.ConsolePal.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded)
   at System.ConsolePal.Clear()
   at Microsoft.Diagnostics.Tools.Trace.CollectCommandHandler.Collect(CancellationTo
ken ct, IConsole console, Int32 processId, FileInfo output, UInt32 buffersize, String providers, String profile, TraceFileFormat format, TimeSpan duration) in /_/src/Tools/dotnet-trace/CommandLine/Commands/CollectCommand.cs:line 41

Expect:
Should be able to do a collection on Antares from the Kudu window.

Activity

  1. pharring commented on Nov 22, 2019

    @pharring
    ContributorAuthor

    Interestingly:
    dotnet-trace list-profiles works.
    dotnet-trace -h fails.

    It seems that any code that tries to manipulate the console directly won't work in Kudu (because there isn't really a console window; just redirected stdin/stdout/stderr)

  2. added
    bug
    on Nov 22, 2019
  3. added this to the 5.0 milestone on Nov 22, 2019
  4. pharring commented on Nov 24, 2019

    @pharring
    ContributorAuthor

    See also dotnet/command-line-api#611
    for fixing the "-h" option.

  5. pharring commented on Nov 25, 2019

    @pharring
    ContributorAuthor

    #645 is the same issue.

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

Assignees

No one assigned

    Labels

    bugdotnet-trace

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions