Fehler 500 beim Aktivieren von Plugins (Asset nicht im Ladepfad gefunden.)

Hallo,

immer wenn ich ein Plugin aktiviere, wirft die Site einen 500er-Fehler, sodass ich das Plugin wieder deaktivieren muss.

In /logs steht: ActionView::Template::Error (Das Asset 'plugins/discourse-translator.js' wurde im Load-Pfad nicht gefunden.) 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

Das passiert bei:

Dass einige alte Community-Plugins fehlschlagen, würde ich darauf zurückführen, dass sie zu alt sind, aber das Versagen von discourse-translator deutet eher auf ein Problem mit Plugins und Assets hin, die „falsch“ sind. Diese Plugins sind die einzigen, die nicht vorinstalliert sind, also liegt hier ein allgemeines Problem vor: „Ich kann keine Plugins installieren“.

Ich habe als Label „unsupported-install“ gesetzt, da ich das Docker-Image discourse/discourse:2026.1.1 (esr) verwende, das ansonsten einwandfrei funktioniert, außer bei diesem Plugin-Problem. Ich habe ein Docker-Volume für das Plugins-Directory gemountet (- plugins:/var/www/discourse/plugins). Plugins habe ich über rake plugin:install[https://github.com/…] installiert.

Die Fehlermeldung weist auf ein fehlendes Asset hin, das tatsächlich vorhanden ist (siehe unten). Vielleicht fehlt ein rake-Befehl?

Ich habe rake db:migrate ausgeführt (keine der Plugins hat zusätzliche Tabellen) und rake assets:precompile (was auch beim Neustart des Containers erfolgt, was bereits mehrfach geschehen ist). Die Logs zeigen, dass discourse-translator und discourse-prevent-posting vorkompiliert werden, während scheduled-readonly nicht vorkompiliert wird, da es keine Assets hat (aber trotzdem fehlschlägt, weil seine .js-Datei nicht im Asset-Ladepfad gefunden wird?).

Unten ist zu sehen, dass discourse-translator vorkompiliert wurde und sich an den richtigen Stellen befinden sollte, oder? Gibt es Hinweise, was ich als Nächstes prüfen kann?

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

Meine Wette ist, dass das Übersetzer-Plugin entweder kaputt ist oder nicht mehr verwendet werden sollte :man_shrugging: Nicht in der app.yml verwenden?

Wir verwenden diese Plugins für einige unserer Kunden. Sie funktionieren definitiv auf 2026.1.1.

Dasselbe: Das Übersetzer-Plugin funktioniert auf 2026.1.1.

Ich würde dies nicht als Ursache ausschließen.

re: Volume.

Das Volume dient nur zur (dauerhaften) Speicherung der Plugin-Daten (Git-Repos) und hat nichts mit den Pfaden zu tun, in denen die kompilierten Assets liegen.
Aber ich habe das Problem getestet, ohne ein Volume für die Plugins zu verwenden, und das Problem besteht weiterhin.

Auch schön zu hören, dass die communiteq-Plugins einfach „fertig“ sind und funktionieren, deshalb brauchen sie keine neuen Commits :slight_smile: