Disable plugins without restarting?

AI-generated summary

The discussion revolves around disabling plugins in Discourse without a full server restart, which is time-consuming. kcoop is troubleshooting plugin conflicts, particularly with discourse-affiliate and discourse-adplugin, and seeks a quicker method than restarting via launcher. Mittineague suggests uninstalling the plugin and rebuilding, but JSey offers a faster workaround: running rake assets:precompile and restarting unicorn after modifying plugins in /var/www/discourse/plugins. kcoop appreciates the solution. sam notes that rake handles environment setup automatically, and codinghorror references Discourse’s built-in “safe mode” as an alternative for such scenarios safe mode.

I’m finding Amazon oneboxes are failing to expand on my production server, but they work on meta.discourse.org, and on my dev site. I’m thinking it’s likely a conflict with discourse-affiliate or discourse-adplugin. I’m able to ‘soft’ disable discourse-affiliate, since it has a setting, but I’m not sure that’s trustworthy in testing this, and there isn’t one for discourse-adplugin.

Restarting with launcher is very obtrusive at this point, probably a 20 minute down time. Is there a way to disable plugins without this? Don’t mind ssh if it’s relatively bullet proof.

You’re not testing in a non-live site?

Anyway, AFAIK disabling a plugin means it won’t “do its thing” but as Discourse compiles plugin code a lot of it may still be causing conflicts.
The only sure way I’ve found is to uninstall (remove) the plugin then rebuild

I am testing in a non-live site, but was doing so without those plugins for various reasons. I am now adding them on the non-live site to see if I can replicate it.

I understand what you mean about the code’s presence alone being enough to cause problems. What I guess I’m wondering is if there’s a way to only partially rebuild that isn’t so costly in time. I can, for example, update to new versions of git hosted plugins from the docker manager; is there a way to remove a plugin using this same execution path?

You could also do a

RAILS_ENV=production rake assets:precompile

in the /var/www/discourse directory if you’ve SSH’d in, and then do a

sv restart unicorn

…that should be much faster. You can move plugins in and out of /var/www/discourse/plugins, which should do the trick…

Exactly what I was looking for. Thanks!

Note, rake is a shell script that takes care of env in the docker container, no need to specify it again

@sam added a Discourse “safe mode” to handle this case