flam3
flam3

Reputation: 2027

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

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

Upvotes: 9

Views: 3766

Answers (3)

Patrik Mihalčin
Patrik Mihalčin

Reputation: 4031

I hit the same issue when I wanted to run dotnet-dump inside docker containers running AWS ECS.

I had to enable SYS_PTRACE linux parameter capability.

This is what I had to do in Terraform where container definition is defined:

linux_parameters = {
    capabilities = {
        add = ["SYS_PTRACE"],
        drop = null
    },
    devices            = null,
    initProcessEnabled = null,
    maxSwap            = null,
    sharedMemorySize   = null,
    swappiness         = null,
    tmpfs              = null
}

Upvotes: 0

Vas Mil
Vas Mil

Reputation: 695

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

Upvotes: 2

koepalex
koepalex

Reputation: 215

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

Upvotes: 1

Related Questions