【问题标题】:dotnet-dump fails with "Writing dump failed (HRESULT: 0x80004005)" in Ubuntudotnet-dump 在 Ubuntu 中因“写入转储失败(HRESULT:0x80004005)”而失败
【发布时间】:2020-08-08 07:09:10
【问题描述】:

尽管我在 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)"

他们有类似的问题here,但他们通过 --output 到 /tmp 中的目录解决了这个问题,但没有帮助

【问题讨论】:

    标签: .net linux ubuntu .net-core


    【解决方案1】:

    另外,我会描述一下docker的案例。

    如果您使用的是 docker,启动具有权限的容器会有所帮助:

    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

    【讨论】:

    【解决方案2】:

    请检查你的服务目录,createdump的权限,它需要执行权限才能工作,如果是这样的:

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

    您必须授予执行权:

    sudo chmod u+x createdump
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-02-16
      • 2016-09-07
      • 2010-12-28
      • 2015-12-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多