Discourse重建不起作用

尝试添加带有嵌入式图形的帖子时收到了一条错误消息。似乎存在文件保护问题,建议执行以下操作:

./launcher rebuild app

我执行了该命令,并收到以下错误:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake themes:update assets:precompile' failed with return #<Process::Status: pid 515 exit 1>
Location of failure: /usr/local/lib/ruby/gems/2.7.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec failed with the params {"cd"=>"$home", "hook"=>"assets_precompile", "cmd"=>["su discourse -c 'bundle exec rake themes:update assets:precompile'"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
5c01a6b7b892f68e51e8f275b360af36d7b6f0ac8a3e22c837b0afaaef1705f4

这个错误有点令人费解。这会在大约五分钟后出现。问题是我的数据在 /var/discourse 而不是 /var/www/discourse。我上次备份是一个月前,我想修复这个问题,而不是丢失上个月的数据。有什么想法吗?是否有可能在无法重建的系统上备份数据库,然后以某种方式在备份上恢复数据库?

还有一个更早的错误:“预格式化文本”

warning Skipping preferred cache folder "/home/discourse/.cache/yarn" because it is not writable.
warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-1000".
warning Cannot find a suitable global folder. Tried these: "/usr/local, /home/discourse/.yarn"
node:fs:1336
  handleErrorFromBinding(ctx);
  ^

Error: EACCES: permission denied, mkdir '/home/discourse/.config/configstore'
You don't have access to this file.

    at Object.mkdirSync (node:fs:1336:3)
    at AsyncFunction.module.exports.sync (/var/www/discourse/app/assets/javascripts/node_modules/make-dir/index.js:114:6)
    at Configstore.set all [as all] (/var/www/discourse/app/assets/javascripts/node_modules/configstore/index.js:59:12)
    at Configstore.set (/var/www/discourse/app/assets/javascripts/node_modules/configstore/index.js:91:12)
    at clientId (/var/www/discourse/app/assets/javascripts/node_modules/ember-cli/lib/cli/index.js:55:17)
    at module.exports (/var/www/discourse/app/assets/javascripts/node_modules/ember-cli/lib/cli/index.js:105:13)
    at Object.<anonymous> (/var/www/discourse/app/assets/javascripts/node_modules/ember-cli/bin/ember:34:1)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32) {
  errno: -13,

根本没有 /home/discourse 文件夹。

这些路径位于容器外部和内部。

您是否安装了可能导致此问题的插件?您可以删除任何非标准插件并进行设置,看看是否能解决问题?

杰伊,我想我弄明白了。我能够连接到容器,并且容器内的所有路径似乎都被设置为 root 用户所有。我将它们全部改回 discourse 用户,它就恢复运行了。但是,我不确定权限是否正确。这个 Discourse 实例已经运行了好几个月,没有任何更改,突然发生了这种情况,我无法解释原因。有什么想法吗?

我认为我看到过一个关于删除 chown 的提交,所以这可能是一个 bug。

但是,您是否有任何非标准插件?

我的 Discourse 非常普通,所以没有。我最好的猜测是,这发生在我几天前升级到 2.9.0.beta4 之后。我直到现在才注意到这个问题。Beta3 运行正常。在我看来,容器的很大一部分可能被 chowned 为 root。难道大部分不应该归 discourse 所有吗?

1 个赞

Error trying to edit a post with an image in (NginX Proxy Manager?) - #22 by vmsman 继续