Manca 'theme_fields' e fallimento sintassi rake db:migrate

Ciao a tutti,

Sto cercando di eseguire una nuova installazione di Discourse v2.8.8 su Debian Buster (in Docker). Attualmente le attività di Sidekiq stanno generando errori con il seguente errore relativo a theme_fields:

2022-09-06 08:25:53.301 AEST [1205] ERROR: relation "theme_fields" does not exist at character 454
2022-09-06 08:25:53.301 AEST [1205] STATEMENT: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
	       pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
	       c.collname, col_description(a.attrelid, a.attnum) AS comment
	  FROM pg_attribute a
	  LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
	  LEFT JOIN pg_type t ON a.atttypid = t.oid
 	  LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation
 	 WHERE a.attrelid = '"theme_fields"'::regclass
	   AND a.attnum > 0 AND NOT a.attisdropped
	 ORDER BY a.attnum

Cercando nei forum, questo è un errore simile a quello del post Restore problem relation theme_fields does not exist; che purtroppo non ha ancora una risoluzione.

Indagando più a fondo, sembra che questo sia correlato al fallimento dell’attività db:migrate nel mio caso (è un’ipotesi).
L’esecuzione di RAILS_ENV=test bin/rails db:migrate in un terminale restituisce un SyntaxError di seguito:

rails aborted!
SyntaxError: /app/lib/tasks/assets.rake:294: syntax error, unexpected '}', expecting `end'
/app/lib/tasks/assets.rake:306: syntax error, unexpected `end', expecting '}'
/app/lib/tasks/assets.rake:418: class definition in method body
  class Sprockets::Manifest
  ^~~~~~~~~~~~~~~~~~~~~~~~
/app/lib/tasks/assets.rake:430: syntax error, unexpected end-of-input, expecting `end'
/usr/local/bundle/ruby/2.7.0/gems/bootsnap-1.9.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:60:in `load'
/usr/local/bundle/ruby/2.7.0/gems/bootsnap-1.9.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:60:in `load'
/usr/local/bundle/ruby/2.7.0/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:326:in `block in load'
/usr/local/bundle/ruby/2.7.0/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:299:in `load_dependency'
/usr/local/bundle/ruby/2.7.0/gems/activesupport-6.1.6.1/lib/active_support/dependencies.rb:326:in `load'
/usr/local/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/engine.rb:675:in `block in run_tasks_blocks'
/usr/local/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/engine.rb:675:in `each'
/usr/local/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/engine.rb:675:in `run_tasks_blocks'
/usr/local/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/application.rb:528:in `run_tasks_blocks'
/usr/local/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/engine.rb:464:in `load_tasks'
/usr/local/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/railtie.rb:207:in `public_send'
/usr/local/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/railtie.rb:207:in `method_missing'
/app/Rakefile:9:in `<main>'
/usr/local/bundle/ruby/2.7.0/gems/bootsnap-1.9.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:60:in `load'
/usr/local/bundle/ruby/2.7.0/gems/bootsnap-1.9.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:60:in `load'
/usr/local/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/commands/rake/rake_command.rb:20:in `block in perform'
/usr/local/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/commands/rake/rake_command.rb:18:in `perform'
/usr/local/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/command.rb:50:in `invoke'
/usr/local/bundle/ruby/2.7.0/gems/railties-6.1.6.1/lib/rails/commands.rb:18:in `<main>'
/usr/local/bundle/ruby/2.7.0/gems/bootsnap-1.9.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/usr/local/bundle/ruby/2.7.0/gems/bootsnap-1.9.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/usr/local/bundle/ruby/2.7.0/gems/bootsnap-1.9.4/lib/bootsnap/load_path_cache/loaded_features_index.rb:105:in `register'
/usr/local/bundle/ruby/2.7.0/gems/bootsnap-1.9.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/usr/local/bundle/ruby/2.7.0/gems/bootsnap-1.9.4/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
bin/rails:18:in `<main>'
(See full trace by running task with --trace)

Guardando il codice lib/tasks/assets.rake (v2.8.8), sembra che tutte le end e } siano posizionate correttamente. Non essendo un esperto di Ruby, potrei ipotizzare che forse uno dei valori delle variabili stia rompendo le closure.

Cosa potrebbe essere andato storto?

Cordiali saluti,

Ciao a tutti!

Sto ancora cercando suggerimenti/idee per questo problema.

Grazie
Cordiali saluti,