수정: 글쎄요, 18시간이 걸렸지만 DISCOURSE_CDN_URL을 정의하면 (최소한) 이 사이트가 복원 후 재빌드되거나 작동하지 않는 문제를 방지하는 것 같습니다. 다음으로 테스트할 것은 DISCOURSE_CDN_URL 없이 빌드를 수행한 후, 해당 환경 변수가 설정된 상태로 컨테이너를 실행해 보는 것입니다.
이전에 알고 있던 것들
어제 이 문제가 있었지만 사라진 줄 알았으나, 알고 보니 1개월 전의 데이터베이스를 복원한 것이었습니다. 최근 데이터베이스를 복원하면 사이트가 멈춥니다.
사이트를 처음부터 빌드할 수 있으므로 코드나 표준 플러그인의 문제는 아닙니다. 하지만 데이터베이스를 복원한 후 사이트가 다운되며, 데이터베이스를 삭제하더라도 재빌드가 불가능합니다. 따라서 문제는 JavaScript를 압축할 때 읽히는 파일 안에 있는 것 같습니다.
onebox.scss의 모든 background: image-url을 제거해 보았더니 사이트 재빌드는 가능해졌지만, 디스플레이가 완전히 엉망이 되어 해당 에러는 문제의 원인이라기보다 증상인 것으로 보입니다.
데이터베이스(와 파일)를 복원하거나 재빌드할 때 rails 로그에 다음과 같은 에러가 발생합니다.
I, [2019-12-22T21:21:25.532604 #1] INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
NOTE: Inheriting Faraday::Error::ClientError is deprecated; use Faraday::ClientError instead. It will be removed in or after version 1.0
Faraday::Error::ClientError.inherited called from /var/www/discourse/plugins/discourse-github/gems/2.6.5/gems/octokit-4.14.0/lib/octokit/middleware/follow_redirects.rb:14.
> Seeding dark and light themes
[SassC::FunctionsHandler] undefined method `protocol' for nil:NilClass
rake aborted!
Discourse::ScssError: Error: error in C function image-url: undefined method `protocol' for nil:NilClass
on line 90 of app/assets/stylesheets/common/base/onebox.scss, in function `image-url`
from line 90 of app/assets/stylesheets/common/base/onebox.scss, in mixin `onebox-favicon`
from line 110 of app/assets/stylesheets/common/base/onebox.scss
from line 34 of app/assets/stylesheets/common.scss
from line 1 of desktop.scss
>> background: image-url("favicons/#{$image}.png") no-repeat 0% 50%;
----------------^
/var/www/discourse/lib/stylesheet/manager.rb:183:in `rescue in compile'
/var/www/discourse/lib/stylesheet/manager.rb:171:in `compile'
/var/www/discourse/lib/stylesheet/manager.rb:80:in `block (2 levels) in stylesheet_details'
/var/www/discourse/lib/stylesheet/manager.rb:66:in `each'
/var/www/discourse/lib/stylesheet/manager.rb:66:in `block in stylesheet_details'
/var/www/discourse/lib/stylesheet/manager.rb:64:in `synchronize'
/var/www/discourse/lib/stylesheet/manager.rb:64:in `stylesheet_details'
/var/www/discourse/lib/stylesheet/manager.rb:34:in `stylesheet_data'
/var/www/discourse/app/models/theme.rb:280:in `block in refresh_message_for_targets'
/var/www/discourse/app/models/theme.rb:279:in `map'
/var/www/discourse/app/models/theme.rb:279:in `refresh_message_for_targets'
/var/www/discourse/app/models/theme.rb:267:in `notify_theme_change'
/var/www/discourse/app/models/theme.rb:275:in `notify_theme_change'
/var/www/discourse/app/models/theme.rb:61:in `block in <class:Theme>'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/callbacks.rb:429:in `instance_exec'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/callbacks.rb:429:in `block in make_lambda'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/callbacks.rb:239:in `block in halting_and_conditional'
/var/www/discourse/vendor/bundle/ruby/2.6.0/gems/activesupport-6.0.1/lib/active_support/callbacks.r