Erreur 500 lors de l'activation des plugins (asset introuvable dans le chemin de chargement.)

Hi,

whenever I activate a plugin, the site thows a 500, leading me to have to deactivate the plugin again.

/logs shows: ActionView::Template::Error (The asset ‘plugins/discourse-translator.js’ was not found in the load path.) lib/freedom_patches/propshaft_patches.rb:16:in ‘compute_asset_path’ app/helpers/application_he

propshaft (1.3.1) lib/propshaft/helper.rb:50:in 'Propshaft::Helper#compute_asset_path'
lib/freedom_patches/propshaft_patches.rb:16:in 'compute_asset_path'
actionview (8.0.4) lib/action_view/helpers/asset_url_helper.rb:204:in 'ActionView::Helpers::AssetUrlHelper#asset_path'
app/helpers/application_helper.rb:94:in 'ApplicationHelper#script_asset_path'
app/helpers/application_helper.rb:144:in 'block in ApplicationHelper#preload_script'
app/helpers/application_helper.rb:143:in 'Array#map'
app/helpers/application_helper.rb:143:in 'ApplicationHelper#preload_script'
app/views/layouts/application.html.erb:51
app/views/layouts/application.html.erb:50:in 'Array#each'
app/views/layouts/application.html.erb:50
actionview (8.0.4) lib/action_view/base.rb:278:in 'Kernel#public_send'
actionview (8.0.4) lib/action_view/base.rb:278:in 'ActionView::Base#_run'
actionview (8.0.4) lib/action_view/template.rb:284:in 'block in ActionView::Template#render'
activesupport (8.0.4) lib/active_support/notifications.rb:212:in 'ActiveSupport::Notifications.instrument'
actionview (8.0.4) lib/action_view/template.rb:583:in 'ActionView::Template#instrument_render_template'
actionview (8.0.4) lib/action_view/template.rb:272:in 'ActionView::Template#render'
rack-mini-profiler (4.0.1) lib/mini_profiler/profiling_methods.rb:90:in 'block in ActionView::Template#profile_method'
actionview (8.0.4) lib/action_view/renderer/template_renderer.rb:77:in 'block in ActionView::TemplateRenderer#render_with_layout'
activesupport (8.0.4) lib/active_support/notifications.rb:210:in 'block in ActiveSupport::Notifications.instrument'
activesupport (8.0.4) lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument'
activesupport (8.0.4) lib/active_support/notifications.rb:210:in 'ActiveSupport::Notifications.instrument'
actionview (8.0.4) lib/action_view/renderer/template_renderer.rb:75:in 'ActionView::TemplateRenderer#render_with_layout'
actionview (8.0.4) lib/action_view/renderer/template_renderer.rb:59:in 'ActionView::TemplateRenderer#render_template'
actionview (8.0.4) lib/action_view/renderer/template_renderer.rb:11:in 'ActionView::TemplateRenderer#render'
actionview (8.0.4) lib/action_view/renderer/renderer.rb:58:in 'ActionView::Renderer#render_template_to_object'
actionview (8.0.4) lib/action_view/renderer/renderer.rb:31:in 'ActionView::Renderer#render_to_object'
actionview (8.0.4) lib/action_view/rendering.rb:136:in 'block in ActionView::Rendering#_render_template'
actionview (8.0.4) lib/action_view/base.rb:305:in 'ActionView::Base#in_rendering_context'
actionview (8.0.4) lib/action_view/rendering.rb:135:in 'ActionView::Rendering#_render_template'
actionpack (8.0.4) lib/action_controller/metal/streaming.rb:179:in 'ActionController::Streaming#_render_template'
actionview (8.0.4) lib/action_view/rendering.rb:122:in 'ActionView::Rendering#render_to_body'
actionpack (8.0.4) lib/action_controller/metal/rendering.rb:186:in 'ActionController::Rendering#render_to_body'
actionpack (8.0.4) lib/action_controller/metal/renderers.rb:140:in 'ActionController::Renderers#render_to_body'
actionpack (8.0.4) lib/abstract_controller/rendering.rb:28:in 'AbstractController::Rendering#render'
actionpack (8.0.4) lib/action_controller/metal/rendering.rb:167:in 'ActionController::Rendering#render'
actionpack (8.0.4) lib/action_controller/metal/instrumentation.rb:31:in 'block (2 levels) in ActionController::Instrumentation#render'
activesupport (8.0.4) lib/active_support/benchmark.rb:17:in 'ActiveSupport::Benchmark.realtime'
actionpack (8.0.4) lib/action_controller/metal/instrumentation.rb:31:in 'block in ActionController::Instrumentation#render'
actionpack (8.0.4) lib/action_controller/metal/instrumentation.rb:100:in 'ActionController::Instrumentation#cleanup_view_runtime'
activerecord (8.0.4) lib/active_record/railties/controller_runtime.rb:46:in 'ActiveRecord::Railties::ControllerRuntime#cleanup_view_runtime'
actionpack (8.0.4) lib/action_controller/metal/instrumentation.rb:30:in 'ActionController::Instrumentation#render'
app/controllers/categories_controller.rb:75:in 'block (2 levels) in CategoriesController#index'
actionpack (8.0.4) lib/action_controller/metal/mime_responds.rb:224:in 'ActionController::MimeResponds#respond_to'
app/controllers/categories_controller.rb:50:in 'CategoriesController#index'
actionpack (8.0.4) lib/action_controller/metal/basic_implicit_render.rb:8:in 'ActionController::BasicImplicitRender#send_action'
actionpack (8.0.4) lib/abstract_controller/base.rb:215:in 'AbstractController::Base#process_action'
actionpack (8.0.4) lib/action_controller/metal/rendering.rb:193:in 'ActionController::Rendering#process_action'
actionpack (8.0.4) lib/abstract_controller/callbacks.rb:261:in 'block in AbstractController::Callbacks#process_action'
activesupport (8.0.4) lib/active_support/callbacks.rb:120:in 'block in ActiveSupport::Callbacks#run_callbacks'
app/controllers/application_controller.rb:442:in 'block in ApplicationController#with_resolved_locale'
i18n (1.14.7) lib/i18n.rb:353:in 'I18n::Base#with_locale'
app/controllers/application_controller.rb:442:in 'ApplicationController#with_resolved_locale'
activesupport (8.0.4) lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks'
app/controllers/application_controller.rb:1088:in 'ApplicationController#ensure_dont_cache_page'
activesupport (8.0.4) lib/active_support/callbacks.rb:129:in 'block in ActiveSupport::Callbacks#run_callbacks'
activesupport (8.0.4) lib/active_support/callbacks.rb:140:in 'ActiveSupport::Callbacks#run_callbacks'
actionpack (8.0.4) lib/abstract_controller/callbacks.rb:260:in 'AbstractController::Callbacks#process_action'
actionpack (8.0.4) lib/action_controller/metal/rescue.rb:27:in 'ActionController::Rescue#process_action'
actionpack (8.0.4) lib/action_controller/metal/instrumentation.rb:76:in 'block in ActionController::Instrumentation#process_action'
activesupport (8.0.4) lib/active_support/notifications.rb:210:in 'block in ActiveSupport::Notifications.instrument'
activesupport (8.0.4) lib/active_support/notifications/instrumenter.rb:58:in 'ActiveSupport::Notifications::Instrumenter#instrument'
activesupport (8.0.4) lib/active_support/notifications.rb:210:in 'ActiveSupport::Notifications.instrument'
actionpack (8.0.4) lib/action_controller/metal/instrumentation.rb:75:in 'ActionController::Instrumentation#process_action'
actionpack (8.0.4) lib/action_controller/metal/params_wrapper.rb:259:in 'ActionController::ParamsWrapper#process_action'
activerecord (8.0.4) lib/active_record/railties/controller_runtime.rb:39:in 'ActiveRecord::Railties::ControllerRuntime#process_action'
actionpack (8.0.4) lib/abstract_controller/base.rb:152:in 'AbstractController::Base#process'
actionview (8.0.4) lib/action_view/rendering.rb:40:in 'ActionView::Rendering#process'
rack-mini-profiler (4.0.1) lib/mini_profiler/profiling_methods.rb:90:in 'block in ActionController::Base#profile_method'
actionpack (8.0.4) lib/action_controller/metal.rb:252:in 'ActionController::Metal#dispatch'
actionpack (8.0.4) lib/action_controller/metal.rb:335:in 'ActionController::Metal.dispatch'
actionpack (8.0.4) lib/action_dispatch/routing/route_set.rb:67:in 'ActionDispatch::Routing::RouteSet::Dispatcher#dispatch'
actionpack (8.0.4) lib/action_dispatch/routing/route_set.rb:50:in 'ActionDispatch::Routing::RouteSet::Dispatcher#serve'
actionpack (8.0.4) lib/action_dispatch/routing/mapper.rb:32:in 'block in <class:Constraints>'
actionpack (8.0.4) lib/action_dispatch/routing/mapper.rb:62:in 'ActionDispatch::Routing::Mapper::Constraints#serve'
actionpack (8.0.4) lib/action_dispatch/journey/route

