dotnet-dump fails with "Writing dump failed (HRESULT: 0x80004005)" in Ubuntu

4

Despite I run dotnet-dump under root, and process is run under root (see service description below), it seems I lack some permissions. I tried also other directories in home, in var and in tmp: all the same message.

root@DSK06511:/home/monouser# dotnet-dump collect -p 10131 --diag -o /var/tmp/MyNodeDump/
Writing full to /var/tmp/MyNodeDump/
Writing dump failed (HRESULT: 0x80004005)

root@DSK06511:/tmp# dotnet-dump collect -p 10131 --diag -o /home/monorepo/tmp/
Writing full to /home/monouser/tmp/
Writing dump failed (HRESULT: 0x80004005)

Service file:

root@DSK06511:/home/monouser# cat  /etc/systemd/system/MyNode.service
[Unit]
Description=MyNode

[Service]
Type=simple

User=root
Group=root

ExecStart=/home/monouser/.octopus/Applications/OctopusServer/Production/MyNode.Linux/4.0.1.907/MyNode --console

[Install]
WantedBy=multi-user.target

Diagnostics info: dotnet-dump --version 3.1.120604+97218bff6a14e60360862529b09b687789cc1279

dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.1.201
 Commit:    b1768b4ae7

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  18.04
 OS Platform: Linux
 RID:         ubuntu.18.04-x64
 Base Path:   /usr/share/dotnet/sdk/3.1.201/

Host (useful for support):
  Version: 3.1.3
  Commit:  4a9f85e9f8

.NET Core SDKs installed:
  3.1.201 [/usr/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.App 3.1.3 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.3 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

OS version NAME="Ubuntu" VERSION="18.04.3 LTS (Bionic Beaver)"

They had similar issue here but they solved it with --output to the directory in /tmp, which didn't help

.net
linux
ubuntu
.net-core
asked on Stack Overflow Apr 24, 2020 by flam3 • edited Apr 24, 2020 by flam3

2 Answers

1

Please check in the directory of your service, the permissions of createdump, it requires execution rights to work, if it looks like this:

ls -l | grep 'lib\|create'
-rw-rw-rw- 1 root root  109656 May 20 00:40 createdump

You have to grant the execution rights:

sudo chmod u+x createdump
answered on Stack Overflow Aug 31, 2020 by koepalex
1

In addition, I will describe the case for docker.

If you are using docker, launching a container with privileges can help:

docker run --cap-add=SYS_PTRACE -it ubuntu:18.04 /bin/bash

https://github.com/dotnet/diagnostics/blob/master/documentation/FAQ.md#frequently-asked-questions

answered on Stack Overflow Dec 30, 2020 by Vasya Milovidov

User contributions licensed under CC BY-SA 3.0