您好,
我刚刚将自 2017 年运行至今的论坛从 2.4 版本升级到了 2.6 版本。
在升级过程中,我注意到 PostgreSQL 9.5 已被替换为 PostgreSQL 12。
重建操作虽已顺利完成且未报错,但首页出现 500 错误(或显示“哎呀”错误提示)。
分类页面也存在同样的错误。
管理员功能正常,用户资料页面正常,用户列表正常,单个帖子页面也正常。
但管理员后台中的“顶级推荐”功能无法使用。
我目前不知道如何解决这个问题。
非常感谢您的帮助。
您好,
我刚刚将自 2017 年运行至今的论坛从 2.4 版本升级到了 2.6 版本。
在升级过程中,我注意到 PostgreSQL 9.5 已被替换为 PostgreSQL 12。
重建操作虽已顺利完成且未报错,但首页出现 500 错误(或显示“哎呀”错误提示)。
分类页面也存在同样的错误。
管理员功能正常,用户资料页面正常,用户列表正常,单个帖子页面也正常。
但管理员后台中的“顶级推荐”功能无法使用。
我目前不知道如何解决这个问题。
非常感谢您的帮助。
已安装任何插件吗?
“/logs”目录里有什么吗?
你说得对,我在 /logs 中多次遇到相同的错误:
NoMethodError (undefined method hex' for nil:NilClass) app/models/upload.rb:180:in base62_sha1’
app/models/upload.rb:174:in short_path' app/models/upload.rb:146:in short_path’
app/models/group.rb:767:in flair_url' (eval):5:in _fast_attributes’
lib/freedom_patches/ams_include_without_root.rb:54:in include!' lib/freedom_patches/ams_include_without_root.rb:57:in include!’
lib/freedom_patches/ams_include_without_root.rb:57:in include!' app/controllers/application_controller.rb:440:in serialize_data’
app/controllers/application_controller.rb:449:in render_serialized' lib/topic_list_responder.rb:16:in block (2 levels) in respond_with_list’
lib/topic_list_responder.rb:9:in respond_with_list' app/controllers/list_controller.rb:102:in block (2 levels) in class:ListController’
app/controllers/list_controller.rb:107:in public_send' app/controllers/list_controller.rb:107:in block (2 levels) in class:ListController’
app/controllers/application_controller.rb:340:in block in with_resolved_locale' app/controllers/application_controller.rb:340:in with_resolved_locale’
lib/middleware/omniauth_bypass_middleware.rb:68:in call' lib/content_security_policy/middleware.rb:12:in call’
lib/middleware/anonymous_cache.rb:336:in call' config/initializers/100-quiet_logger.rb:19:in call’
config/initializers/100-silence_logger.rb:31:in call' lib/middleware/enforce_hostname.rb:22:in call’
lib/middleware/request_tracker.rb:176:in `call’
不幸的是,进入安全模式并禁用所有项目并未解决问题。
我仍然遇到该错误。
我在日志中多次遇到此错误:
NoMethodError(nil:NilClass 未定义方法 hex')app/models/upload.rb:180 中的 base62_sha1’ app/models/upload.rb:174 中的 short_path' app/models/upload.rb:146 中的 short_path’ app/models/group.rb:
在管理仪表板中,某些指标(顶级引用主题)会报错:
“抱歉,请求耗时过长”
我曾遇到过这种情况,问题在于分类图片缺失。Discourse 会尝试获取它们的尺寸并失败。
您可以尝试移除任何分类图片。
我尝试恢复,但出现了一个错误:
[2020-08-27 10:06:41] 正在暂停 Sidekiq…
[2020-08-27 10:06:41] 最多等待 60 秒,让 Sidekiq 完成正在运行的任务…
[2020-08-27 10:38:40] 异常:错误:检测到死锁
详情:进程 594 正在等待数据库 16569 中关系 1113165 的 AccessExclusiveLock;被进程 1617 阻塞。
进程 1617 正在等待数据库 16569 中关系 1113221 的 AccessShareLock;被进程 594 阻塞。
提示:请查看服务器日志以获取查询详情。
上下文:SQL 语句 “ALTER TABLE public.categories SET SCHEMA backup;”
PL/pgSQL 函数 inline_code_block 第 11 行位于 EXECUTE 处
我们没有分类图片 ![]()
嗯 ![]()
也许是群组标识?
如何判断问题是否出在群组标签上,以及如何解决?
非常感谢
请尝试移除或重新上传任何群组的头像装饰,看看是否能解决该问题。
搞定啦,@michaeld!干得漂亮。@Olivier_Baillon,你可以将 Michael 的帖子标记为解决方案!
如果其他人也遇到这个问题,可以按以下方式操作:
cd /var/discourse
./launcher enter app
rails c
Group.all.pluck(:id,:flair_icon,:flair_upload_id)
# 针对 flair_upload_id 不为空的群组
g=Group.find(GROUP_ID_FROM_THE_LIST) # 这里是 id,不是 flair_upload_id
g.flair_upload
g.save
还有更优雅的方法,但如果你只有少量数据需要处理,这个方案应该能帮你快速上手。