更新问题:论坛损坏

您好,

我更新后出现了一个问题,我的论坛坏了。
我在 SSH 上看到了这个消息。

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' 失败,返回 #<Process::Status: pid 2472 exit 1>
失败位置:/usr/local/lib/ruby/gems/2.7.0/gems/pups-1.1.1/lib/pups/exec_command.rb:117:in `spawn'
exec 失败,参数为 {"cd"=>"$home", "hook"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
3d52a3f170f714bf580dcd30effbf9306fbf6e0ef1f786cf9dd4e326b066e6a4
**引导失败** 请向上滚动查找更早的错误消息,可能不止一个。
./discourse-doctor 可能有助于诊断问题。

您知道问题出在哪里以及如何修复吗?
非常感谢。

2 个赞

您能否向上滚动并检查更具体的错误,看看上面写了什么?

1 个赞

您好,

这是整个过程的 pastebin。显然 postgresql 有一些错误,尽管我不确定问题是否源于此

https://pastebin.com/nqLWDRAC

您是如何安装的?您使用的是什么 PostgreSQL 版本?

Caused by:
PG::InsufficientPrivilege: ERROR:  permission denied to create extension "unaccent"
HINT:  Must be superuser to create this extension.
1 个赞

我以root用户登录。
我无法获得更高的权限 :slight_smile:

我不知道关于postgres的情况
“‘pg_config’ 程序可以在以下软件包中找到:”

论坛已上线。
我重启了服务器。

第一个问题已修复,但还有第二个问题。

当我创建或回复帖子时,我收到此错误“500 内部服务器错误”。

您有什么修复建议吗?

您好,

我在日志文件中发现了这个错误:

ActiveRecord::StatementInvalid (PG::InFailedSqlTransaction: ERROR: current transaction is aborted, commands ignored until end of transaction block ) app/models/post.rb:973:in `block in link_post_uplo 
ActiveRecord::StatementInvalid (PG::InFailedSqlTransaction: ERROR:  current transaction is aborted, commands ignored until end of transaction block
)
app/models/post.rb:973:in `block in link_post_uploads'
app/models/post.rb:972:in `link_post_uploads'
lib/post_creator.rb:217:in `block in create'
lib/post_creator.rb:409:in `block (2 levels) in transaction'
lib/post_creator.rb:408:in `block in transaction'
lib/distributed_mutex.rb:33:in `block in synchronize'
lib/distributed_mutex.rb:29:in `synchronize'
lib/distributed_mutex.rb:29:in `synchronize'
lib/distributed_mutex.rb:14:in `synchronize'
lib/post_creator.rb:407:in `transaction'
lib/post_creator.rb:205:in `create'
lib/new_post_manager.rb:285:in `perform_create_post'
lib/new_post_manager.rb:223:in `perform'
app/controllers/posts_controller.rb:193:in `create'
app/controllers/application_controller.rb:400:in `block in with_resolved_locale'
app/controllers/application_controller.rb:400:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:71:in `call'
lib/middleware/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:358:in `call'
config/initializers/100-quiet_logger.rb:23:in `call'
config/initializers/100-silence_logger.rb:31:in `call'
lib/middleware/enforce_hostname.rb:23:in `call'
lib/middleware/request_tracker.rb:202:in `call'

您知道是什么问题吗?

这是标准安装吗?

是的,
我已经使用论坛6年了。
安装的最新版本是2.9.0.beta3。

您安装了任何插件吗?也许可以发布您的 app.yml?

您的 PostgreSQL 版本是什么?只需输入 launcher enter app 然后键入 psql -V

2 个赞

你好,

我进行了测试,但原始问题又出现了

Pups::ExecError: cd /var/www/discourse & su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 2458 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"=>"db_migrate", "cmd"=>["su discourse -c 'bundle exec rake db:migrate'"]}
45d3621c802f025ef80ad34e77ec3318a48677b0de0134210120ef7690b6e6f4
** 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.

我认为更新时出现问题是因为硬盘空间不足。我腾出了一些空间,现在有 67% 的可用空间。但是,仍然存在一个问题,是什么问题呢?

程序 ‘psql’ 尚未安装。
我需要安装它吗?

你是否在 psql 命令之前执行了

launcher enter app
1 个赞

一样,
我尝试安装,但收到此消息

E: 程序包 libperl5.22 需要重新安装,但我找不到它的存档。

我再次查看了你的 pastebin 日志文件。它显示是 Postgres 10。
你确定这是按照 https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md 安装的标准设置吗?

1 个赞

我以前说过,这个论坛已经存在很多年了,我从来没有遇到过什么大问题。通常,重建或更新就足以让一切恢复正常。
是的,这是正常安装。

我最后的尝试。

请执行

cd /var/discourse
./launcher enter app
psql -V

并将所有内容复制到回复中,包括命令和输出?

1 个赞
psql (PostgreSQL) 10.19 (Debian 10.19-1.pgdg110+1)

好的,太棒了。这和上次的结果不同。
那么现在请执行以下操作:

cd /var/discourse
git pull
./launcher rebuild app

如果出现错误,请在回复中(或在 Pastebin 上)发布包括命令在内的全部输出。

1 个赞

有趣的是,我遇到了相同或类似的错误。运行于 Discourse 2.9.0.beta2,并尝试更新到 ß3。我禁用了除 docker_manager 之外的所有插件,以运行 ./launcher rebuild app。运行在一个外部 PGSQL 数据库上,版本为:

$ psql --version
psql (PostgreSQL) 14.1 (Ubuntu 14.1-1.pgdg18.04+1)

在失败后,我可以通过 ./launcher restart app 重启容器,但回复时会出现 500 错误。

重建/升级期间的最终错误是:

FAILED
--------------------
Pups::ExecError: cd /var/www/discourse &amp;&amp; su discourse -c 'bundle exec rake db:migrate' failed with return #&lt;Process::Status: pid 658 exit 1&gt;
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"=&gt;"$home", "hook"=&gt;"db_migrate", "cmd"=&gt;["su discourse -c 'bundle exec rake db:migrate'"]}
bootstrap failed with exit code 1
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.

上面实际有意义的错误可以在这里找到:https://p153.p0.n0.cdn.getcloudapp.com/items/jkuvPekN/feb38236-3b84-410e-8fac-d1864d02ba69.txt?v=eb1d15e029cb07a73300d8ec07318876

我很难相信这是一个实际的权限问题,并且我犹豫是否要给 Discourse 数据库用户超级用户/root 权限给 pgsql。

对于这种最近出现的故障,还有什么其他的想法吗?