This happens with:

some old community plugins failing would lead me to believe them being too old, but the discourse-translator failing leads more to a problem of plugins and assets being “wrong”. These plugins are the only non-preinstalled plugins, so it’s a general “I cannot install plugins” problem.

I tagged as unsupported-install, as I use the discourse/discourse:2026.1.1 (esr) docker image, which works perfectly but with this plugin issue. I did mount a docker volume to the plugins-directory (- plugins:/var/www/discourse/plugins). I installed plugins via rake plugin:install[https://github.com/…]
The error message tells me about a missing asset, which is actually there (see below). Maybe there is a rake-command missing?

I did a rake db:migrate (none of the plugins have extra tables) and did rake assets:precompile(which is also done on container restart, which was done multiple times already). logs show discourse-translator and discourse-prevent-posting get precompiled, the scheduled-readonly does not as it has no assets (but still fails because its .js is not found in the assets load-path?)

Below shows that discourse-translator was precompiled and should be in the right places, I think? Any pointers towards what I can look at next?

discourse@59c1450786e0:/var/www/discourse$ find . -type f -name "*discourse-translator*"
./frontend/discourse/dist/assets/plugins/discourse-translator.map
./frontend/discourse/dist/assets/plugins/discourse-translator.js
./public/assets/plugins/discourse-translator-528f7bc3.js.gz
./public/assets/plugins/discourse-translator-528f7bc3.js.br
./public/assets/plugins/discourse-translator-528f7bc3.js
./public/assets/plugins/discourse-translator-62208e74.map
./tmp/stylesheet-cache/discourse-translator_rtl_66ab73aaa7b3ab50cd6f88921264d7933487aa18.css
./tmp/stylesheet-cache/discourse-translator_66ab73aaa7b3ab50cd6f88921264d7933487aa18.css
./tmp/stylesheet-cache/discourse-translator_cc99d90d66ec528a261e18f38cdc144b5ecfddc7.css.map
./tmp/stylesheet-cache/discourse-translator_rtl_cc99d90d66ec528a261e18f38cdc144b5ecfddc7.css
./tmp/stylesheet-cache/discourse-translator_66ab73aaa7b3ab50cd6f88921264d7933487aa18.css.map
./tmp/stylesheet-cache/discourse-translator_cc99d90d66ec528a261e18f38cdc144b5ecfddc7.css

Mon pari est que le plugin de traduction est soit cassé, soit qu’il ne devrait plus être utilisé :man_shrugging: Ne pas l’utiliser dans app.yml ?

Nous utilisons ces plugins pour certains de nos clients. Ils fonctionnent certainement sur 2026.1.1.

Pareil : le plugin de traduction fonctionne sur 2026.1.1.

Je n’exclus pas cela comme cause.

3 « J'aime »

re: volume.

Le volume est uniquement destiné au stockage (persistant) des données du plugin (dépôts git) et n’a rien à voir avec les chemins où résident les actifs compilés.
Mais j’ai testé le problème sans utiliser de volume pour les plugins et le problème persiste.

C’est aussi une bonne nouvelle d’apprendre que les plugins communiteq sont juste « terminés » et fonctionnent, c’est pourquoi ils n’ont pas besoin de nouveaux commits :slight_smile: