openpoke / decidim-module-reporting-proposals

A new component for Decidim based on Proposals focus on reporting geolocated actuations in a city
GNU Affero General Public License v3.0
6 stars 5 forks source link

Causes the environment to start during assets:precompile #58

Closed Kagemaru closed 1 year ago

Kagemaru commented 1 year ago

It seems this module causes our Decidim to load the environment and connect to the database during assets:precompile.

Since we're using a docker build strategy and have no postgresql there, this poses a problem. Usual solutions (like using the nulldb adapter) do not work since Decidim uses postgres extensions in the schema.

microstudi commented 1 year ago

This is probably due the classes overrides in the engine.rb, I'll take a look and see if we can skip them for the precompile. cc/ @Kagemaru

microstudi commented 1 year ago

@Kagemaru would you mind to share exactly the problem associated with precompile? I haven't been able to reproduce it. Maybe if I see the logs I can figure out what's happening.

Kagemaru commented 1 year ago

@microstudi It seems while loading a deface file it tries to use I18n, which in turn loads TermCustomizer, which connects to a db. (I think?)

rails aborted!
PG::ConnectionBad: could not connect to server: Connection refused
        Is the server running on host "localhost" (127.0.0.1) and accepting
        TCP/IP connections on port 5432?
could not connect to server: Cannot assign requested address
        Is the server running on host "localhost" (::1) and accepting
        TCP/IP connections on port 5432?
