今天在新装一台翼龙的时候,遇到了无法判断系统的错误。如下所示。

03:40:50.633Z FATAL wings: A fatal error caused the daemon to abort the startup. (additional={})
    Error: Unable to create a pterodactyl user and group, unknown operating system.
        at /srv/daemon/src/index.js:200:34
        at nextTask (/srv/daemon/node_modules/[email protected]@async/dist/async.js:5324:14)
        at next (/srv/daemon/node_modules/[email protected]@async/dist/async.js:5331:9)
        at /srv/daemon/node_modules/[email protected]@async/dist/async.js:969:16
        at /srv/daemon/src/index.js:176:21
        at /srv/daemon/node_modules/[email protected]@getos/index.js:95:16
        at wrapper (/srv/daemon/node_modules/[email protected]@async/dist/async.js:268:20)
        at iteratorCallback (/srv/daemon/node_modules/[email protected]@async/dist/async.js:495:17)
        at /srv/daemon/node_modules/[email protected]@async/dist/async.js:321:20
        at /srv/daemon/node_modules/[email protected]@getos/index.js:87:20

问题分析

一开始以为是使用的 Nodejs 版本不受支持(毕竟官方文档中,安装 nodejs 所贴的版本还是 10.x)。在换到了更低的版本后,同样的问题依然存在。于是,秉承着遇事不决问 Google 的态度,我搜索到了 这个 issue.

这个 issue 中提到了 Pterodactyl 使用的 Nodejs 模块 getos 的改动。可以看到,getos 改动了针对 Ubuntu 和 CentOS 的返回内容,导致 Pterodactyl 无法正确的判断当前 Linux 发行版本。

解决方案

执行下列命令

useradd --system --no-create-home --shell /bin/false pterodactyl

除另有声明外,本博客文章均采用 知识共享(Creative Commons) 署名-非商业性使用-相同方式共享 4.0 国际许可协议 进行许可。