cmahns
(Colin Mahns)
1
目前在合并一个非常活跃的用户账户到一个新用户时遇到问题。该用户无法再访问之前的用户账户和电子邮件,并且由于我的实例使用的是 Auth0 SSO(我无法访问),因此我需要合并用户。
这在浏览器中运行会卡住,并且我似乎也无法通过应用程序控制台启动合并。
错误日志,来自运行 rake users:merge
# rake users:merge['redacted-source-user','redacted-target-user'] --trace
插件名称是 'discourse-user-notes',但插件目录名为 'discourse-staff-notes'
** 调用 users:merge (首次)
** 调用 environment (首次)
** 执行 environment
** 执行 users:merge
rake aborted!
ArgumentError: topic
/var/www/discourse/app/services/post_owner_changer.rb:12:in `block in initialize'
/var/www/discourse/app/services/post_owner_changer.rb:11:in `each'
/var/www/discourse/app/services/post_owner_changer.rb:11:in `initialize'
/var/www/discourse/app/services/user_merger.rb:83:in `new'
/var/www/discourse/app/services/user_merger.rb:83:in `change_post_owner'
/var/www/discourse/app/services/user_merger.rb:71:in `block in move_posts'
/var/www/discourse/app/services/user_merger.rb:69:in `each'
/var/www/discourse/app/services/user_merger.rb:69:in `move_posts'
/var/www/discourse/app/services/user_merger.rb:14:in `merge!'
/var/www/discourse/lib/tasks/users.rake:57:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:279:in `block in execute'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:279:in `each'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:279:in `execute'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:83:in `block in run'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
bin/rake:13:in `<top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:492:in `exec'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:34:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/cli.rb:28:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/exe/bundle:45:in `block in <top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.4.13/exe/bundle:33:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => users:merge
cmahns
(Colin Mahns)
2
抱歉打扰,但仍然遇到同样的问题。现在在 rake aborted 消息之后又收到了一个新的 ArgumentError!
在此包含两个用户名,以查看是否是用户名本身引起的问题。
错误日志,来自运行 rake users:merge
# rake users:merge['n_stylo','nat1'] --trace
插件名称是 'discourse-user-notes',但插件目录名为 'discourse-staff-notes'
** 调用 users:merge (首次)
** 调用 environment (首次)
** 执行 environment
** 执行 users:merge
rake aborted!
ArgumentError: topic (ArgumentError)
raise ArgumentError.new(arg) if self.instance_variable_get("@#{arg}").blank?
^^^^^^^^^^^^^^^^^^^^^^
/var/www/discourse/app/services/post_owner_changer.rb:12:in `block in initialize'
/var/www/discourse/app/services/post_owner_changer.rb:11:in `each'
/var/www/discourse/app/services/post_owner_changer.rb:11:in `initialize'
/var/www/discourse/app/services/user_merger.rb:83:in `new'
/var/www/discourse/app/services/user_merger.rb:83:in `change_post_owner'
/var/www/discourse/app/services/user_merger.rb:71:in `block in move_posts'
/var/www/discourse/app/services/user_merger.rb:69:in `each'
/var/www/discourse/app/services/user_merger.rb:69:in `move_posts'
/var/www/discourse/app/services/user_merger.rb:14:in `merge!'
/var/www/discourse/lib/tasks/users.rake:57:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:279:in `block in execute'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:279:in `each'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:279:in `execute'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:199:in `synchronize'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:199:in `invoke_with_call_chain'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/task.rb:188:in `invoke'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/application.rb:182:in `invoke_task'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/application.rb:138:in `block (2 levels) in top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/application.rb:138:in `each'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/application.rb:138:in `block in top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/application.rb:147:in `run_with_threads'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/application.rb:132:in `top_level'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/application.rb:83:in `block in run'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/application.rb:208:in `standard_exception_handling'
/var/www/discourse/vendor/bundle/ruby/3.2.0/gems/rake-13.1.0/lib/rake/application.rb:80:in `run'
bin/rake:13:in `<top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:58:in `load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:58:in `kernel_load'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli/exec.rb:23:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:451:in `exec'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:34:in `dispatch'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:28:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/cli.rb:28:in `start'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/exe/bundle:28:in `block in <top (required)>'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
/usr/local/lib/ruby/gems/3.2.0/gems/bundler-2.5.3/exe/bundle:20:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => users:merge
cmahns
(Colin Mahns)
5
再次打扰,但我的实例上还有另一个用户遇到了此问题。错误日志如下:
运行 rake users:merge 时的错误日志
root@forum-app:/var/www/discourse# rake users:merge[‘NikS’,‘NikS1’] --trace
插件名称是 ‘discourse-user-notes’,但插件目录名为 ‘discourse-staff-notes’
** 调用 users:merge (首次)
** 调用 environment (首次)
** 执行 environment
** 执行 users:merge
rake 中止!
ArgumentError: topic (ArgumentError)
raise ArgumentError.new(arg) if self.instance_variable_get("@#{arg}").blank?
^^^^^^^^^^^^^^^^^^^^^^
/var/www/discourse/app/services/post_owner_changer.rb:12:in block in initialize' /var/www/discourse/app/services/post_owner_changer.rb:11:in each’
/var/www/discourse/app/services/post_owner_changer.rb:11:in initialize' /var/www/discourse/app/services/user_merger.rb:84:in new’
/var/www/discourse/app/services/user_merger.rb:84:in change_post_owner' /var/www/discourse/app/services/user_merger.rb:72:in block in move_posts’
/var/www/discourse/app/services/user_merger.rb:70:in each' /var/www/discourse/app/services/user_merger.rb:70:in move_posts’
/var/www/discourse/app/services/user_merger.rb:14:in merge!' /var/www/discourse/lib/tasks/users.rake:57:in block in ’
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:279:in block in execute' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:279:in each’
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:279:in execute' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:219:in block in invoke_with_call_chain’
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:199:in synchronize' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:199:in invoke_with_call_chain’
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/task.rb:188:in invoke' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:188:in invoke_task’
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:138:in block (2 levels) in top_level' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:138:in each’
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:138:in block in top_level' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:147:in run_with_threads’
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:132:in top_level' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:83:in block in run’
/var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:214:in standard_exception_handling' /var/www/discourse/vendor/bundle/ruby/3.3.0/gems/rake-13.2.1/lib/rake/application.rb:80:in run’
bin/rake:13:in <top (required)>' /usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/cli/exec.rb:58:in load’
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/cli/exec.rb:58:in kernel_load' /usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/cli/exec.rb:23:in run’
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/cli.rb:455:in exec' /usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/vendor/thor/lib/thor/command.rb:28:in run’
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in invoke_command' /usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/vendor/thor/lib/thor.rb:527:in dispatch’
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/cli.rb:35:in dispatch' /usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/vendor/thor/lib/thor/base.rb:584:in start’
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/cli.rb:29:in start' /usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/exe/bundle:28:in block in <top (required)>’
/usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/friendly_errors.rb:117:in with_friendly_errors' /usr/local/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/exe/bundle:20:in <top (required)>’
/usr/local/bin/bundle:25:in load' /usr/local/bin/bundle:25:in ’
任务:TOP => users:merge
不确定我是否需要为像这样的用户做其他事情,源用户是一个有 834 帖子的 7 年账户,目标用户有 162 帖子。
抱歉回复晚了。
这可能有点碰运气,但顶部的用户备注警告对这些错误有意义吗?
我认为我之前见过一个问题,用户备注插件不喜欢没有更新名称。您能否在 app.yml 中修改它,重建,看看是否有帮助?
这是我想到的:
RGJ
(Richard - Communiteq)
7
那是客户端问题。
我从未见过服务器端警告表明存在实际问题。它只是每次运行 rake 或 rails c 命令行时都会弹出的东西。
1 个赞
RGJ
(Richard - Communiteq)
9
是的,完全同意。也许可以运行 LOAD_PLUGINS=0 的 rake 任务。
1 个赞
是否需要注意用户可能拥有数据的其他插件?例如,已解决、主题投票 、投票等