在添加无效的 GitHub 仓库后重建 Discourse

app.yml 文件中错误地添加了一个无效的 GitHub 存储库后,我的 Discourse 站点出现了一个问题。当我运行 ./launcher rebuild app 时,进程失败,现在站点无法重建。不幸的是,我有备份,但它们在恢复过程中失败。以下是问题的详细信息,包括完整的错误日志。

已采取的步骤:

  1. 我尝试按照此帖子中的指导,将 DeepSeek LLM 添加到我的 Discourse 安装中。
  2. 我将存储库 URL https://github.com/deepseek-ai/DeepSeek-LLM 添加到了 app.yml 文件中。
  3. 运行 ./launcher rebuild app,但失败了,导致站点无法运行。

完整错误日志:

(通过运行带有 --trace 的任务查看完整跟踪)
I, [2025-01-21T02:32:16.599723 #1]  INFO -- : gem install multipart-post -v 2.4.0 -i /var/www/discourse/plugins/discourse-ai-topic-summary/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed multipart-post-2.4.0
1 gem installed
gem install faraday-multipart -v 1.0.4 -i /var/www/discourse/plugins/discourse-ai-topic-summary/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed faraday-multipart-1.0.4
1 gem installed
gem install event_stream_parser -v 1.0.0 -i /var/www/discourse/plugins/discourse-ai-topic-summary/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed event_stream_parser-1.0.0
1 gem installed
gem install ruby-openai -v 7.0.0 -i /var/www/discourse/plugins/discourse-ai-topic-summary/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed ruby-openai-7.0.0
1 gem installed
gem install tokenizers -v 0.4.4 -i /var/www/discourse/plugins/discourse-ai/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed tokenizers-0.4.4-x86_64-linux
1 gem installed
gem install tiktoken_ruby -v 0.0.9 -i /var/www/discourse/plugins/discourse-ai/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Successfully installed tiktoken_ruby-0.0.9-x86_64-linux
1 gem installed
gem install ed25519 -v 1.2.4 -i /var/www/discourse/plugins/discourse-ai/gems/3.3.6 --no-document --ignore-dependencies --no-user-install
Building native extensions. This could take a while...
Successfully installed ed25519-1.2.4
1 gem installed
... (更多 gem 安装日志) ...
I, [2025-01-21T02:32:16.600035 #1]  INFO -- : Terminating async processes
I, [2025-01-21T02:32:16.600051 #1]  INFO -- : Sending INT to HOME=/var/lib/postgresql USER=postgres exec chpst -u postgres:postgres:ssl-cert -U postgres:postgres:ssl-cert /usr/lib/postgresql/13/bin/postmaster -D /etc/postgresql/13/main pid: 39
I, [2025-01-21T02:32:16.600103 #1]  INFO -- : Sending TERM to exec chpst -u redis -U redis /usr/bin/redis-server /etc/redis/redis.conf pid: 107
2025-01-21 02:32:16.600 UTC [39] LOG:  received fast shutdown request
107:signal-handler (1737426736) Received SIGTERM scheduling shutdown...
2025-01-21 02:32:16.602 UTC [39] LOG:  aborting any active transactions
2025-01-21 02:32:16.604 UTC [39] LOG:  background worker "logical replication launcher" (PID 54) exited with exit code 1
2025-01-21 02:32:16.605 UTC [49] LOG:  shutting down
107:M 21 Jan 2025 02:32:16.612 # User requested shutdown...
107:M 21 Jan 2025 02:32:16.612 * Saving the final RDB snapshot before exiting.
2025-01-21 02:32:16.634 UTC [39] LOG:  database system is shut down
107:M 21 Jan 2025 02:32:16.667 * DB saved on disk
107:M 21 Jan 2025 02:32:16.667 # Redis is now ready to exit, bye bye...

> FAILED
--------------------
Pups::ExecError: cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate' failed with return #<Process::Status: pid 837 exit 1>
Location of failure: /usr/local/lib/ruby/gems/3.3.0/gems/pups-1.2.1/lib/pups/exec_command.rb:132:in `spawn'
exec failed with the params {"cd"=>"$home", "tag"=>"migrate", "hook"=>"db_migrate", "cmd"=>["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.
./discourse-doctor may help diagnose the problem.

挑战:

  • 我无法从备份中恢复站点。
  • 重建持续失败,导致站点无法运行。

求助:

  1. 我该如何处理这些问题?运行 rebuild app 是否创建了一个有问题的插件或类似的东西?
  2. 是否有任何手动恢复步骤?
  3. 关于如何安全地从这种状态重建站点的任何建议?

我注册了一个托管的 Discourse 实例,并上传了备份,但即使文件正常上传,恢复选项也没有出现。

我非常感谢关于如何继续的任何建议或指导。如果需要更多详细信息,请告诉我!

如果移除插件,构建仍然失败吗?

另外,那个仓库不是插件。它是 Deepseek 的源代码。我认为 Sam 指的是将其制作成一个插件?

1 个赞

手动恢复步骤是 ./launcher start app — 如果最后一个存活的容器未被销毁。然后从 app.yml 中移除该仓库并重建。

1 个赞

这是失败的原因吗?你需要包含上面显示哪个迁移失败的部分。

我猜你可能还有一些损坏的插件或 YAML 文件中的格式错误,但根据你提供的信息,我无法判断。

要恢复备份,你必须发送电子邮件至 team@discourse.org 并请求他们进行恢复。

1 个赞

请尽快删除。

https://github.com/deepseek-ai/DeepSeek-LLM 不是 Discourse 插件,因此不应出现在 app.yml 文件中。

6 个赞

感谢大家以及你们的反馈。我无法解释这是如何解决的,但它似乎奏效了。当我意识到我在 app.yml 中放置了非插件的 GitHub 存储库并导致 discourse 崩溃时,我做的第一件事就是删除那一行并尝试重建,但没有成功。我重启了服务器几次,但都没有成功。重启后网站可以恢复运行,但从管理员或 SSH 重建会再次崩溃。然后突然之间,它就从 SSH 重建成功了,之后又更新了插件并从管理员那里重建成功了。我现在更新了 Ubuntu,似乎一切都还可以。问题似乎解决了,但仍然有点神秘。:partying_face:

3 个赞