由于主题:update 失败且主题未更改,因此无法重建

我正在尝试更新到最新的稳定版本(从 2.8.10 到 2.8.11),但在调用 themes:update 时中止了。我尝试手动运行 themes:update 任务,但错误相同:

# rake themes:update
Checking 'xyz (darker)' for 'default'... Failed to update 'xyz (darker)': undefined method `scheme' for nil:NilClass
rake aborted!
NoMethodError: undefined method `scheme' for nil:NilClass
/var/www/discourse/lib/theme_store/git_importer.rb:129:in `clone_http!'
/var/www/discourse/lib/theme_store/git_importer.rb:94:in `clone!'
/var/www/discourse/lib/theme_store/git_importer.rb:19:in `import!'
/var/www/discourse/app/models/remote_theme.rb:126:in `update_remote_version'
/var/www/discourse/lib/tasks/themes.rake:62:in `block in update_themes'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:71:in `block (2 levels) in find_each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:71:in `each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:71:in `block in find_each'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:138:in `block in find_in_batches'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:245:in `block in in_batches'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:229:in `loop'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:229:in `in_batches'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:137:in `find_in_batches'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/activerecord-6.1.6.1/lib/active_record/relation/batches.rb:70:in `find_each'
/var/www/discourse/lib/tasks/themes.rake:56:in `update_themes'
/var/www/discourse/lib/tasks/themes.rake:87:in `block (2 levels) in <main>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rails_multisite-4.0.0/lib/rails_multisite/connection_management.rb:80:in `with_connection'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/rails_multisite-4.0.0/lib/rails_multisite/connection_management.rb:90:in `each_connection'
/var/www/discourse/lib/tasks/themes.rake:86:in `block in <main>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:58:in `load'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:58:in `kernel_load'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:23:in `run'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bundler-2.3.22/lib/bundler/cli.rb:486:in `exec'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bundler-2.3.22/lib/bundler/cli.rb:31:in `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bundler-2.3.22/lib/bundler/cli.rb:25:in `start'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bundler-2.3.22/exe/bundle:48:in `block in <top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bundler-2.3.22/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
/var/www/discourse/vendor/bundle/ruby/2.7.0/gems/bundler-2.3.22/exe/bundle:36:in `<top (required)>'
/usr/local/bin/bundle:25:in `load'
/usr/local/bin/bundle:25:in `<main>'
Tasks: TOP => themes:update
(See full trace by running task with --trace)

相关的主题自(一年多前)以来未被更改,实际上非常基础——只更改了一些颜色并添加了一个 CSS 规则,所以 Discourse 中似乎有些东西发生了变化。不确定是否相关,但该主题是远程的(github 私有仓库)。

在此之后,我注意到如果我尝试从 Web 界面更新主题,我会收到一个 500 错误,并出现类似的错误:

Started PUT "/admin/themes/48" for x.x.x.x at 2022-11-14 17:44:14 +0000
Processing by Admin::ThemesController#update as */*
  Parameters: {"theme"=>{"remote_check"=>true}, "id"=>"48"}
Completed 500 Internal Server Error in 1904ms (ActiveRecord: 0.0ms | Allocations: 24475)
NoMethodError (undefined method `scheme' for nil:NilClass)
lib/theme_store/git_importer.rb:129:in `clone_http!'
lib/theme_store/git_importer.rb:94:in `clone!'
lib/theme_store/git_importer.rb:19:in `import!'
app/models/remote_theme.rb:126:in `update_remote_version'
app/controllers/admin/themes_controller.rb:207:in `update'
app/controllers/application_controller.rb:387:in `block in with_resolved_locale'
app/controllers/application_controller.rb:387:in `with_resolved_locale'
lib/middleware/omniauth_bypass_middleware.rb:71:in `call'
lib/content_security_policy/middleware.rb:12:in `call'
lib/middleware/anonymous_cache.rb:361: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:198:in `call'

有什么想法我应该关注什么?如果需要,我可以分享主题文件。

编辑补充:将仓库更改为公开后错误停止了,所以似乎在使用身份验证令牌处理私有仓库方面有些东西发生了变化。但是,奇怪的是,将仓库改回私有并没有再次引发错误……此外,有两个远程主题具有相同的设置(在私有仓库中),但只有一个失败了。