undasein
(Andres Garrido)
1
您好!我在上次更新中遇到了一个问题:
FAILED -------------------- Pups::ExecError: cd /var/www/discourse & su discourse -c ‘bundle exec rake db:migrate’ 失败,返回 #<Process::Status: pid 690 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’”]} 7027ff0ccd166f831f9728472676ad91704fdd4caa6833a219d44697e740acdc ** 引导失败 ** 请向上滚动查找更早的错误消息,可能不止一个。./discourse-doctor 可能有助于诊断问题。
Sideqik 也停止了。
有人能帮帮我吗?谢谢!!
附注:网站是 llastres.com
2 个赞
undasein
(Andres Garrido)
3
好的,我该如何识别它们?搜索“error”这个词?如果您告诉我如何运行日志,我会附上它。我是服务器新手。非常感谢您的帮助。
编辑,我找到了这个:
Caused by:
PG::DuplicateTable: ERROR: relation "discourse_reactions_reactions" already exists
2 个赞
undasein
(Andres Garrido)
5
抱歉,我在工作。这是我的 app.yml:
## 这是多合一、独立的 Discourse Docker 容器模板
##
## 修改此文件后,您必须重建
## /var/discourse/launcher rebuild app
##
## 编辑时请*极其小心*!
## YAML 文件对空格或对齐错误非常非常敏感!
## 如有需要,请访问 http://www.yamllint.com/ 来验证此文件
templates:
- "templates/postgres.template.yml"
- "templates/redis.template.yml"
- "templates/web.template.yml"
- "templates/web.ratelimited.template.yml"
## 如果您想添加 Let's Encrypt (https),请取消注释这两行
- "templates/web.ssl.template.yml"
- "templates/web.letsencrypt.ssl.template.yml"
## 此容器应暴露哪些 TCP/IP 端口?
## 如果您希望 Discourse 与 Apache 或 nginx 等其他 Web 服务器共享端口,
## 请参阅 https://meta.discourse.org/t/17247 获取详细信息
expose:
- "80:80" # http
- "443:443" # https
params:
db_default_text_search_config: "pg_catalog.spanish"
## 将 db_shared_buffers 设置为总内存的最多 25%。
## 将由 bootstrap 根据检测到的 RAM 自动设置,或者您可以覆盖它
db_shared_buffers: "2048MB"
## 可以提高排序性能,但会增加每个连接的内存使用量
#db_work_mem: "40MB"
## 此容器应使用哪个 Git 版本? (默认:tests-passed)
#version: tests-passed
env:
LC_ALL: es_ES.UTF-8
LANG: es_ES.UTF-8
LANGUAGE: es_ES.UTF-8
DISCOURSE_DEFAULT_LOCALE: es
## 支持多少并发 Web 请求?取决于内存和 CPU 核心。
## 将由 bootstrap 根据检测到的 CPU 自动设置,或者您可以覆盖它
UNICORN_WORKERS: 8
## TODO:此 Discourse 实例将响应的域名
## 必需。Discourse 不能使用纯 IP 地址运行。
DISCOURSE_HOSTNAME: EDITED
## 如果您希望容器以与上面指定的相同主机名 (-h 选项) 启动,请取消注释
## (默认值为 "$hostname-$config")
#DOCKER_USE_HOSTNAME: true
## TODO:将成为初始注册管理员和开发人员的逗号分隔的电子邮件列表
## 示例:'user1@example.com,user2@example.com'
DISCOURSE_DEVELOPER_EMAILS: 'EDITED'
## TODO:用于验证新帐户和发送通知的 SMTP 邮件服务器
# 需要 SMTP 地址、用户名和密码
# 注意:SMTP 密码中的字符 '#' 可能会导致问题!
DISCOURSE_SMTP_ADDRESS: EDITED
DISCOURSE_SMTP_PORT: EDITED
DISCOURSE_SMTP_USER_NAME: EDITED
DISCOURSE_SMTP_PASSWORD: EDITED
DISCOURSE_SMTP_ENABLE_START_TLS: true # (可选,默认 true)
DISCOURSE_SMTP_DOMAIN: EDITED
DISCOURSE_NOTIFICATION_EMAIL: EDITED
## 如果您添加了 Let's Encrypt 模板,请取消注释下方以获取免费 SSL 证书
LETSENCRYPT_ACCOUNT_EMAIL: EDITED
## 此 Discourse 实例的 http 或 https CDN 地址 (配置为拉取)
## 请参阅 https://meta.discourse.org/t/14857 获取详细信息
#DISCOURSE_CDN_URL: https://discourse-cdn.example.com
## 用于 IP 地址查找的 MaxMind 地理位置 IP 地址密钥
## 请参阅 https://meta.discourse.org/t/-/137387/23 获取详细信息
DISCOURSE_MAXMIND_LICENSE_KEY: EDITED
## Docker 容器是无状态的;所有数据都存储在 /shared 中
volumes:
- volume:
host: /var/discourse/shared/standalone
guest: /shared
- volume:
host: /var/discourse/shared/standalone/log/var-log
guest: /var/log
## 插件在此处
## 请参阅 https://meta.discourse.org/t/19157 获取详细信息
hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- git clone https://github.com/discourse/docker_manager.git
- git clone https://github.com/discourse/discourse-reactions
## 构建后要运行的任何自定义命令
run:
- exec: echo "Beginning of custom commands"
## 如果您想为首次注册设置“发件人”电子邮件地址,请取消注释并更改:
## 收到首次注册电子邮件后,请重新注释该行。它只需要运行一次。
#- exec: rails r "SiteSetting.notification_email='info@unconfigured.discourse.org'"
- exec: echo "End of custom commands"
1 个赞
undasein
(Andres Garrido)
6
事实上,我从未遇到过任何更新问题。我没有做什么奇怪的事情,只是更新了系统,然后就收到了错误发生的警告。
这是完整的日志:
1 个赞
Falco
(Falco)
7
它在运行 2021 年 5 月的迁移时遇到问题。此网站是否在发布渠道(beta/stable/tests-passed)之间移动过,或者是否曾从备份中恢复过?
1 个赞
undasein
(Andres Garrido)
8
我记得我们是在那天(5月21日)从mybb迁移过来的。
是的,今天我确实尝试恢复本月初的备份,想在错误发生前得到一个可用的副本,但当我点击开始时,出现了一个错误屏幕。
如果我的写作很奇怪,我很抱歉,我正在使用翻译器。
2 个赞
undasein
(Andres Garrido)
9
我仍然找不到解决方案,论坛也一直无法访问,您有什么建议吗?谢谢!!
2 个赞
升级后我的论坛无法访问。更新似乎进行得很顺利,但当我访问论坛页面时,论坛页面是空白的。
我手动更新了它,论坛就好了。不知道这是否对你有帮助。
2 个赞
undasein
(Andres Garrido)
11
感谢您的回复。我认为我的问题与论坛迁移相关的数据库错误有关。重建应用程序不起作用。
我已经查阅了常见问题解答和手册,但找不到任何解决方案。
我有一些(我认为是)错误发生之前的备份,但我无法加载它们,因为应用程序无法运行。我只能想到删除所有内容,进行全新安装并加载备份……
1 个赞
undasein
(Andres Garrido)
12
既然有备份,并且我无法运行应用程序(来恢复备份),我该怎么办?我别无选择,只能删除 Docker 然后重新开始吗?
1 个赞
我能找到的唯一一个有类似问题的帖子是 Unable to login into discourse suddenly - #8 by Tarek_Khalil
恐怕数据库错误已经超出了我的能力范围。@pfaffman 和 @RGJ 通常在这方面很擅长(虽然我不知道他们是否遇到过这个问题)。你们有什么诀窍吗?
2 个赞
pfaffman
(Jay Pfaffman)
14
你想进入 postgres 并删除该表。
大体上,它类似于
./launcher enter app
sudo postgres
psql
drop table the_table _mentioned above;
然后你应该能够运行升级。
编辑:但希望你首先做一个仅数据库的备份,以防万一!
4 个赞
undasein
(Andres Garrido)
16
抱歉,我是 Linux 服务器和命令的新手。应用程序未运行,所以我执行了:
./launcher start app
x86_64 arch detected. starting up existing container
+ /usr/bin/docker start app
app
之后:
./launcher enter app
然后,按照您的指示,第一个错误是:
sudo postgres
sudo: postgres: command not found
如果我输入 psql:
psql: error: FATAL: database "root" does not exist
pfaffman
(Jay Pfaffman)
17
抱歉。我正在用手机,思维不太清晰,无法解释……
启动应用后
su - postgres
psql discourse
然后
drop table discourse_reactions_reactions ;
然后输入 exit 或 control-d 几次以退出所有内容
undasein
(Andres Garrido)
18
不客气!当我清空一个表时,另一个表会给我一个错误。我已经清空了大约 3 个表……我应该一个一个地继续这样做吗?非常感谢您的帮助。
pfaffman
(Jay Pfaffman)
19
嗯。我希望你有一个备份。但也许吧?迁移如此混乱是没有道理的。
1 个赞
undasein
(Andres Garrido)
20
我自问自答。清空了 7 个表(discourse_reactions_reactions、directory_columns、external_upload_stubs、associated_groups、user_associated_groups、group_associated_groups、discourse_reactions_reaction_users)后,网站已恢复正常运行。我还恢复了最后的备份!
感谢大家的帮助!祝大家周末愉快 
2 个赞