dotnet-dump在Ubuntu上出现“写入转储失败(HRESULT:0x80004005)”错误。

8
尽管我以 root 运行 dotnet-dump,进程也在 root 下运行(请参见下面的服务描述),但似乎我缺少某些权限。我还尝试过 home、var 和 tmp 中的其他目录:都显示相同的消息。
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)

服务文件:

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

诊断信息: 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]

操作系统版本:NAME="Ubuntu" VERSION="18.04.3 LTS (Bionic Beaver)"

他们在这里遇到了类似的问题,但是使用 --output 参数输出到 /tmp 目录下并不能解决问题。

3个回答

2

这个建议对我有用。如果您正在AWS ECS中运行容器,则需要将“linuxParameters”->“capabilities”添加到任务定义中。-https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_linuxparameters - KevM

1
请在您的服务目录中检查 createdump 的权限,它需要执行权限才能工作。如果看起来像这样:
ls -l | grep 'lib\|create'
-rw-rw-rw- 1 root root  109656 May 20 00:40 createdump

您需要授予执行权限:

您需要授予执行权限:

sudo chmod u+x createdump

0

当我想在运行AWS ECS的Docker容器中运行dotnet-dump时,我遇到了同样的问题。

我不得不启用SYS_PTRACE Linux参数功能。

这是我在Terraform中定义容器定义时必须执行的操作:

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

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接