MODIFICA: Beh, ci sono volute 18 ore, ma sembra che definire DISCOURSE_CDN_URL impedisca (almeno) a questo sito di ricostruirsi e/o funzionare dopo un ripristino. Penso che il prossimo passo da testare sia eseguire una build senza DISCOURSE_CDN_URL e poi avviare il contenitore con la variabile d’ambiente impostata.
Cosa sapevo prima
Avevo questo problema ieri, ma pensavo fosse risolto, ma risulta che ho ripristinato un database vecchio di un mese. Ripristinare il database recente blocca il sito.
Sono riuscito a ricostruire il sito da zero, quindi il problema non è nel codice o nei plugin standard. MA dopo aver ripristinato il database, il sito è down e non riesco a eseguire una ricostruzione, anche se elimino il database. Quindi immagino che il problema sia in un file che viene letto durante la compressione del JavaScript.
Ho provato a rimuovere tutti i background: image-url in onebox.scss, il che ha permesso al sito di ricostruirsi, ma la visualizzazione è completamente rotta, quindi questi errori sono un sintomo e non la causa del problema.
Dopo aver ripristinato il database (e i file) o durante la ricostruzione, ottengo errori come quello qui sotto nel log di 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