dotnet/diagnostics

Access Denied (5)

mjanulaitis opened this issue · 9 comments

I am trying to generate a dump file for a .Net 7 Windows Service running with a service account. When I run a command prompt as an administrator then run the dump command, I get the following error:

dotnet-dump collect -p [PROCESS_ID]
Writing full to c:\Temp\dump_[DATE]_[TIME].dmp
Invalid process id [PROCESS_ID] - Access is denied. (5)

I have verified the process ID is running.
I expect the command to successfully generate the dump file.

Configuration

The Windows Service is running as with service account.
Microsoft Windows [Version 10.0.14393]
.Net SDK v7.0.405
x64

If your service or app is running as superuser, then you need to run dotnet-dump collect as administrator.

@mikem8361 Yes, notice in my comment I say "When I run a command prompt as an administrator"

Sorry I missed that.

I think the problem might be that running as a service isn't accessible from a administrator command prompt. They are different levels of privilege on Windows.

@hoyosjs do you know for sure?

Our pipes should be accessible by the LocalSystem account, administrators, and the creator owner (running user). That being said I'm surprised that the administrator account wasn't able to communicate properly. I'd have to check.

Our diag pipes are not used on Windows by dotnet-dump. It calls MiniDumpWriteDump directly.