/app-src/vendor/bundle/ruby/2.7.0/gems/pg-1.1.4/lib/pg.rb:56:in `initialize'
/app-src/vendor/bundle/ruby/2.7.0/gems/pg-1.1.4/lib/pg.rb:56:in `new'
/app-src/vendor/bundle/ruby/2.7.0/gems/pg-1.1.4/lib/pg.rb:56:in `connect'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/connection_adapters/postgresql_adapter.rb:46:in `postgresql_connection'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:887:in `new_connection'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:931:in `checkout_new_connection'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:910:in `try_to_checkout_new_connection'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:871:in `acquire_connection'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:593:in `checkout'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:437:in `connection'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:1125:in `retrieve_connection'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/connection_handling.rb:221:in `retrieve_connection'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/connection_handling.rb:189:in `connection'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/model_schema.rb:517:in `load_schema!'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/attributes.rb:247:in `load_schema!'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/attribute_decorators.rb:50:in `load_schema!'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/model_schema.rb:507:in `block in load_schema'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/model_schema.rb:504:in `synchronize'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/model_schema.rb:504:in `load_schema'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/model_schema.rb:381:in `columns_hash'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/relation/query_methods.rb:1225:in `arel_column'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/relation/query_methods.rb:1212:in `block in arel_columns'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/relation/query_methods.rb:1205:in `each'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/relation/query_methods.rb:1205:in `flat_map'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/relation/query_methods.rb:1205:in `arel_columns'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/relation/query_methods.rb:1196:in `build_select'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/relation/query_methods.rb:1071:in `build_arel'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/relation/query_methods.rb:1016:in `arel'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/relation.rb:824:in `block in exec_queries'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/relation.rb:842:in `skip_query_cache_if_necessary'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/relation.rb:811:in `exec_queries'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/relation.rb:626:in `load'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/relation.rb:250:in `records'
/app-src/vendor/bundle/ruby/2.7.0/gems/activerecord-6.0.5/lib/active_record/relation.rb:245:in `to_ary'
/app-src/vendor/bundle/ruby/2.7.0/bundler/gems/decidim-module-term_customizer-0046905fff1f/app/models/decidim/term_customizer/translation.rb:18:in `available_locales'
/app-src/vendor/bundle/ruby/2.7.0/bundler/gems/decidim-module-term_customizer-0046905fff1f/lib/decidim/term_customizer/i18n_backend.rb:17:in `available_locales'
/app-src/vendor/bundle/ruby/2.7.0/gems/i18n-1.10.0/lib/i18n/backend/chain.rb:51:in `block in available_locales'
/app-src/vendor/bundle/ruby/2.7.0/gems/i18n-1.10.0/lib/i18n/backend/chain.rb:51:in `map'
/app-src/vendor/bundle/ruby/2.7.0/gems/i18n-1.10.0/lib/i18n/backend/chain.rb:51:in `available_locales'
/app-src/vendor/bundle/ruby/2.7.0/gems/i18n-1.10.0/lib/i18n/config.rb:45:in `available_locales'
/app-src/vendor/bundle/ruby/2.7.0/gems/i18n-1.10.0/lib/i18n/config.rb:51:in `available_locales_set'
/app-src/vendor/bundle/ruby/2.7.0/gems/i18n-1.10.0/lib/i18n.rb:351:in `locale_available?'
/app-src/vendor/bundle/ruby/2.7.0/gems/i18n-1.10.0/lib/i18n.rb:357:in `enforce_available_locales!'
/app-src/vendor/bundle/ruby/2.7.0/gems/i18n-1.10.0/lib/i18n.rb:302:in `transliterate'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/inflector/transliterate.rb:82:in `transliterate'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/inflector/transliterate.rb:123:in `parameterize'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/core_ext/string/inflections.rb:196:in `parameterize'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/override.rb:46:in `initialize'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/dsl/context.rb:15:in `new'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/dsl/context.rb:15:in `create_override'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/dsl/loader.rb:56:in `build_context_and_extract_dsl_from'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/dsl/loader.rb:37:in `build_erb_context'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/dsl/loader.rb:27:in `build_context'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/dsl/loader.rb:22:in `block in load'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/dsl/loader.rb:17:in `open'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/dsl/loader.rb:17:in `load'
/app-src/vendor/bundle/ruby/2.7.0/gems/polyglot-0.3.5/lib/polyglot.rb:49:in `load'
/app-src/vendor/bundle/ruby/2.7.0/gems/polyglot-0.3.5/lib/polyglot.rb:68:in `rescue in require'
/app-src/vendor/bundle/ruby/2.7.0/gems/polyglot-0.3.5/lib/polyglot.rb:64:in `require'
/app-src/vendor/bundle/ruby/2.7.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/environment.rb:94:in `block (2 levels) in enumerate_and_load'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/environment.rb:93:in `glob'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/environment.rb:93:in `block in enumerate_and_load'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/environment.rb:85:in `each'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/environment.rb:85:in `enumerate_and_load'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/environment.rb:79:in `load_overrides'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/environment.rb:62:in `block in load_all'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/environment.rb:60:in `each'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/environment.rb:60:in `load_all'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/railtie.rb:12:in `activate'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:428:in `instance_exec'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:428:in `block in make_lambda'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:200:in `block (2 levels) in halting'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:605:in `block (2 levels) in default_terminator'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:604:in `catch'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:604:in `block in default_terminator'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:201:in `block in halting'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:513:in `block in invoke_before'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:513:in `each'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:513:in `invoke_before'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:134:in `run_callbacks'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/reloader.rb:88:in `prepare!'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/application/finisher.rb:113:in `block in <module:Finisher>'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/initializable.rb:32:in `instance_exec'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/initializable.rb:32:in `run'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/initializable.rb:61:in `block in run_initializers'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/initializable.rb:60:in `run_initializers'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/application.rb:363:in `initialize!'
/app-src/config/environment.rb:7:in `<main>'
/app-src/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/app-src/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/app-src/vendor/bundle/ruby/2.7.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/app-src/vendor/bundle/ruby/2.7.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/dependencies.rb:324:in `block in require'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/dependencies.rb:291:in `load_dependency'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/dependencies.rb:324:in `require'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/application.rb:339:in `require_environment!'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/application.rb:523:in `block in run_tasks_blocks'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/command.rb:48:in `invoke'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/commands.rb:18:in `<main>'
/app-src/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/app-src/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
bin/rails:4:in `<main>'

Caused by:
LoadError: cannot load such file -- /app-src/vendor/bundle/ruby/2.7.0/gems/decidim-reporting_proposals-0.2.0/app/overrides/layouts/decidim/_process_header_steps/always_show_new_proposals.html.erb.deface
/app-src/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/app-src/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/app-src/vendor/bundle/ruby/2.7.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/app-src/vendor/bundle/ruby/2.7.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/environment.rb:94:in `block (2 levels) in enumerate_and_load'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/environment.rb:93:in `glob'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/environment.rb:93:in `block in enumerate_and_load'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/environment.rb:85:in `each'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/environment.rb:85:in `enumerate_and_load'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/environment.rb:79:in `load_overrides'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/environment.rb:62:in `block in load_all'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/environment.rb:60:in `each'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/environment.rb:60:in `load_all'
/app-src/vendor/bundle/ruby/2.7.0/gems/deface-1.9.0/lib/deface/railtie.rb:12:in `activate'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:428:in `instance_exec'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:428:in `block in make_lambda'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:200:in `block (2 levels) in halting'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:605:in `block (2 levels) in default_terminator'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:604:in `catch'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:604:in `block in default_terminator'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:201:in `block in halting'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:513:in `block in invoke_before'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:513:in `each'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:513:in `invoke_before'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/callbacks.rb:134:in `run_callbacks'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/reloader.rb:88:in `prepare!'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/application/finisher.rb:113:in `block in <module:Finisher>'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/initializable.rb:32:in `instance_exec'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/initializable.rb:32:in `run'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/initializable.rb:61:in `block in run_initializers'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/initializable.rb:60:in `run_initializers'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/application.rb:363:in `initialize!'
/app-src/config/environment.rb:7:in `<main>'
/app-src/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/app-src/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/app-src/vendor/bundle/ruby/2.7.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
/app-src/vendor/bundle/ruby/2.7.0/gems/zeitwerk-2.5.4/lib/zeitwerk/kernel.rb:35:in `require'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/dependencies.rb:324:in `block in require'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/dependencies.rb:291:in `load_dependency'
/app-src/vendor/bundle/ruby/2.7.0/gems/activesupport-6.0.5/lib/active_support/dependencies.rb:324:in `require'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/application.rb:339:in `require_environment!'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/application.rb:523:in `block in run_tasks_blocks'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/command.rb:48:in `invoke'
/app-src/vendor/bundle/ruby/2.7.0/gems/railties-6.0.5/lib/rails/commands.rb:18:in `<main>'
/app-src/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/app-src/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.11.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => assets:precompile => webpacker:compile => environment
(See full trace by running task with --trace)
microstudi commented 1 year ago

@Kagemaru I think I have a solution for this. I've been able to test it locally.

The problem is, indeed, the combination of deface with term customizer. Here's what you need to do in the application to fix it:

  1. Edit the file config/environments/production.rb and add this:
    config.deface.enabled = ENV['DB_ADAPTER'].blank? || ENV['DB_ADAPTER'] == 'postgresql'
  2. Then precompile with these ENV enabled in your CI:
    DB_ADAPTER=nulldb RAILS_ENV=production rake assets:precompile

This should solve it, please let me know how it goes!

microstudi commented 1 year ago

If this works, I'll add this to the README as install instructions

Kagemaru commented 1 year ago

@microstudi It worked :smiley: I changed it a bit for our environment:

#config/environments/production.rb
config.deface.enabled = !(ENV['DISABLE_DEFACE'].to_s.in? %w[true on 1])

and

#Dockerfile
ARG DISABLE_DEFACE="true"
paarals commented 1 year ago

perfect @Kagemaru, could you close this issue if its solved?

microstudi commented 1 year ago

I'll be closing this as I've added the instructions on how to deal with this situation here https://github.com/openpoke/decidim-module-reporting-proposals/pull/59 (along with a fix to make compatible this module with https://github.com/openpoke/decidim-module-participatory-documents)